Skip to content

Move external python glue logic into core#50605

Merged
haampie merged 10 commits intospack:developfrom
scheibelp:move-external-glue-logic-into-core
May 22, 2025
Merged

Move external python glue logic into core#50605
haampie merged 10 commits intospack:developfrom
scheibelp:move-external-glue-logic-into-core

Conversation

@scheibelp
Copy link
Copy Markdown
Member

This originally lived in the python build system and in this PR moves into core

This was originally plugged in generically: any extendable package could implement _update_external_dependencies and potentially resolve analogous issues. No other package in builtin did this (but a if a private repo took advantage of this, this PR would break them).

The changes are nearly a verbatim relocation (although one edge case for the old concretizer is removed), plus some renaming of methods to reflect the fact that it's just for python and not generic.

This logic is already tested (spack unit-test -k external_python).

@spackbot-app spackbot-app bot added the core PR affects Spack core functionality label May 22, 2025
@scheibelp scheibelp requested a review from tgamblin May 22, 2025 07:03
Copy link
Copy Markdown
Member

@tgamblin tgamblin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM. I think this is the right change to keep the current behavior until we can add proper dependencies for externals, but not expose it as part of the package API in 1.0.

@tgamblin tgamblin requested a review from haampie May 22, 2025 08:26
@tgamblin tgamblin added this to the v1.0.0 milestone May 22, 2025
@tgamblin
Copy link
Copy Markdown
Member

@haampie if you like this one, can you approve and merge? I do not think we need to do a rebuild or anything with gitlab, as this logic only applies to externals.

@haampie haampie merged commit 6328fb3 into spack:develop May 22, 2025
33 of 34 checks passed
kwryankrattiger added a commit that referenced this pull request May 22, 2025
haampie pushed a commit that referenced this pull request May 22, 2025
scheibelp added a commit that referenced this pull request May 30, 2025
Redo of #50605 (Move external python glue logic into core) 

This concerns logic that attaches a `python` dependency to some external
packages (because they expect an instance of `python` in their DAG).
#50605 was intended to be a simple relocation of logic from the package
repo to the core.

That PR caused a failure because it was attempting to attach python to a
bigger set of dependents: originally this logic only ran for packages
that were a subclass of `PythonPackage`, and that PR made it run for all
packages that `extends(python)`; notably that included LLVM, and in
particular this occurred inside of an environment that set `unify: false`;
attaching Python can involve looking for an instance of Python on the
system, and normal external detection runs with a process pool, which is
prohibited in the context of `concretize_separately` (which itself uses a
process pool with daemon processes).

This PR reapplies the logic from #50605 with two additional changes:

* Match the previous inclusion/exclusion semantics by only attaching
  Python to external packages that are a subclass of `PythonPackage`
* Update external Python search to run within the current process
  (so that it can run as part of `concretize_separately`)
kshea21 pushed a commit to kshea21/spack that referenced this pull request Jun 18, 2025
Redo of spack#50605 (Move external python glue logic into core) 

This concerns logic that attaches a `python` dependency to some external
packages (because they expect an instance of `python` in their DAG).
spack#50605 was intended to be a simple relocation of logic from the package
repo to the core.

That PR caused a failure because it was attempting to attach python to a
bigger set of dependents: originally this logic only ran for packages
that were a subclass of `PythonPackage`, and that PR made it run for all
packages that `extends(python)`; notably that included LLVM, and in
particular this occurred inside of an environment that set `unify: false`;
attaching Python can involve looking for an instance of Python on the
system, and normal external detection runs with a process pool, which is
prohibited in the context of `concretize_separately` (which itself uses a
process pool with daemon processes).

This PR reapplies the logic from spack#50605 with two additional changes:

* Match the previous inclusion/exclusion semantics by only attaching
  Python to external packages that are a subclass of `PythonPackage`
* Update external Python search to run within the current process
  (so that it can run as part of `concretize_separately`)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core PR affects Spack core functionality python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants