Compare commits

..

5 Commits

Author SHA1 Message Date
Gregory Becker
2d46de5741 fix and test issue with copying by reference vs value 2023-05-25 01:43:55 +02:00
Greg Becker
b9cf63aa41 Merge branch 'develop' into bugfix/transactional-concretization 2023-05-24 16:25:15 +02:00
Gregory Becker
0ced62480d raise the error after fixing the transaction state 2023-05-23 23:14:33 +02:00
Gregory Becker
265d80cee3 test for transactional concretization 2023-05-23 20:25:43 +02:00
Gregory Becker
0f1d36585e environments: transactional concretization 2023-05-23 20:23:54 +02:00
14 changed files with 85 additions and 47 deletions

View File

@@ -1345,6 +1345,11 @@ def concretize(self, force=False, tests=False):
List of specs that have been concretized. Each entry is a tuple of
the user spec and the corresponding concretized spec.
"""
old_concretized_user_specs = self.concretized_user_specs[:]
old_concretized_order = self.concretized_order[:]
old_specs_by_hash = self.specs_by_hash.copy()
try:
if force:
# Clear previously concretized specs
self.concretized_user_specs = []
@@ -1367,6 +1372,11 @@ def concretize(self, force=False, tests=False):
msg = "concretization strategy not implemented [{0}]"
raise SpackEnvironmentError(msg.format(self.unify))
except Exception:
self.concretized_user_specs = old_concretized_user_specs
self.concretized_order = old_concretized_order
self.specs_by_hash = old_specs_by_hash
raise
def deconcretize(self, spec):
# spec has to be a root of the environment

View File

@@ -17,6 +17,7 @@
import llnl.util.link_tree
import spack.cmd.env
import spack.concretize
import spack.config
import spack.environment as ev
import spack.environment.environment
@@ -25,6 +26,7 @@
import spack.modules
import spack.paths
import spack.repo
import spack.solver.asp
import spack.util.spack_json as sjson
from spack.cmd.env import _env_create
from spack.main import SpackCommand, SpackCommandError
@@ -2759,6 +2761,51 @@ def test_virtual_spec_concretize_together(tmpdir):
assert any(s.package.provides("mpi") for _, s in e.concretized_specs())
@pytest.mark.parametrize(
"unify,method_to_fail",
[
(True, (spack.concretize, "concretize_specs_together")),
("when_possible", (spack.solver.asp.Solver, "solve_in_rounds")),
# An earlier failure so that we test the case where the internal state
# has been changed, but the pointer to the internal variables has not change.
# This effectively tests that we are properly copying by value not by
# reference for the transactional concretization
(True, (spack.environment.Environment, "_get_specs_to_concretize")),
],
)
def test_concretize_transactional(unify, method_to_fail, monkeypatch):
e = ev.create("test")
e.unify = unify
e.add("mpi")
e.add("zlib")
e.concretize()
# remove one spec and add another to ensure we test with changes before
# and after the environment is cleared during concretization
e.remove("zlib")
e.add("libelf")
def fail(*args, **kwargs):
raise Exception("Test failures")
location, method = method_to_fail
monkeypatch.setattr(location, method, fail)
first_user_specs = e.concretized_user_specs[:]
first_order = e.concretized_order[:]
first_hash_dict = e.specs_by_hash.copy()
try:
e.concretize()
except Exception:
pass
assert e.concretized_user_specs == first_user_specs
assert e.concretized_order == first_order
assert e.specs_by_hash == first_hash_dict
def test_query_develop_specs():
"""Test whether a spec is develop'ed or not"""
env("create", "test")

View File

@@ -217,12 +217,6 @@ class Paraview(CMakePackage, CudaPackage, ROCmPackage):
depends_on("netcdf-c")
depends_on("pegtl")
depends_on("protobuf@3.4:")
# Paraview 5.10 can't build with protobuf > 3.18
# https://github.com/spack/spack/issues/37437
depends_on("protobuf@3.4:3.18", when="@:5.10%oneapi")
depends_on("protobuf@3.4:3.18", when="@:5.10%intel@2021:")
depends_on("protobuf@3.4:3.18", when="@:5.10%xl")
depends_on("protobuf@3.4:3.18", when="@:5.10%xl_r")
depends_on("libxml2")
depends_on("lz4")
depends_on("xz")

View File

