Skip to content

Treat externals as concrete specs with missing information#36179

Closed
alalazo wants to merge 10 commits intospack:developfrom
alalazo:features/externals_in_db
Closed

Treat externals as concrete specs with missing information#36179
alalazo wants to merge 10 commits intospack:developfrom
alalazo:features/externals_in_db

Conversation

@alalazo
Copy link
Copy Markdown
Member

@alalazo alalazo commented Mar 16, 2023

fixes #24498
fixes #24506
fixes #26034
fixes #28827
fixes #29930
fixes #30911

⚠️ Work in progress, many details missing (both in the implementation and in the description) ⚠️


This draft PR reworks how externals are treated by Spack. The main change is that detecting an external writes directly into the DB:
Screenshot from 2023-03-16 23-24-23

Externals are inserted in the DB as they are detected, so any missing information stays missing by default. In the picture above, for instance, only curl was detected with some variants. They are also inserted as "implicit", so to make it easy to garbage collect them.

To deal with existing packages.yaml configurations there is another explicit command, called import:
Screenshot from 2023-03-16 23-29-37

Concretization

Preferring externals over new builds is done through the "reuse" mechanism of our solver. Importing externals from packages.yaml is done automatically just before we concretize a spec, so to be sure we can reuse them. It is also done unconditionally, i.e. we'll reuse externals in packages.yaml even if concretizer:reuse:false. This gives us back a behavior that is very similar to the one in develop.

@spackbot-app spackbot-app bot added build-systems commands core PR affects Spack core functionality external-packages tests General test capability(ies) labels Mar 16, 2023
@alalazo alalazo force-pushed the features/externals_in_db branch from 8290595 to bce59c7 Compare March 16, 2023 22:43
@alalazo alalazo mentioned this pull request Mar 17, 2023
@alalazo alalazo force-pushed the features/externals_in_db branch from bce59c7 to 0e6e62b Compare March 20, 2023 12:13
@alalazo alalazo force-pushed the features/externals_in_db branch from 0e6e62b to 84faa4e Compare April 24, 2023 12:05
@alalazo alalazo added this to the v0.21.0 milestone May 2, 2023
@alalazo alalazo removed this from the v0.21.0 milestone Jun 7, 2023
@alalazo alalazo self-assigned this Sep 8, 2023
@alalazo alalazo force-pushed the features/externals_in_db branch from 84faa4e to 55e4a07 Compare September 14, 2023 05:37
@spackbot-app spackbot-app bot added shell-support stand-alone-tests Stand-alone (or smoke) tests for installed packages labels Sep 14, 2023
@tgamblin tgamblin self-requested a review September 14, 2023 06:56
@tgamblin tgamblin added this to the v0.21.0 milestone Oct 17, 2023
@becker33
Copy link
Copy Markdown
Member

becker33 commented Dec 5, 2024

@alalazo this PR also fixes #4913, could you please add that to the description?

@alalazo alalazo modified the milestones: v1.0.0, v1.0.0 stretch goals Apr 23, 2025
@haampie haampie modified the milestones: v1.0.0 stretch goals, v1.1.0 Jul 24, 2025
@alalazo alalazo removed this from the v1.1.0 milestone Sep 18, 2025
@github-project-automation github-project-automation bot moved this from In Progress to Done in Compilers as dependencies Oct 19, 2025
@alalazo alalazo deleted the features/externals_in_db branch October 19, 2025 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment