Merged
Conversation
7b74968 to
41d987b
Compare
650f39e to
da64305
Compare
96a553c to
689bf52
Compare
f73ba32 to
03ad66e
Compare
13d80e9 to
685afaa
Compare
3 tasks
1 task
4 tasks
This was referenced Apr 18, 2025
This was referenced May 7, 2025
Merged
4 tasks
Closed
3 tasks
3 tasks
This was referenced Jun 1, 2025
3 tasks
This was referenced Jun 6, 2025
This was referenced Jun 15, 2025
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #954.
Fixes #5655.
Summary
In this branch, compilers stop being a node attribute, and become a build-only dependency.
Packages may declare a dependency on the
c,cxx, orfortranlanguages, which are now treated as virtuals, and compilers would be providers for one or more of those languages. Compilers can also inject runtime dependency, on the node being compiled. An example graph for something as simple aszlib-ngis the following:Here
gccis used for both thec, andcxxlanguages. Edges are annotated with the virtuals they satisfy (c,cxx,libc).gccinjectsgcc-runtimeon the nodes being compiled.glibcis also injected for packages that requirec. Thecompiler-wrapperis explicitly represented as a node in the DAG, and is included in the hash.This change in the model has implications on the semantics of the
%sigil, as discussed in #44379, and requires a version bump for ourSpecfile,Database, andLockfileformats.Breaking changes
Breaking changes below may impact users of this branch.
1. Custom, non-numeric version of compilers are not supported
Currently, users can assign to compilers any custom version they want, and Spack will try to recover the "real version" whenever the custom version fails some operation. To deduce the "real version" Spack must run the compiler, which can add needless overhead to common operations.
Since any information that a version like
gcc@foomight give to the user, can also be suffixed while retaining the correct numeric version, e.g.[email protected], Spack will not try anymore to deduce real versions for compilers.Said otherwise, users should have no expectation that
gcc@foobehaves as[email protected]internally.2. The
%sigil in the spec syntax means "direct build dependency"The
%sigil in the spec syntax means "direct build dependency", and is not a node attribute anymore. This means that:is true only if
gccis a direct build dependency of the node. Nodes without a compiler dependency are allowed.parent["child"], andnode in spec, will now only inspect the link/run sub-DAG and direct build dependenciesThe subscript notation for
Spec:will look for a
childnode only in the link/run transitive graph ofparent, and in its direct build dependencies. This means that to reach a transitive build dependency, we must first pass through the node it is associated with.Assuming
parentdoes not depend oncmake, but depends on aCMakePackagee.g.hdf5, then we have the following situation:3. Externals differing by just the compiler attribute
Externals are nodes where dependencies are trimmed, and that is not planned to change in this branch. Currently, on
developit is ok to write:and Spack will account for the compiler node attribute when computing the optimal spec. In this branch, using externals with a compiler specified is allowed only if any compiler in the dag matches the constraints specified on the external. The external will be still represented as a single node without dependencies.
4. Spec matrices enforcing a compiler
Currently we can have matrices of the form:
to get the cross-product of specs and compilers. We can disregard the nature of the packages in the first row, since the compiler is a node attribute required on each node.
In this branch, instead, we require a spec to depend on
c,cxx, orfortranfor the%to have any meaning. If any of the specs in the first row doesn't depend on these languages, there will be a concretization error.Deprecations
compilerssection in the configuration (i.e.,compilers.yaml) has been deprecated, and current entries will be removed in v1.2.0. For the time being, if Spack finds anycompilersconfiguration, it will try to convert it automatically to a set of external packages.packages:compilersoft-preference has been deprecated. It will be removed in v1.1.0.Other notable changes
{compiler},{compiler.version}, and{compiler.name}inSpec.formatexpand to"none"if a Spec does not depend on C, C++, or Fortran."{architecture.platform}-{architecture.target}/{name}-{version}-{hash}"Known limitations
The major known limitations of this branch that we intend to fix before v1.0 is that compilers cannot be bootstrapped directly.
In this branch we can build a new compiler using an existing external compiler, for instance:
where
[email protected]is external, andgcc@14is to be built.What we can't do at the moment is use a yet to be built compiler, and expect it will be bootstrapped, e.g. :
We plan to tackle this issue in a following PR.
Important Review comments
spack.compilers)Turn compilers into nodes #45189 (comment)