@@ -13,7 +13,6 @@ class PyAttrs(PythonPackage):
pypi = "attrs/attrs-20.3.0.tar.gz"
git = "https://github.com/python-attrs/attrs"
version("23.1.0", sha256="6279836d581513a26f1bf235f9acd333bc9115683f14f7e8fae46c98fc50e015")
version("22.2.0", sha256="c9227bfc2f01993c03f68db37d1d15c9690188323c067c641f1a35ca58185f99")
version("22.1.0", sha256="29adc2665447e5191d0e7c568fde78b21f9672d344281d0c6e1ab085429b22b6")
version("21.4.0", sha256="626ba8234211db98e869df76230a137c4c40a12d72445c45d5f5b716f076e2fd")
@@ -27,12 +26,5 @@ class PyAttrs(PythonPackage):
version("18.1.0", sha256="e0d0eb91441a3b53dab4d9b743eafc1ac44476296a2053b6ca3af0b139faf87b")
version("16.3.0", sha256="80203177723e36f3bbe15aa8553da6e80d47bfe53647220ccaa9ad7a5e473ccc")
depends_on("py-hatchling", when="@23.1:", type="build")
depends_on("py-hatch-vcs", when="@23.1:", type="build")
depends_on("py-hatch-fancy-pypi-readme", when="@23.1:", type="build")
with when("@:22.2.0"):
depends_on("py-setuptools@40.6.0:", when="@19.1", type="build")
depends_on("py-setuptools@40.6.0:", when="@19.1.0:", type="build")
depends_on("py-setuptools", type="build")
depends_on("py-importlib-metadata", when="@23.1: ^python@3.7", type=("build", "run"))

View File

@@ -15,7 +15,6 @@ class PyBabel(PythonPackage):
pypi = "Babel/Babel-2.7.0.tar.gz"
git = "https://github.com/python-babel/babel"
version("2.12.1", sha256="cc2d99999cd01d44420ae725a21c9e3711b3aadc7976d6147f622d8581963455")
version("2.10.3", sha256="7614553711ee97490f732126dc077f8d0ae084ebc6a96e23db1482afabdb2c51")
version("2.9.1", sha256="bc0c176f9f6a994582230df350aa6e05ba2ebe4b3ac317eab29d9be5d2768da0")
version("2.7.0", sha256="e86135ae101e31e2c8ec20a4e0c5220f4eed12487d5cf3f78be7e98d3a57fc28")
@@ -23,6 +22,7 @@ class PyBabel(PythonPackage):
version("2.4.0", sha256="8c98f5e5f8f5f088571f2c6bd88d530e331cbbcb95a7311a0db69d3dca7ec563")
version("2.3.4", sha256="c535c4403802f6eb38173cd4863e419e2274921a01a8aad8a5b497c131c62875")
depends_on("python@3.6:", when="@2.10:", type=("build", "run"))
depends_on("python@2.7:2.8,3.4:", type=("build", "run"))
depends_on("py-setuptools", type=("build", "run"))
depends_on("py-pytz@2015.7:", when="@2.12: ^python@:3.8", type=("build", "run"))
depends_on("py-pytz@2015.7:", when="@:2.10", type=("build", "run"))
depends_on("py-pytz@2015.7:", type=("build", "run"))

View File

@@ -12,7 +12,6 @@ class PyBidsValidator(PythonPackage):
homepage = "https://github.com/bids-standard/bids-validator"
pypi = "bids-validator/bids-validator-1.7.2.tar.gz"
version("1.11.0", sha256="408c56748b7cf98cf7c31822f33a8d89c5e6e7db5254c345107e8d527576ff53")
version("1.9.8", sha256="ff39799bb205f92d6f2c322f0b8eff0d1c0288f4291a0b18fce61afa4dfd7f3e")
version("1.9.4", sha256="4bf07d375f231a2ad2f450beeb3ef6c54f93194fd993aa5157d57a8fba48ed50")
version("1.8.9", sha256="01fcb5a8fe6de1280cdfd5b37715103ffa0bafb3c739ca7f5ffc41e46549612e")

View File

@@ -12,7 +12,6 @@ class PyBottleneck(PythonPackage):
homepage = "https://github.com/pydata/bottleneck"
pypi = "Bottleneck/Bottleneck-1.0.0.tar.gz"
version("1.3.7", sha256="e1467e373ad469da340ed0ff283214d6531cc08bfdca2083361a3aa6470681f8")
version("1.3.5", sha256="2c0d27afe45351f6f421893362621804fa7dea14fe29a78eaa52d4323f646de7")
version("1.3.2", sha256="20179f0b66359792ea283b69aa16366419132f3b6cf3adadc0c48e2e8118e573")
version("1.3.1", sha256="451586370462cb623d6ad604a545d1e97fb51d2ab5252b1ac57350a83e494a28")

View File

@@ -14,7 +14,6 @@ class PyCertifi(PythonPackage):
homepage = "https://github.com/certifi/python-certifi"
pypi = "certifi/certifi-2020.6.20.tar.gz"
version("2023.5.7", sha256="0f0d56dc5a6ad56fd4ba36484d6cc34451e1c6548c61daad8c320169f91eddc7")
version("2022.12.7", sha256="35824b4c3a97115964b408844d64aa14db1cc518f6562e8d7261699d1350a9e3")
version("2022.9.14", sha256="36973885b9542e6bd01dea287b2b4b3b21236307c56324fcc3f1160f2d655ed5")
version("2021.10.8", sha256="78884e7c1d4b00ce3cea67b44566851c4343c120abd683433ce934a68ea58872")
@@ -28,4 +27,5 @@ class PyCertifi(PythonPackage):
version("2017.4.17", sha256="f7527ebf7461582ce95f7a9e03dd141ce810d40590834f4ec20cddd54234c10a")
version("2017.1.23", sha256="81877fb7ac126e9215dfb15bfef7115fdc30e798e0013065158eed0707fd99ce")
depends_on("python@3.6:", when="@2022.05.18.1:", type=("build", "run"))
depends_on("py-setuptools", type="build")

