Skip to content

Commit a1bd79e

Browse files
wdconincCopilot
andcommitted
spack-environment: use %gcc for py-tensorflow, revert all:require to '%gcc'
The previous fix (any_of: ['%gcc', '%clang'] in all:require) allowed py-tensorflow to concretize with %clang but caused ~24 packages to be duplicated (once compiled with %gcc, once with %clang). Root cause analysis: py-tensorflow@2.20's own compiler constraints only require gcc@12+ and clang@16+; both gcc@13.3.0 and clang@17.0.6 are valid. The '%clang' requirement in packages.yaml was a preference, not a technical necessity. In Spack v1.1+, 'all: require: %gcc' applies to ALL packages without exception and cannot be overridden by package-specific require entries (both constraints apply simultaneously). Removing the '%clang' preference from py-tensorflow:require eliminates the compiler conflict entirely, and the all:require:'%gcc' preference guides py-tensorflow to use %gcc consistently with all other packages. Also update the misleading comment that claimed 'require for all is overwritten by package-specific entries' — this was incorrect for Spack v1.1+. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 97b39b5 commit a1bd79e

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

spack-environment/packages.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@
1111
#
1212
packages:
1313
all:
14-
# duplication between the prefer and require sections is intentional
15-
# since 'require' for 'all' is overwritten by package-specific entries,
16-
# and 'prefer' at least retains some (less strict) preference in that case
14+
# note: in Spack v1.1+, 'require' for 'all' is NOT overwritten by package-specific
15+
# entries; both constraints apply simultaneously. 'prefer' for 'all' retains a
16+
# weaker preference that is superseded by package-specific requirements.
1717
prefer:
1818
- '%gcc'
1919
# FIXME any ipo preference breaks llvm external reuse
2020
#- +ipo
2121
- build_system=cmake
2222
- build_type=Release
2323
require:
24-
- any_of: ['%gcc', '%clang'] # allow packages with specific compiler requirements (e.g. py-tensorflow)
24+
- '%gcc'
2525
# FIXME any ipo requirement breaks llvm external reuse
2626
#- any_of: [+ipo, '@:']
2727
- any_of: [build_system=cmake, '@:']

0 commit comments

Comments
 (0)