buildFHSUserEnv: use -a "$0" in almost last exec#83296
buildFHSUserEnv: use -a "$0" in almost last exec#83296doronbehar wants to merge 1 commit intoNixOS:staging-nextfrom
Conversation
|
I went back and forth on this design when working on the quartus package, and I'm not sure I like using I would suggest a slightly more invasive change, something along the line of Then, if |
|
Regarding #82259 (comment): Requests for opinion are of course also okay, although they do take a bit more time :) I've actually seen this one already. I didn't act on it because
|
@kwohlfahrt I tend to agree now... I'll work on this sometime... |
Motivation for this change
In a derivation using buildFHSUserEnv, I'd like to support multiple executables in
$out/binusing a script such as:While in the derivation coming out of
buildFHSUserEnv, I'm putting inextraInstallCommands:Where
listOfExecutablesis some list I'm controlling via:The idea is that every executable's name in
listOfExecutablesis linked to the main executable -$out/bin/${name}and that executable is calling in turnrunScript. I'd likerunScriptto know the original$0in order to know what real executable inside the FHS environment to call.Right now, it's impossible to implement this because the FHS' environment is calling
runScriptwithout-a "$0". This change should fix this (untested).Things done
sandboxinnix.confon non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"./result/bin/)nix path-info -Sbefore and after)