clingo: use python from spec#20139
Conversation
Without explicitly providing the path to the Python executable, clingo is prone to pick up the wrong Python package. As a safeguard, the required version is set explicitly based on the spec.
92dd63d to
e6f488a
Compare
|
This should probably go in before #20159, as it is more correct than the corresponding change there: spack/var/spack/repos/builtin/packages/clingo/package.py Lines 77 to 93 in c49a304 |
fix python args in clingo package.py bootstrap clingo in setup-env.sh avoid setting concretizer: clingo in defaults fix long lines merge in spack#20139
fix python args in clingo package.py bootstrap clingo in setup-env.sh avoid setting concretizer: clingo in defaults fix long lines merge in spack#20139
fix python args in clingo package.py bootstrap clingo in setup-env.sh avoid setting concretizer: clingo in defaults fix long lines merge in spack#20139
fix python args in clingo package.py bootstrap clingo in setup-env.sh avoid setting concretizer: clingo in defaults fix long lines merge in #20139
fix python args in clingo package.py bootstrap clingo in setup-env.sh avoid setting concretizer: clingo in defaults fix long lines merge in #20139 give the interpreter selection a piece of my mind revert setup-env.sh changes
fix python args in clingo package.py bootstrap clingo in setup-env.sh avoid setting concretizer: clingo in defaults fix long lines merge in #20139 give the interpreter selection a piece of my mind revert setup-env.sh changes
fix python args in clingo package.py bootstrap clingo in setup-env.sh avoid setting concretizer: clingo in defaults fix long lines merge in #20139 give the interpreter selection a piece of my mind revert setup-env.sh changes remove extraneous cmake args
fix python args in clingo package.py bootstrap clingo in setup-env.sh avoid setting concretizer: clingo in defaults fix long lines merge in #20139 give the interpreter selection a piece of my mind revert setup-env.sh changes remove extraneous cmake args
fix python args in clingo package.py bootstrap clingo in setup-env.sh avoid setting concretizer: clingo in defaults fix long lines merge in #20139 give the interpreter selection a piece of my mind revert setup-env.sh changes remove extraneous cmake args
update clingo package.py fix python args in clingo package.py bootstrap clingo in setup-env.sh avoid setting concretizer: clingo in defaults fix long lines merge in #20139 give the interpreter selection a piece of my mind revert setup-env.sh changes remove extraneous cmake args make clingo build on spack/centos6 via bootstrapping python and gcc
update clingo package.py fix python args in clingo package.py bootstrap clingo in setup-env.sh avoid setting concretizer: clingo in defaults fix long lines merge in spack#20139 give the interpreter selection a piece of my mind revert setup-env.sh changes remove extraneous cmake args make clingo build on spack/centos6 via bootstrapping python and gcc
adamjstewart
left a comment
There was a problem hiding this comment.
Python is not in the spec unless +python, you need an if-statement to check this before adding the flags.
|
Good point about the |
|
Please fix it in this PR. |
|
The support for the option |
|
That's fine, as long as it's reasonable to expect that it will be present in future versions. |
Clingo can be configured without Python bindings, yet the CMake configure step has to explicitly handle this. Additionally, for CMake versions <= 3.15.0 the path to the Python binary is set explicitly based on the spec to ensure CMake picks up the correct Python installation.
9c73bb8 to
c4b01c7
Compare
| args += [ | ||
| '-DCLINGO_BUILD_WITH_PYTHON=ON', | ||
| '-DCLINGO_REQUIRE_PYTHON=ON', | ||
| '-DCLINGO_BUILD_PY_SHARED=ON', |
There was a problem hiding this comment.
What does this flag control? Does it depend on whether '+shared' in spec['python']?
There was a problem hiding this comment.
Good question, unfortunately I'm not that familiar with the internals of the library, maybe the original author of this package can shed some light. There seems to be an additional library libpyclingo that uses this flag. As far as I can tell, this library is not used by the Python module, which links against libclingo.so directly.
Explicitly specifying the path to the Python executable to use is necessary independent of the CMake version to avoid issues with multiple Python versions.
|
With the recent changes to the package when using CMake >= 3.16.0 this is not an issue any more, so I'll close this one. |
Without explicitly providing the path to the Python executable, clingo is prone to pick up the wrong Python package. As a safeguard, the required version is set explicitly based on the spec.