Conversation
3131933 to
bd1944e
Compare
|
Perhaps it is better to do this in shell and use |
wolfgangwalther
left a comment
There was a problem hiding this comment.
I remember reading a discussion somewhere, but can't find the source right now, where it was argued that env should only contain strings, not lists etc. - the "caller" should make sure to turn lists into strings already.
In general, we should analyze the case of NIX_CFLAGS_COMPILE and decide whether it really is supposed to be an environment variable (because it needs to be passed on to other processes than stdenv) or whether it is actually an argument to stdenv / hooks only. Then we should standardize on one way to call it.
I suspect that it should not really be an environment variable, but people think it is, because of its capitalized spelling.
I briefly looked at usages of |
bd1944e to
a6cdefc
Compare
I thought |
Yes, it is currently used as an environment variable by the CC wrapper. That's because it needs to pass the boundary between stdenv and the wrapper - different process, so just a bash variable won't work. This means, that every Now, imho, we have two ways out:
I don't have a concrete proposal for the latter and while the former is some migration effort, it's probably the more sensible option. In any case, that means that we should not do what is proposed in this PR, i.e. we should not support both Once we agree that The whole mess around structuredAttrs originated exactly in this: Without structuredAttrs, structured nix-level drv args were passed as environment variables in bash. This caused all the problems! With the invention of both structuredAttrs (for drv args) and Thus, I think we should be very explicit and only accept pure string in TLDR: I don't think we should do what is proposed here at all. The problem statement is this:
Which is exactly the thing that we need to clean up, also for structuredAttrs support, as mentioned above. Let's just get rid of that and |
|
Also related: #217206 - a migration to |
|
I'm closing this as there doesn't seem to be any consensus (yet) on how this should be done. Someone else can pick this up if they're interested. |
Some derivations set
NIX_CFLAGS_COMPILEdirectly as args (i.e. not in env) which results in:(There are more adapters that need the same handling but probably makes sense to come up with a more general approach of merging
argsandenv.args).Related #306953.
Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.