Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
python.pkgs.wrapPython: fix string makeWrapperArgs
Bash takes an assignment of a string to an array variable: local -a user_args user_args="(foo bar)" to mean appending the string to the array, not parsing the string into an array as is the case when on the same line as the declaration: local -a user_args="(foo bar)" b063340 extracted the declaration before the newly branched code block, causing string makeWrapperArgs being added to the array verbatim. Since local is function scoped, it does not matter if we move it inside each of the branches so we fix it this way.
- Loading branch information
a6bb2ed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/nix/store/nriqys8a294bn95a3zxb8rj1i1hra2jf-hook/nix-support/setup-hook: line 110: declare: makeWrapperArgs: not found
a6bb2ed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What package produces that?
a6bb2ed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I forgot
wrapPython
can be used even outsidemkPythonDerivation
. But I would expect that to fail even before b063340 withset -u
, as we used"($makeWrapperArgs)"
before too.a6bb2ed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've seen it with many packages, e.g.
a6bb2ed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cannot reproduce that. Getting a different error instead:
a6bb2ed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was using #76059
a6bb2ed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, there is NixOS/nix#1461, so
makeWrapperArgs
in fact are not passed to wrapPython in most cases.But weirdly, on #76059,
nix-build -A python3.pkgs.tox
succeeds for me (even with the error being printed). Are we not settingset -u
in Python setup hooks?a6bb2ed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be fixed with 21574b2.
The fact that
-o nounset
is not enabled in the setup hook is weird. I would expect #72347 to enable it there as well.And even when I try to enable it in the script
by the time
wrapPythonPrograms
is run inpostFixup
, it is disabled again.