-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
opam: fix opam sandboxing on nixos #363770
base: master
Are you sure you want to change the base?
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm no nixos expert but from afar it looks reasonable
I've opened a PR upstream fixing this issue: ocaml/opam#6333 |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/prs-ready-for-review/3032/5027 |
|
To make opam sandboxing (via bwrap) work on nixos, the following had been used here: --set OPAM_USER_PATH_RO /run/current-system/sw/bin:/nix/ However, OPAM_USER_PATH_RO has been removed in opam 2.2.0, requiring a new workaround: ocaml/opam@9b6370d (Before this commit, executing `opam init` would display that sandboxing fails with "bwrap: execvp sh: No such file or directory".) - Removes outdated workarounds for ocp-build and argv0, cleans postInstall - Fixes link to the changelog which was broken because of "with lib;"
(The ofborg failure does not look related to this.) |
Before this commit, executing
opam init
would display that sandboxing fails with "bwrap: execvp sh: No such file or directory".makeWrapper
with--set OPAM_USER_PATH_RO /run/current-system/sw/bin:/nix/
had been used here to fix that, however, OPAM_USER_PATH_RO has been removed since 2021: ocaml/opam@9b6370d (released as opam 2.2.0 in 2024)This also fixes a funny bug which caused the changelog link to be broken because of
with lib
:It uses
meta = with lib;
; at the same time, the derivation's attrset is notrec
, and${version}
ends to belib.version
.cc @kit-ty-kate
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.