Closed eeedean closed 5 months ago
have you encountered this issue ? because afaik the /tmp dir is empty for each sandbox, and since the derivations do not use any impurities (yet?) there should be no possibility for a collision.
I cannot rule out, that this is a special issue, I run into, because I develop on a macOS host, set up using determinate-systems installer and nix-darwin.
At least in my particular setup I had the described behavior. Maybe it's similar, when running Nix Builds on non-NixOS based Linux-Distributions. Did not test that in detail.
could you try it with just tmp/module_file.module, so that its still a generic file, but definitely in the build dir?
Can you post the output of the nix doctor
command?
Mine looks like this:
[PASS] PATH contains only one nix version.
[PASS] All profiles are gcroots.
[PASS] Client protocol matches store protocol.
[INFO] You are trusted by store uri: daemon
My intuition on this would be that at least for a multi-user (deamon) Install of Nix, builds should not share the same /tmp
directory. I do not know in https://github.com/DeterminateSystems/nix-installer supports both single- and multi-user installs on macOS.
Looks like this might still be the state of things: https://stackoverflow.com/a/67607698
Looks like this might still be the state of things: https://stackoverflow.com/a/67607698
I indeed can verify that behavior on my machine.
could you try it with just tmp/module_file.module, so that its still a generic file, but definitely in the build dir?
I adjusted my branch accordingly. That works beautifully and I think, that's a better approach than my initial proposal.
Parallel building may fail, because multiple build users try to write to the same file (
/tmp/module_file.module
). In order to avoid that, I added the user id as well as some more verbose information to the file name.Unfortunately user id (or something unique to the build user) is required, because some modules are referenced by multiple other modules. However, since Nix does always build in a *NIX-compatible environment, there should always be some user id available.