summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMassimiliano Culpo <massimiliano.culpo@gmail.com>2023-11-03 16:53:45 +0100
committerGitHub <noreply@github.com>2023-11-03 16:53:45 +0100
commit668a5b45e5ca5b5c16ea042d0121c5a958564089 (patch)
tree3db5e37a27afea8822aa64600b095736b4db7d52
parent70171d6caf68e99430eecf49950bb8498d05d1f6 (diff)
downloadspack-668a5b45e5ca5b5c16ea042d0121c5a958564089.tar.gz
spack-668a5b45e5ca5b5c16ea042d0121c5a958564089.tar.bz2
spack-668a5b45e5ca5b5c16ea042d0121c5a958564089.tar.xz
spack-668a5b45e5ca5b5c16ea042d0121c5a958564089.zip
clingo-bootstrap: force setuptools through variant (#40866)
-rw-r--r--.github/workflows/bootstrap.yml3
-rw-r--r--lib/spack/spack/bootstrap/core.py4
-rw-r--r--var/spack/repos/builtin/packages/clingo-bootstrap/package.py7
3 files changed, 14 insertions, 0 deletions
diff --git a/.github/workflows/bootstrap.yml b/.github/workflows/bootstrap.yml
index db64ca94d5..fd863b6abb 100644
--- a/.github/workflows/bootstrap.yml
+++ b/.github/workflows/bootstrap.yml
@@ -159,6 +159,9 @@ jobs:
brew install cmake bison@2.7 tree
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
+ - uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # @v2
+ with:
+ python-version: "3.12"
- name: Bootstrap clingo
run: |
source share/spack/setup-env.sh
diff --git a/lib/spack/spack/bootstrap/core.py b/lib/spack/spack/bootstrap/core.py
index 9fb04453c4..5f73c7bfaf 100644
--- a/lib/spack/spack/bootstrap/core.py
+++ b/lib/spack/spack/bootstrap/core.py
@@ -291,6 +291,10 @@ class SourceBootstrapper(Bootstrapper):
with spack_python_interpreter():
# Add hint to use frontend operating system on Cray
concrete_spec = spack.spec.Spec(abstract_spec_str + " ^" + spec_for_current_python())
+ # This is needed to help the old concretizer taking the `setuptools` dependency
+ # only when bootstrapping from sources on Python 3.12
+ if spec_for_current_python() == "python@3.12":
+ concrete_spec.constrain("+force_setuptools")
if module == "clingo":
# TODO: remove when the old concretizer is deprecated # pylint: disable=fixme
diff --git a/var/spack/repos/builtin/packages/clingo-bootstrap/package.py b/var/spack/repos/builtin/packages/clingo-bootstrap/package.py
index 7fb34446a1..65535f330a 100644
--- a/var/spack/repos/builtin/packages/clingo-bootstrap/package.py
+++ b/var/spack/repos/builtin/packages/clingo-bootstrap/package.py
@@ -32,6 +32,13 @@ class ClingoBootstrap(Clingo):
description="Enable a series of Spack-specific optimizations (PGO, LTO, mimalloc)",
)
+ variant(
+ "force_setuptools",
+ default=False,
+ description="Force a dependency on setuptools to help the old concretizer",
+ )
+ depends_on("py-setuptools", type="build", when="+force_setuptools")
+
# Enable LTO
conflicts("~ipo", when="+optimized")