-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Darwin chroot approach? #361
Comments
👍 |
Also, bind mounts are quite possible if we set up osxfuse and bindfs. Probably less of a pain than NFS mounts, at least, but I think the hard link thing should work so with any luck we won't need any of that 😄 |
Another approach is fakeroot which also works without root privs or fuse Wout.
|
Err, scratch the above, I meant https://github.com/dex4er/fakechroot not https://alioth.debian.org/projects/fakeroot/ and while the former allows you to make a chroot with external symlinks, it doesn't work on OS X. The latter does work on OS X, but doesn't provide chroot 😢. So besides hardlinking that leaves only NFS or osxfuse, where the latter is reportedly less reliable + slower. I got chroot to work by simply hardlinking all of /usr/lib, which is obviously not the general idea... Or is it possible to build a pure stdenv from there? |
Not sure it counts as pure, but have you seen my recent stuff hooking up the Apple command-line utilities to nix (and I'll push a sensible xcode package this weekend), using my I'm still pretty new to nix, so don't know how |
I'm following it with interest! |
Well - that's interesting... I had to reboot because of the OSX update, and after the reboot, my /nix/store was entirely empty 😱. Perhaps it was because I violated one of the 6 rules mentioned at http://stackoverflow.com/a/4707231/124416, namely that /nix/store and /nix/var/pure share a common parent. I thought it would just fail to hardlink but it seems that it just hardlinks and then uncovers bugs. Sigh. I propose to never ever use directory hardlinks 😅. I think I'm going to set up dual boot. OS X is becoming a sad ghost of a real Unix system. Not including ZFS and instead using those stupid directory hardlinks, explicitly removing nullfs, removing ptrace() and not providing a granular permissions system for dtrace(), dropping support for gcc... Might as well use an iPad. Not happy 😠. So anyway, closing this since we have #317. Looks like it's between bindfs or nfs mounts now. |
TIL about sandbox-exec:
|
Check your Also, some unofficial information at http://dl.packetstormsecurity.net/papers/general/apple-sandbox.pdf. |
Maybe worth reopening the ticket? |
Sorry for the spam, but if you want to experiment:
And if you pass in As an added benefit, none of this requires root/sudo. |
Add filtered issues list
This uses a minor hack in which we check the rl_line_buffer global variable to workaround editline not including the colon in its completion callback. Fixes NixOS#361 Change-Id: Id159d209c537443ef5e37a975982e8e12ce1f486
As we know, OS X doesn't have bind mounts, but HFS+ does allow hardlinking directories.
So as long as the nix store and all desired impurities are on the same HFS+ filesystem, we could make a directory that hardlinks /nix and the impurities, and run all builds chroot-ed under there.
When I say chroot I'm not talking about the chroot build code (
nix/src/libstore/build.cc
Lines 1750 to 1854 in d98bfcb
To make a hardlink you need to call
link()
, there's an example CLI utilityhlink
at http://stackoverflow.com/a/805001/124416 and the very important counterparthunlink
at http://stackoverflow.com/a/4707231/124416 (if you delete files in hardlinked directories, they're gone everywhere - you need to unlink the hardlink).I tried creating
/nix/var/pure
with a hardlinkednix/store
and some libraries, and it does work, but I can't make chroot work yet 😅. I need a closure of all libraries I suppose, which I think I have but when I do a chroot it just exits without printing anything.As to why this is needed, I built bash and it picked up libraries from an old homebrew install 😢.
A completely different approach would be to export root over nfs to localhost and use nfs instead of bind mounts.
More eyeballs appreciated.
The text was updated successfully, but these errors were encountered: