-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
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
pythonPackages.Theano: set NIX_ENFORCE_PURITY=0 for invocation of wrapped compiler #99516
Conversation
12ab88f
to
8081c35
Compare
…pped compiler this should prevent the wrapper from objecting to the path of the object file
8081c35
to
2d9839d
Compare
The settings on the temporary variables should be fully addressed with #97597. That isn't to say though that not setting In the past one person ran into issues due to making their home directory a symlink. This resulted in their being multiple paths to the same libraries, only one of which was recognized as being pure. Not settings All I did though was advice them not to use symlinks for their home as it is generally a bad idea in my experience. For example, if It is likely also worth mentioning, now that I'm more familiar with cross compilation, technically we should have the runtime version of the buildtime compiler. This hasn't been an issue yet though as I don't think anytime is cross compiling theano. 😁 |
I'm proposing this PR because it isn't fixed. Theano on In particular this means that |
That is because #97597 was just recently merged into staging, so it hasn't yet landed in master |
Ahh staging - I didn't notice that. 👍 I'm looking at something that will be safely backportable to 20.09 though, and I'm not sure how people will feel about a significant compiler-wrapper change. |
I'm not opposed to this patch. I just don't know if it will be a net win or not. From a purity standpoint, I prefer the purity filtering. From a practical standpoint though, it if we keep running into corner cases, it is better to forgo it. What we don't know is if we are going to discover corner cases from disabling it because the purity enforcement isn't just about checking, it also actively strips possibly problematic paths from the users environment (IIRC, this was an issue on our CentOS based super computer clusters). If we do merge this, my suggestion would be to pass through the user's
so, if there are people who require it, or we think it might help them, there will be a way to re-enable it by manual exporting Another, possibly better, alternative would be to combine this with clearing the user environment before invoking the compiler
as I expect this may also be sufficient to resolve the bad user's environment issues that the purity checking took care of. Assuming this last one works, I would suggest merging that into 20.09. It would probably be fine for master too, if people really wanted it, although my slight personal preference would be to find out first where things sit with hydra once staging lands. |
Ok let's wait for staging to land. Though I'm sceptical that even if everything is happy, the staging solution will be appropriate for 20.09 given how close we're getting. Patching things here can only ever break theano-related packages, which is why I like it. I'm also running the implications of fully stripping env for the compiler wrapper through my mind... |
Well, the compiler environment wouldn't be fully stripped. It would be the build environment variables stripped of any variables set to absolute paths other than those under
prints all the bash
which is what gets put at the start of the gcc wrapper script. Still, it is a bit of an approximation though. From the gcc environment variables page, you can see there are both environment variables you wouldn't want leaking to the compiler (e.g., This is what makes hijacking the existing nix purity filtering system seem so tempting. |
I think the problem with respecting the user's |
|
It's still causing problems on 20.09 because it lacks #97597 (and its predecessor), and I think it's probably too significant a change to introduce to 20.09 at this stage. However I have figured out a workaround I can use for 20.09, which I'm about to open a PR for shortly. (edit: this is #100955) Certainly this PR can be closed. |
Motivation for this change
This should unblock some ZHF (#97479) targets.
Theano
currently builds but doesn't work properly as the nix compiler wrapper gets upset with the path of the temporary file thatTheano
generates - it considers it an impure path. Issues discussing this: #91431, #93560, #73051This may be an extremely naive solution from me, but it does appear to work just making sure
NIX_ENFORCE_PURITY
is set to zero before the compiler-wrapper is invoked.Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)