opam: fix opam sandboxing on nixos#363770
Merged
GaetanLepage merged 1 commit intoNixOS:masterfrom Jan 10, 2025
Merged
Conversation
Member
Author
|
kit-ty-kate
approved these changes
Dec 10, 2024
Contributor
kit-ty-kate
left a comment
There was a problem hiding this comment.
i'm no nixos expert but from afar it looks reasonable
Contributor
|
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 |
Contributor
|
Member
Author
|
(The ofborg failure does not look related to this.) |
GaetanLepage
reviewed
Jan 9, 2025
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;"
Contributor
|
Contributor
|
Successfully created backport PR for |
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before this commit, executing
opam initwould display that sandboxing fails with "bwrap: execvp sh: No such file or directory".makeWrapperwith--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 = relaxedsandbox = truenix-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.