fish: ensure pexpect available for tests#461779
fish: ensure pexpect available for tests#461779jeafleohj wants to merge 2 commits intoNixOS:masterfrom
Conversation
|
winterqt
left a comment
There was a problem hiding this comment.
Thanks! Did you end up finding the root cause, or should I spend some time doing that? (Happy to.)
| preConfigure = '' | ||
| patchShebangs ./build_tools/git_version_gen.sh | ||
| patchShebangs ./tests/test_driver.py | ||
| substituteInPlace ./tests/test_driver.py --replace-warn '"python3",' '"${testPython}/bin/python3",' |
There was a problem hiding this comment.
Why is this required on Darwin and not Linux?
There was a problem hiding this comment.
On macOS the build runs unsandboxed, so python3 resolves to /usr/bin/python3 instead of the nixpkgs one; pointing to ${testPython}/bin/python3 ensures we always use the interpreter that has pexpect.
There was a problem hiding this comment.
But patching shebangs in ./tests/test_driver.py should point it to the nixpkgs python, no? I think something else is going on. Are nativeCheckInputs available in preConfigure (for patchShebangs to pick up)?
Maybe moving python to nativeBuildInputs would fix it. Or moving test shebang patching to the check phase.
There was a problem hiding this comment.
It's propably due to a hardcoded subprocess. It seems it finds PEXPECT (due to patchShebangs and python3 haveing PEXPECT available) and then calling a subprocess with python3 which does not resolve to the sandboxed python environment with PEXPECT but to the system python3:
|
|
After digging into this more, I have a slightly cleaner solution about ready. |
|
fish transitively causes direnv to fail to build on darwin |
Do you already have something or should we merge this to fix builds on darwin? |
Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.Add a 👍 reaction to pull requests you find important.