Python virtual environment depends on dune-common python package
Currently, the run-in-dune-env.sh
script uses the dune-common python module to check for something on the build dirs (I don't know what). This is problematic because the venv may be used in downstream modules without necessarily assuming that dune-common python package is installed (e.g. dune-testtools
, dune-codegen
).
A simple fix is to conditionally check if the python package is available:
# check if dune-common is installed
if python -m dune --help &> /dev/null; then
# test if build directory matches installed dune python packages
python -m dune checkbuilddirs @PROJECT_NAME@ @CMAKE_BINARY_DIR@
RESULT=$?
if [ $RESULT -ne 0 ] ; then
echo "Dune python package could not check build directories"
exit $RESULT
fi
fi
# execute the command
"$@"
But perhaps someone with more insight of checkbuilddirs
can give a more appropriate solution.
Edited by Santiago Ospina De Los Ríos