1
0
Fork 0

artiq: pass wrapped python env to subprocesses

Fixes https://github.com/m-labs/artiq-comtools/issues/7.
Basically, python subprocesses can't see all installed python packages
in a python environment because it uses the wrong Python exe (i.e. it
doesn't use the wrapped exe). This patches the PATH in the binary
wrappers (e.g. */bin/artiq_session) to include the correct python path.
This commit is contained in:
Drew Risinger 2020-12-22 17:01:38 -05:00 committed by Sebastien Bourdeauducq
parent a45b6fc771
commit 2577aa52c0
2 changed files with 7 additions and 0 deletions

View File

@ -21,6 +21,10 @@ python3Packages.buildPythonPackage rec {
wrapQtApp "$out/bin/artiq_session" wrapQtApp "$out/bin/artiq_session"
''; '';
# Modifies PATH to pass the wrapped python environment (i.e. python3.withPackages(...) to subprocesses.
# Allows subprocesses using python to find all packages you have installed
makeWrapperArgs = [ ''--run 'if [ ! -z "$NIX_PYTHONPREFIX" ]; then export PATH=$NIX_PYTHONPREFIX/bin:$PATH;fi' '' ];
checkInputs = [ binutils-or1k outputcheck ]; checkInputs = [ binutils-or1k outputcheck ];
checkPhase = checkPhase =
'' ''

View File

@ -195,6 +195,9 @@ in
sha256 = "165j12k9nnrkf2pv0idcv6xhnp1hnsllna4rps2dssnqgjfaw1ss"; sha256 = "165j12k9nnrkf2pv0idcv6xhnp1hnsllna4rps2dssnqgjfaw1ss";
}; };
propagatedBuildInputs = [ sipyco pkgs.python3Packages.numpy pkgs.python3Packages.aiohttp ]; propagatedBuildInputs = [ sipyco pkgs.python3Packages.numpy pkgs.python3Packages.aiohttp ];
# Modifies PATH to pass the wrapped python environment (i.e. python3.withPackages(...) to subprocesses.
# Allows subprocesses using python to find all packages you have installed
makeWrapperArgs = [ ''--run 'if [ ! -z "$NIX_PYTHONPREFIX" ]; then export PATH=$NIX_PYTHONPREFIX/bin:$PATH;fi' '' ];
}; };
conda-artiq-comtools = condaBuild { conda-artiq-comtools = condaBuild {
name = "conda-artiq-comtools"; name = "conda-artiq-comtools";