Repository navigation
Python: ensure disabled variants disabled corresponding build elements - #7202
johnwparent wants to merge 5 commits into
Conversation
Previously multiple Python package variants could be enabled or disabled, the only change reflected in the build was the inclusion of CFLAGS and LDFLAGS.
This allowed python to find and link against system copies of dependencies required to build modules for which the corresponding variant was off, and build said module.
This produces modules with potential system references and allows python builds to diverge from the spec requirements.
This PR adds arguments to configure that disable the modules our variants configure to be off.
Also updates the python requirements pip expects. Pip unconditonally imports zlib and expat, so python must have both those modules
Signed-off-by: John Parent <john.parent@kitware.com>
|
Went down this rabbit hole after I observed python fail to build after linking to one zstd and trying to load another version at runtime when the the spec had https://gitlab.spack.io/spack/spack-packages/-/jobs/25332018 (a larger issue of using the wrong docker image for the task I was trying to accomplish with that pipeline exists, but is tangential to this PR) |
|
I'll be honest, this code (especially the comments and type hints) looks suspiciously AI generated... |
I was writing overly verbose prose for at least a decade before the existence of LLMs, the lack of brevity in that one comment is entirely the result of my own inability to be succinct, not LLM generation. If you do not want to review it further, that is your perogative. |
Signed-off-by: John Parent <john.parent@kitware.com>
|
Ope, missed the existing issue, thanks for catching that. |
Signed-off-by: John Parent <john.parent@kitware.com>
Signed-off-by: John Parent <john.parent@kitware.com>
|
Hi @johnwparent & @adamjstewart , This test was started more than 7 hours ago, so before the most recent changes to the PR. The reproducer completed successfully: git clone https://github.com/ACCESS-NRI/ACCESS-OM3 git remote add johnwparent https://github.com/johnwparent/spack-packages |
|
Would it be fun/worthwhile to open a PR that changes all variants to default to False just to see what breaks? Could apply to all packages, not just Python. |
I don't know why, but my Spack instance on my mac is doing exactly that, which is how I found the other modules that the CI job that crashed on So yes, I think variant default to off is a great idea. I'm currently working on what we test in CI, I'll fold that into that work. I don't know if we want to hammer Gitlab CI at this specific moment, my current work uses (abuses) GHA free runners to test more spack packages than we normally do in GL. |
Signed-off-by: John Parent <john.parent@kitware.com>
|
I was actually just thinking to do this once in a draft PR and then close it later, wasn't thinking about merging it across all of CI permanently, but that might not be such a bad idea. I do think that we should build fully-featured things by default, and I do want to populate the build cache with useful packages though. |
adamjstewart
left a comment
There was a problem hiding this comment.
Looks pretty solid to me now! Wish Python made it simpler, but Python itself is a big thing so I guess we can't expect a simple package recipe either.
I fully agree, I think we need a divergence between "tested package configurations" and "things that need to be shipped in the binary mirror". Our current strategy does an incredible amount of testing and produces so many very usable binaries, but because we're not testing things we don't want to ship, less popular configurations rot, as I'm sure you're way too aware. In an ideal world, we have a GHA CI job that tests whatever packages changes that have been made in a given packages PR so we at least know that PR builds. I know Ryan had that PR'd (or maybe in a branch) to run that on Gitlab CI, but it never took off for cost/build cache constraints. Then I want to build out a matrix of continuously running jobs that tries to cover... well most of Spack exhaustively. That latter bit is pretty prohibitive for... a lot of reasons (If I had infinite time and money, maybe not) but I think we can do a decent "best attempt" pass and get a lot of benefit. |
|
This has a CI failure in |
Previously multiple Python package variants could be enabled or disabled, the only change reflected in the build was the inclusion of CFLAGS and LDFLAGS.
This allowed python to find and link against system copies of dependencies required to build modules for which the corresponding variant was off, and build said module.
This produces modules with potential system references and allows python builds to diverge from the spec requirements.
This PR adds arguments to configure that disable the modules our variants configure to be off.
Also updates the python requirements pip expects. Pip unconditonally imports zlib and expat, so python must have both those modules
AI Disclosure: used claude opus 5.5 to explore all the gaps that needed covering, but initial triage, code, and mistakes are my own
Fixes #6903