View File

@@ -13,9 +13,10 @@ class PyCharsetNormalizer(PythonPackage):
homepage = "https://github.com/ousret/charset_normalizer"
pypi = "charset-normalizer/charset-normalizer-2.0.7.tar.gz"
version("3.1.0", sha256="34e0a2f9c370eb95597aae63bf85eb5e96826d81e3dcf88b8886012906f509b5")
version("2.1.1", sha256="5a3d016c7c547f69d6f81fb0db9449ce888b418b5b9952cc5e6e66843e9dd845")
version("2.0.12", sha256="2857e29ff0d34db842cd7ca3230549d1a697f96ee6d3fb071cfa6c7393832597")
version("2.0.7", sha256="e019de665e2bcf9c2b64e2e5aa025fa991da8720daa3c1138cadd2fd1856aed0")
depends_on("python@3.6:", when="@2.1:", type=("build", "run"))
depends_on("python@3.5:", type=("build", "run"))
depends_on("py-setuptools", type="build")

View File

@@ -19,7 +19,6 @@ class PyGmxapi(PythonPackage):
maintainers("eirrgang", "peterkasson")
pypi = "gmxapi/gmxapi-0.4.0.tar.gz"
version("0.4.1", sha256="cc7a2e509ab8a59c187d388dcfd21ea78b785c3b355149b1818085f34dbda62a")
version("0.4.0", sha256="7fd58e6a4b1391043379e8ba55555ebeba255c5b394f5df9d676e6a5571d7eba")
depends_on("gromacs@2022.1:~mdrun_only+shared")
@@ -31,9 +30,9 @@ class PyGmxapi(PythonPackage):
depends_on("py-numpy@1.8:", type=("build", "run"))
depends_on("py-setuptools@42:", type="build")
depends_on("py-packaging", type=("build", "run"))
depends_on("py-pybind11@2.6:", type="build")
depends_on("py-pybind11@2.6:", when="@:0.4", type=("build", "run"))
depends_on("py-pybind11@2.6:", type=("build", "run"))
depends_on("py-pytest@4.6:", type="test")
depends_on("py-wheel", type="build")
def setup_build_environment(self, env):
env.set("GROMACS_DIR", self.spec["gromacs"].prefix)

View File

@@ -15,7 +15,6 @@ class PyLightly(PythonPackage):
maintainers("adamjstewart")
version("1.4.6", sha256="1c8b904a96fadaefbaa00296eea0ac1e8b50cb10e94595c74b0abada5f4f5a64")
version("1.4.5", sha256="67b1de64950ff5bc35ef86fec3049f437ed1c9cb4a191c43b52384460207535f")
version("1.4.4", sha256="e726120437ee61754da8e1c384d2ed27d9a7004e037c74d98e3debbc98cbd4a4")
version("1.4.3", sha256="ff2cfded234bc5338519bdb2de774c59a55200159f4429b009b7a3923bc0be0e")

View File

@@ -20,7 +20,6 @@ class PyRasterio(PythonPackage):
maintainers("adamjstewart")
version("master", branch="master")
version("1.3.7", sha256="abfdcb8f10210b8fad939f40d545d6c47e9e3b5cf4a43773ca8dd11c58204304")
version("1.3.6", sha256="c8b90eb10e16102d1ab0334a7436185f295de1c07f0d197e206d1c005fc33905")
version("1.3.5", sha256="92358c3d4d5d6f3c7cd2812c8832d5175abce02b11bc101ac9548ff07163e8e2")
version("1.3.4", sha256="5a8771405276ecf00b8ee927bd0a81ec21778dcfc97e4a37d0b388f10c9a41a8")

View File

@@ -59,7 +59,7 @@ class Sensei(CMakePackage):
depends_on("paraview@5.5.0:5.5.2", when="@:2.1.1 +catalyst")
depends_on("paraview@5.6:5.7", when="@3:3.2.1 +catalyst")
depends_on("paraview@5.7:5.9", when="@3.2.2 +catalyst")
depends_on("paraview@5.7:5.10", when="@4:4 +catalyst")
depends_on("paraview@5.7:5.10", when="@4: +catalyst")
# Visit Dep
depends_on("visit", when="+libsim")

View File

@@ -30,7 +30,6 @@ class Starpu(AutotoolsPackage):
maintainers("nfurmento", "sthibaul")
version("1.4.1", sha256="f023aa53da245a0f43944c3a13f63b4bfdf1324f3e66bf5cd367ce51e2044925")
version("1.4.0", sha256="5058127761a0604606a852fd6d20b07040d5fbd9f798c5383e49f336b4eeaca1")
version("1.3.10", sha256="757cd9a54f53751d37364965ac36102461a85df3a50b776447ac0acc0e1e2612")
version("1.3.9", sha256="73adf2a5d25b04023132cfb1a8d9293b356354af7d1134e876122a205128d241")