[Nix-dev] NIX_ENFORCE_NO_NATIVE

Nikolay Amiantov ab at fmap.me
Sun Jun 12 13:16:22 CEST 2016


I guess this is another instance of
https://github.com/NixOS/nixpkgs/issues/13744 . By "another instance"
here I mean that we have a mismatch of interests:

1) people who use `nix-shell` for developing want less purity w.r.t.
compiler flags, access to paths and working features;
2) those who use it for testing packages' want to observe how the
package behaves with _more_ purity.

I think a good approach is:

1) Export information on whether the shell is pure. See
https://github.com/NixOS/nix/pull/933 for that;
2) Disable more inconvenient flags like NIX_ENFORCE_NO_NATIVE,
SSL_CERT_FILE etc. in non-pure shell.
3) Advertise people to use `--pure` when they want to test a package,
and no flags when they develop.

How does that sound? What would the disadvantages be?

On 06/12/2016 01:08 PM, Andreas Herrmann wrote:
> Thanks for clarifying that. I did indeed not get that point. I do all my development within nix-shells nearly all the time. I should have mentioned that in the beginning, sorry. It seems that it would be difficult to distinguish gcc being called from within a nix-builder to it being called on the command-line within a nix-shell.
> 
> 
>> 2) If you set NIX_DEBUG=1 those omission won't be silent:
>> $ env NIX_ENFORCE_NO_NATIVE=1 NIX_DEBUG=1 g++ [...]
>> skipping impure path -march=native
>> [...]
>>
>> (Yes, in this case it's not very friendly to call it a path.)
> 
> I did not know about that flag. Thanks for mentioning it.
> 
> I still think that a more verbose kind of warning would be preferable in that particular case.
> 
> I guess for now I will have to develop a habit of running my nix builds with NIX_DEBUG=1 after an update of the package set to see if any compiler flags have changed.
> 
> 
> Best, Andreas
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
> 

-- 
Nikolay.


More information about the nix-dev mailing list