-
Notifications
You must be signed in to change notification settings - Fork 349
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
Adding way to mount unusual path in bwrap sandbox #3540
Conversation
ErwanGa
commented
Sep 12, 2018
src/state/shellscripts/bwrap.sh
Outdated
add_mounts ro "$(dirname $OPAM_SWITCH_PREFIX)/config.lock" | ||
add_mounts ro "$(dirname $OPAM_SWITCH_PREFIX)/download-cache" | ||
add_mounts ro "$(dirname $OPAM_SWITCH_PREFIX)/lock" | ||
add_mounts ro "$(dirname $OPAM_SWITCH_PREFIX)/opam-init" |
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 afraid there is some confusion between OPAMROOT
which contains global configuration files and OPAM_SWITCH_PREFIX
which contains local switch configuration and installation structure. It's the opam root that contains those files, not the switch prefix. Plus, at build stage, opam don't need to access to its opam root (if so, it's a packaging issue).
I've checked and I can confirm that it works as is: having opam root and opam switch in an unlisted directory, launching an install from another one unrelated.
What is you configuration? You can have internal values of root & switch with opam config list
.
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.
Ok
Seems to be package issue.
Shall I do another pr without this part of the patch ?
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.
Seems to be package issue.
What is the package you tried to install?
Shall I do another pr without this part of the patch ?
No need to create a new one, you can update this PR by updating the branch you used. You can squash commits in order to have a clean history.
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've such issue with package cpuid @ version 0.1.1.
I'll update the pr asap
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.
Usually, cpuid can be installed as $HOME
is ro mounted and it uses opam to access configuration (via ocb-stubblr
, cf. above links). The ocb-stubblr
PR is not yet merged fixing it, so meanwhile it still need to access opam root, but just in ro.
I tried using the new OPAM_USER_PATH_RO
variable set to an unusual opam root and it installed with no problem.
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.
Understood...
PR has been updated. It now only contains the OPAM_USER_PATH_RO patch
- add usage OPAM_USER_PATH_RO environement variable for setting unusual pathes in mount bind_ro list - remove some unusual path from the script (/nix/store /rw/usrlocal)
Thanks! |
- add usage OPAM_USER_PATH_RO environement variable for setting unusual pathes in mount bind_ro list - remove some unusual path from the script (/nix/store /rw/usrlocal)
- add usage OPAM_USER_PATH_RO environement variable for setting unusual pathes in mount bind_ro list - remove some unusual path from the script (/nix/store /rw/usrlocal)
- add usage OPAM_USER_PATH_RO environement variable for setting unusual pathes in mount bind_ro list - remove some unusual path from the script (/nix/store /rw/usrlocal)
- add usage OPAM_USER_PATH_RO environement variable for setting unusual pathes in mount bind_ro list - remove some unusual path from the script (/nix/store /rw/usrlocal)