gcc-runtime: add separate package for gcc runtime libs#41104
gcc-runtime: add separate package for gcc runtime libs#41104tgamblin merged 2 commits intospack:developfrom
Conversation
44c3b7b to
e37cd18
Compare
e37cd18 to
b11ec0e
Compare
|
@giordano I tested that julia docker image again, and it works out of the box now: (don't ask me why I started building julia 1.8, somehow the concretizer picked that 😆) Had to still set |
b11ec0e to
81ee5ea
Compare
|
@alalazo we should really find a way to ensure that changes to build systems / base package do not affect tests, it's a bit annoying |
|
Built gcc12 with system compiler (gcc11 on AlmaLinux9) and the gcc-runtime was correctly created for that. Add that compiler to the config and built boost@gcc12 cxxstd=20. No gcc-runtime install for gcc12. The gcc12 rpaths are added but the gcc-runtime paths are from gcc11. |
c2d7e06 to
88837ea
Compare
|
Currently this requires specifying |
d86e754 to
b8ed70e
Compare
b8ed70e to
d7b4493
Compare
|
Did a quick test with gcc@12.1.1 from RedHat gcc-toolset-12. I needed to add 12.1.1 to the list of versions but after that boost concretized. |
|
Yeah, RedHat uses unofficial GCC versions |
|
I am trying a build now with a Spack built compiler and a package that builds binaries. Boost doesn't build libraries by default. |
|
When I concretize a package individually the implicit dependence on gcc_runtime shows up. When I concretize an environment with the same package in it, the implicit dependence on gcc_runtime does not show up. |
|
I just spent some time debugging an issue reported on Slack where Let's get this PR in... it solves tons of annoying issues. |
|
@alalazo It appears that I can merge this pull request. Should I merge it? |
|
Let's give @tgamblin a moment to look at it too |
|
Was I given merge privileges because I was "assigned" to this PR? |
|
You're member of the spack/merge-to-develop group, for a long time I think, meaning you can merge any pr. |
1ae88dc to
aff4c95
Compare
befb3bb to
c717b24
Compare
|
I don't see the point of merging the commits separately, they can't be reverted out of order. Feel free to squash merge. |
c717b24 to
7df24ef
Compare
| if not os.path.isabs(path): | ||
| continue |
There was a problem hiding this comment.
This and the other continue below worry me because I think this loop can fail if we encounter a weird gcc.
I think this should fail if it doesn't find at least gcc_s. Are there others in LIBRARIES that we'd always expect to find? Seems worthwhile to include some minimum set of requirements on the library list produced here, and fail if we do not find those. Better to fail fast than to give someone a gcc-runtime that does nothing.
There was a problem hiding this comment.
Would make spack unusable when gcc is configured with --disable-shared
There was a problem hiding this comment.
I've pushed a commit that warns when nothing is found. It's certainly wrong to error.
There was a problem hiding this comment.
If it’s wrong to error with disable-shared, maybe leaving it is fine. Warning is probably good for now… ideally we could tell if it’s supposed to have —disable-shared and only fail when we expect no runtime libs.
With disable-shared there’s not really a dependency on the runtime libs anyway, or at least not the same sort of dep, so that’s yet another modeling problem to deal with.
There was a problem hiding this comment.
Yeah, unfortunately that info is not part of the spec, so gcc-runtime in a build cache is no guarantee it'll work with other people's gcc at the same version when building on top of it : (. We could deal with it later: gcc-runtime +shared-X or something. Or always splice gcc-runtime to get the local gcc's version of it.
There was a problem hiding this comment.
We can also split libraries according to e.g. languages later
For what is worth, I don't think we'll revert this - in the worst case we can just comment out / remove the few lines in GCC. Having two separate commits has the slight benefit of leaving blame traces, and allowing more specific details in the commit comments without getting the commit message too long. TL;DR I still prefer "rebase and merge", but am fine with both. |
|
I'll make a revert for both if needed (you can squash it on a separate branch, revert the squash, and cherry pick it) |
The gcc-runtime package adds a separate node for gcc's dynamic runtime libraries. This should help with: 1. binary caches where rpaths for compiler support libs cannot be relocated because the compiler is missing on the target system 2. creating "minimal" container images The package is versioned like `gcc` (in principle it could be unversioned, but Spack doesn't always guarantee not mixing compilers)
* Restore PackageBase class, and modify only ASP This prevents a noticeable slowdown in concretization due to the number of directives involved. * Fix issue with 'clang' being preferred to 'gcc', due to runtime version weights * Constraints on runtimes are declared by compilers The declaration of available runtime versions, and of their compatibility constraints are in the associated compiler class. Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
0bb4198 to
9437139
Compare
|
Let's avoid further changes to gcc-runtime unless necessary, cause it causes rebuilds of 1000s of packages |
The
gcc-runtimepackage adds a separate node forgcc's dynamic runtimelibraries.
The good:
installing from build cache, since we don't keep track of their location.
compilers around or do multistage builds where the second stage needs to run
another package manager for compiler support libs.
spack uninstall gccwithout breaking binaries built with that gcc.%gccversions, the newest GCC's runtime libs are used andthis node is unique. A spec
pkg%gcc@x.y.zalways means thatpkgwaslinked to GCC
x.y.zruntime libraries, even if its^gcc-runtimeis newer.The bad:
The ugly:
ABI breaking change (e.g. gcc 7 vs 8 has a libgfortran soname bump). I'll leave
this for later when we do
provides("fortran@...")etc.Notice: Libraries are copied with filename = soname. Only the compiler package
has the "linkable" library w/o suffix. This ensures that the
%gcc@xcompilerproperty is correct, even if
^gcc-runtime@yis at a newer version.Future ideas
If packages specify:
and
gcc-runtimeprovides those:we can ensure that there's only one unique ABI for
libgfortran.so.XNotice that there is no immediate need to specify the language of all 7K
packages. It can be done package by package going forward, since the
language only imposes additional constraints on
gcc-runtime.Only when we've identified all C, C++, and Fortran packages can we
proceed with dropping the compiler attribute / node so that pure python
packages et cetera won't need a compiler to install.