Move %compiler last in static spec strings (#49438)
This commit is contained in:
@@ -129,7 +129,7 @@ def test_satisfy_strict_constraint_when_not_concrete(architecture_tuple, constra
|
||||
)
|
||||
def test_concretize_target_ranges(root_target_range, dep_target_range, result, monkeypatch):
|
||||
spec = Spec(
|
||||
f"pkg-a %gcc@10 foobar=bar target={root_target_range} ^pkg-b target={dep_target_range}"
|
||||
f"pkg-a foobar=bar target={root_target_range} %gcc@10 ^pkg-b target={dep_target_range}"
|
||||
)
|
||||
with spack.concretize.disable_compiler_existence_check():
|
||||
spec = spack.concretize.concretize_one(spec)
|
||||
|
||||
@@ -1140,7 +1140,7 @@ def test_get_valid_spec_file_no_json(tmp_path, filename):
|
||||
|
||||
def test_download_tarball_with_unsupported_layout_fails(tmp_path, mutable_config, capsys):
|
||||
layout_version = bindist.CURRENT_BUILD_CACHE_LAYOUT_VERSION + 1
|
||||
spec = Spec("gmake@4.4.1%gcc@13.1.0 arch=linux-ubuntu23.04-zen2")
|
||||
spec = Spec("gmake@4.4.1 arch=linux-ubuntu23.04-zen2 %gcc@13.1.0")
|
||||
spec._mark_concrete()
|
||||
spec_dict = spec.to_dict()
|
||||
spec_dict["buildcache_layout_version"] = layout_version
|
||||
|
||||
@@ -92,7 +92,7 @@ def test_external_nodes_do_not_have_runtimes(runtime_repo, mutable_config, tmp_p
|
||||
# Same as before, but tests that we can reuse from a more generic target
|
||||
pytest.param(
|
||||
"pkg-a%gcc@9.4.0",
|
||||
"pkg-b%gcc@10.2.1 target=x86_64",
|
||||
"pkg-b target=x86_64 %gcc@10.2.1",
|
||||
{"pkg-a": "gcc-runtime@9.4.0", "pkg-b": "gcc-runtime@9.4.0"},
|
||||
1,
|
||||
marks=pytest.mark.skipif(
|
||||
@@ -101,7 +101,7 @@ def test_external_nodes_do_not_have_runtimes(runtime_repo, mutable_config, tmp_p
|
||||
),
|
||||
pytest.param(
|
||||
"pkg-a%gcc@10.2.1",
|
||||
"pkg-b%gcc@9.4.0 target=x86_64",
|
||||
"pkg-b target=x86_64 %gcc@9.4.0",
|
||||
{
|
||||
"pkg-a": "gcc-runtime@10.2.1 target=x86_64",
|
||||
"pkg-b": "gcc-runtime@9.4.0 target=x86_64",
|
||||
|
||||
@@ -121,7 +121,7 @@ def binary_compatibility(monkeypatch, request):
|
||||
"mpileaks ^mpi@1.2:2",
|
||||
# conflict not triggered
|
||||
"conflict",
|
||||
"conflict%clang~foo",
|
||||
"conflict~foo%clang",
|
||||
"conflict-parent%gcc",
|
||||
]
|
||||
)
|
||||
@@ -387,8 +387,8 @@ def test_different_compilers_get_different_flags(
|
||||
t = archspec.cpu.host().family
|
||||
client = spack.concretize.concretize_one(
|
||||
Spec(
|
||||
f"cmake-client %gcc@11.1.0 platform=test os=redhat6 target={t}"
|
||||
f" ^cmake %clang@12.2.0 platform=test os=redhat6 target={t}"
|
||||
f"cmake-client platform=test os=redhat6 target={t} %gcc@11.1.0"
|
||||
f" ^cmake platform=test os=redhat6 target={t} %clang@12.2.0"
|
||||
)
|
||||
)
|
||||
cmake = client["cmake"]
|
||||
@@ -403,7 +403,7 @@ def test_spec_flags_maintain_order(self, mutable_config, gcc11_with_flags):
|
||||
for successive concretizations.
|
||||
"""
|
||||
mutable_config.set("compilers", [gcc11_with_flags])
|
||||
spec_str = "libelf %gcc@11.1.0 os=redhat6"
|
||||
spec_str = "libelf os=redhat6 %gcc@11.1.0"
|
||||
for _ in range(3):
|
||||
s = spack.concretize.concretize_one(spec_str)
|
||||
assert all(
|
||||
@@ -414,7 +414,7 @@ def test_compiler_flags_differ_identical_compilers(self, mutable_config, clang12
|
||||
mutable_config.set("compilers", [clang12_with_flags])
|
||||
# Correct arch to use test compiler that has flags
|
||||
t = archspec.cpu.host().family
|
||||
spec = Spec(f"pkg-a %clang@12.2.0 platform=test os=redhat6 target={t}")
|
||||
spec = Spec(f"pkg-a platform=test os=redhat6 target={t} %clang@12.2.0")
|
||||
|
||||
# Get the compiler that matches the spec (
|
||||
compiler = spack.compilers.compiler_for_spec("clang@=12.2.0", spec.architecture)
|
||||
@@ -488,13 +488,13 @@ def test_architecture_deep_inheritance(self, mock_targets, compiler_factory):
|
||||
# CNL compiler has no target attribute, and this is essential to make detection pass
|
||||
del cnl_compiler["compiler"]["target"]
|
||||
with spack.config.override("compilers", [cnl_compiler]):
|
||||
spec_str = "mpileaks %gcc@4.5.0 os=CNL target=nocona ^dyninst os=CNL ^callpath os=CNL"
|
||||
spec_str = "mpileaks os=CNL target=nocona %gcc@4.5.0 ^dyninst os=CNL ^callpath os=CNL"
|
||||
spec = spack.concretize.concretize_one(spec_str)
|
||||
for s in spec.traverse(root=False):
|
||||
assert s.architecture.target == spec.architecture.target
|
||||
|
||||
def test_compiler_flags_from_user_are_grouped(self):
|
||||
spec = Spec('pkg-a%gcc cflags="-O -foo-flag foo-val" platform=test')
|
||||
spec = Spec('pkg-a cflags="-O -foo-flag foo-val" platform=test %gcc')
|
||||
spec = spack.concretize.concretize_one(spec)
|
||||
cflags = spec.compiler_flags["cflags"]
|
||||
assert any(x == "-foo-flag foo-val" for x in cflags)
|
||||
@@ -804,7 +804,7 @@ def test_external_and_virtual(self, mutable_config):
|
||||
assert spec["stuff"].compiler.satisfies("gcc")
|
||||
|
||||
def test_compiler_child(self):
|
||||
s = Spec("mpileaks%clang target=x86_64 ^dyninst%gcc")
|
||||
s = Spec("mpileaks target=x86_64 %clang ^dyninst%gcc")
|
||||
s = spack.concretize.concretize_one(s)
|
||||
assert s["mpileaks"].satisfies("%clang")
|
||||
assert s["dyninst"].satisfies("%gcc")
|
||||
@@ -826,7 +826,7 @@ def test_conflict_in_all_directives_true(self):
|
||||
with pytest.raises(spack.error.SpackError):
|
||||
s = spack.concretize.concretize_one(s)
|
||||
|
||||
@pytest.mark.parametrize("spec_str", ["conflict@10.0%clang+foo"])
|
||||
@pytest.mark.parametrize("spec_str", ["conflict@10.0+foo%clang"])
|
||||
def test_no_conflict_in_external_specs(self, spec_str):
|
||||
# Modify the configuration to have the spec with conflict
|
||||
# registered as an external
|
||||
@@ -940,9 +940,9 @@ def test_noversion_pkg(self, spec):
|
||||
"spec, best_achievable",
|
||||
[
|
||||
("mpileaks%gcc@=4.4.7 ^dyninst@=10.2.1 target=x86_64:", "core2"),
|
||||
("mpileaks%gcc@=4.8 target=x86_64:", "haswell"),
|
||||
("mpileaks%gcc@=5.3.0 target=x86_64:", "broadwell"),
|
||||
("mpileaks%apple-clang@=5.1.0 target=x86_64:", "x86_64"),
|
||||
("mpileaks target=x86_64: %gcc@=4.8", "haswell"),
|
||||
("mpileaks target=x86_64: %gcc@=5.3.0", "broadwell"),
|
||||
("mpileaks target=x86_64: %apple-clang@=5.1.0", "x86_64"),
|
||||
],
|
||||
)
|
||||
@pytest.mark.regression("13361", "20537")
|
||||
@@ -1286,7 +1286,7 @@ def test_compiler_match_is_preferred_to_newer_version(self, compiler_factory):
|
||||
with spack.config.override(
|
||||
"compilers", [compiler_factory(spec="gcc@10.1.0", operating_system="redhat6")]
|
||||
):
|
||||
spec_str = "simple-inheritance+openblas %gcc@10.1.0 os=redhat6"
|
||||
spec_str = "simple-inheritance+openblas os=redhat6 %gcc@10.1.0"
|
||||
s = spack.concretize.concretize_one(spec_str)
|
||||
assert "openblas@0.2.15" in s
|
||||
assert s["openblas"].satisfies("%gcc@10.1.0")
|
||||
@@ -1319,7 +1319,7 @@ def test_custom_compiler_version(self, mutable_config, compiler_factory, monkeyp
|
||||
"compilers", [compiler_factory(spec="gcc@10foo", operating_system="redhat6")]
|
||||
)
|
||||
monkeypatch.setattr(spack.compiler.Compiler, "real_version", "10.2.1")
|
||||
s = spack.concretize.concretize_one("pkg-a %gcc@10foo os=redhat6")
|
||||
s = spack.concretize.concretize_one("pkg-a os=redhat6 %gcc@10foo")
|
||||
assert "%gcc@10foo" in s
|
||||
|
||||
def test_all_patches_applied(self):
|
||||
@@ -1531,8 +1531,8 @@ def test_external_with_non_default_variant_as_dependency(self):
|
||||
("mpileaks", "os=debian6"),
|
||||
# To trigger the bug in 22871 we need to have the same compiler
|
||||
# spec available on both operating systems
|
||||
("mpileaks%gcc@10.2.1 platform=test os=debian6", "os=debian6"),
|
||||
("mpileaks%gcc@10.2.1 platform=test os=redhat6", "os=redhat6"),
|
||||
("mpileaks platform=test os=debian6 %gcc@10.2.1", "os=debian6"),
|
||||
("mpileaks platform=test os=redhat6 %gcc@10.2.1", "os=redhat6"),
|
||||
],
|
||||
)
|
||||
def test_os_selection_when_multiple_choices_are_possible(
|
||||
@@ -3013,7 +3013,7 @@ def test_virtuals_provided_together_but_only_one_required_in_dag(self):
|
||||
|
||||
|
||||
def test_reusable_externals_match(mock_packages, tmpdir):
|
||||
spec = Spec("mpich@4.1%gcc@13.1.0~debug build_system=generic arch=linux-ubuntu23.04-zen2")
|
||||
spec = Spec("mpich@4.1~debug build_system=generic arch=linux-ubuntu23.04-zen2 %gcc@13.1.0")
|
||||
spec.external_path = tmpdir.strpath
|
||||
spec.external_modules = ["mpich/4.1"]
|
||||
spec._mark_concrete()
|
||||
@@ -3031,7 +3031,7 @@ def test_reusable_externals_match(mock_packages, tmpdir):
|
||||
|
||||
|
||||
def test_reusable_externals_match_virtual(mock_packages, tmpdir):
|
||||
spec = Spec("mpich@4.1%gcc@13.1.0~debug build_system=generic arch=linux-ubuntu23.04-zen2")
|
||||
spec = Spec("mpich@4.1~debug build_system=generic arch=linux-ubuntu23.04-zen2 %gcc@13.1.0")
|
||||
spec.external_path = tmpdir.strpath
|
||||
spec.external_modules = ["mpich/4.1"]
|
||||
spec._mark_concrete()
|
||||
@@ -3049,7 +3049,7 @@ def test_reusable_externals_match_virtual(mock_packages, tmpdir):
|
||||
|
||||
|
||||
def test_reusable_externals_different_prefix(mock_packages, tmpdir):
|
||||
spec = Spec("mpich@4.1%gcc@13.1.0~debug build_system=generic arch=linux-ubuntu23.04-zen2")
|
||||
spec = Spec("mpich@4.1~debug build_system=generic arch=linux-ubuntu23.04-zen2 %gcc@13.1.0")
|
||||
spec.external_path = "/other/path"
|
||||
spec.external_modules = ["mpich/4.1"]
|
||||
spec._mark_concrete()
|
||||
@@ -3068,7 +3068,7 @@ def test_reusable_externals_different_prefix(mock_packages, tmpdir):
|
||||
|
||||
@pytest.mark.parametrize("modules", [None, ["mpich/4.1", "libfabric/1.19"]])
|
||||
def test_reusable_externals_different_modules(mock_packages, tmpdir, modules):
|
||||
spec = Spec("mpich@4.1%gcc@13.1.0~debug build_system=generic arch=linux-ubuntu23.04-zen2")
|
||||
spec = Spec("mpich@4.1~debug build_system=generic arch=linux-ubuntu23.04-zen2 %gcc@13.1.0")
|
||||
spec.external_path = tmpdir.strpath
|
||||
spec.external_modules = modules
|
||||
spec._mark_concrete()
|
||||
@@ -3086,7 +3086,7 @@ def test_reusable_externals_different_modules(mock_packages, tmpdir, modules):
|
||||
|
||||
|
||||
def test_reusable_externals_different_spec(mock_packages, tmpdir):
|
||||
spec = Spec("mpich@4.1%gcc@13.1.0~debug build_system=generic arch=linux-ubuntu23.04-zen2")
|
||||
spec = Spec("mpich@4.1~debug build_system=generic arch=linux-ubuntu23.04-zen2 %gcc@13.1.0")
|
||||
spec.external_path = tmpdir.strpath
|
||||
spec._mark_concrete()
|
||||
assert not spack.solver.asp._is_reusable(
|
||||
|
||||
@@ -94,7 +94,7 @@ def test_mix_spec_and_compiler_cfg(concretize_scope, test_repo):
|
||||
conf_str = _compiler_cfg_one_entry_with_cflags("-Wall")
|
||||
update_concretize_scope(conf_str, "compilers")
|
||||
|
||||
s1 = spack.concretize.concretize_one('y %gcc@12.100.100 cflags="-O2"')
|
||||
s1 = spack.concretize.concretize_one('y cflags="-O2" %gcc@12.100.100')
|
||||
assert s1.satisfies('cflags="-Wall -O2"')
|
||||
|
||||
|
||||
@@ -182,7 +182,7 @@ def test_propagate_and_compiler_cfg(concretize_scope, test_repo):
|
||||
conf_str = _compiler_cfg_one_entry_with_cflags("-f2")
|
||||
update_concretize_scope(conf_str, "compilers")
|
||||
|
||||
root_spec = spack.concretize.concretize_one("v %gcc@12.100.100 cflags=='-f1'")
|
||||
root_spec = spack.concretize.concretize_one("v cflags=='-f1' %gcc@12.100.100")
|
||||
assert root_spec["y"].satisfies("cflags='-f1 -f2'")
|
||||
|
||||
|
||||
@@ -229,7 +229,7 @@ def test_dev_mix_flags(tmp_path, concretize_scope, mutable_mock_env_path, test_r
|
||||
env_content = f"""\
|
||||
spack:
|
||||
specs:
|
||||
- y %gcc@12.100.100 cflags=='-fsanitize=address'
|
||||
- y cflags=='-fsanitize=address' %gcc@12.100.100
|
||||
develop:
|
||||
y:
|
||||
spec: y cflags=='-fsanitize=address'
|
||||
|
||||
@@ -359,10 +359,10 @@ def test_one_package_multiple_oneof_groups(concretize_scope, test_repo):
|
||||
update_packages_config(conf_str)
|
||||
|
||||
s1 = spack.concretize.concretize_one("y@2.5")
|
||||
assert s1.satisfies("%clang~shared")
|
||||
assert s1.satisfies("~shared%clang")
|
||||
|
||||
s2 = spack.concretize.concretize_one("y@2.4")
|
||||
assert s2.satisfies("%gcc+shared")
|
||||
assert s2.satisfies("+shared%gcc")
|
||||
|
||||
|
||||
@pytest.mark.regression("34241")
|
||||
@@ -499,7 +499,7 @@ def test_default_requirements_with_all(spec_str, requirement_str, concretize_sco
|
||||
"requirements,expectations",
|
||||
[
|
||||
(("%gcc", "%clang"), ("%gcc", "%clang")),
|
||||
(("%gcc~shared", "@1.0"), ("%gcc~shared", "@1.0+shared")),
|
||||
(("~shared%gcc", "@1.0"), ("~shared%gcc", "@1.0+shared")),
|
||||
],
|
||||
)
|
||||
def test_default_and_package_specific_requirements(
|
||||
@@ -754,7 +754,7 @@ def test_skip_requirement_when_default_requirement_condition_cannot_be_met(
|
||||
update_packages_config(packages_yaml)
|
||||
s = spack.concretize.concretize_one("mpileaks")
|
||||
|
||||
assert s.satisfies("%clang+shared")
|
||||
assert s.satisfies("+shared %clang")
|
||||
# Sanity checks that 'callpath' doesn't have the shared variant, but that didn't
|
||||
# cause failures during concretization.
|
||||
assert "shared" not in s["callpath"].variants
|
||||
|
||||
@@ -1221,7 +1221,7 @@ def test_user_config_path_is_default_when_env_var_is_empty(working_env):
|
||||
|
||||
|
||||
def test_default_install_tree(monkeypatch, default_config):
|
||||
s = spack.spec.Spec("nonexistent@x.y.z %none@a.b.c arch=foo-bar-baz")
|
||||
s = spack.spec.Spec("nonexistent@x.y.z arch=foo-bar-baz %none@a.b.c")
|
||||
monkeypatch.setattr(s, "dag_hash", lambda length: "abc123")
|
||||
_, _, projections = spack.store.parse_install_tree(spack.config.get("config"))
|
||||
assert s.format(projections["all"]) == "foo-bar-baz/none-a.b.c/nonexistent-x.y.z-abc123"
|
||||
|
||||
@@ -1700,7 +1700,7 @@ def installation_dir_with_headers(tmpdir_factory):
|
||||
##########
|
||||
|
||||
|
||||
@pytest.fixture(params=["conflict%clang+foo", "conflict-parent@0.9^conflict~foo"])
|
||||
@pytest.fixture(params=["conflict+foo%clang", "conflict-parent@0.9^conflict~foo"])
|
||||
def conflict_spec(request):
|
||||
"""Specs which violate constraints specified with the "conflicts"
|
||||
directive in the "conflict" package.
|
||||
|
||||
@@ -53,7 +53,7 @@ def test_no_version_match(pkg_name):
|
||||
# Constraints on compilers with a default
|
||||
("%gcc", "has_a_default", "gcc"),
|
||||
("%clang", "has_a_default", "clang"),
|
||||
("%apple-clang os=elcapitan", "has_a_default", "default"),
|
||||
("os=elcapitan %apple-clang", "has_a_default", "default"),
|
||||
# Constraints on dependencies
|
||||
("^zmpi", "different_by_dep", "zmpi"),
|
||||
("^mpich", "different_by_dep", "mpich"),
|
||||
@@ -74,7 +74,7 @@ def test_multimethod_calls(
|
||||
with spack.config.override(
|
||||
"compilers", [compiler_factory(spec="apple-clang@9.1.0", operating_system="elcapitan")]
|
||||
):
|
||||
s = spack.concretize.concretize_one(pkg_name + constraint_str)
|
||||
s = spack.concretize.concretize_one(f"{pkg_name} {constraint_str}")
|
||||
msg = f"Method {method_name} from {s} is giving a wrong result"
|
||||
assert getattr(s.package, method_name)() == expected_result, msg
|
||||
|
||||
|
||||
@@ -38,9 +38,9 @@
|
||||
{"optional-dep-test@1.1%intel": {"pkg-b": None, "pkg-c": None}},
|
||||
),
|
||||
(
|
||||
"optional-dep-test@1.1%intel@64.1.2+a",
|
||||
"optional-dep-test@1.1+a%intel@64.1.2",
|
||||
{
|
||||
"optional-dep-test@1.1%intel@64.1.2+a": {
|
||||
"optional-dep-test@1.1+a%intel@64.1.2": {
|
||||
"pkg-a": None,
|
||||
"pkg-b": None,
|
||||
"pkg-c": None,
|
||||
@@ -49,8 +49,8 @@
|
||||
},
|
||||
),
|
||||
(
|
||||
"optional-dep-test@1.1%clang@36.5+a",
|
||||
{"optional-dep-test@1.1%clang@36.5+a": {"pkg-b": None, "pkg-a": None, "pkg-e": None}},
|
||||
"optional-dep-test@1.1+a%clang@36.5",
|
||||
{"optional-dep-test@1.1+a%clang@36.5": {"pkg-b": None, "pkg-a": None, "pkg-e": None}},
|
||||
),
|
||||
# Chained MPI
|
||||
(
|
||||
|
||||
@@ -160,11 +160,11 @@ def _specfile_for(spec_str, filename):
|
||||
),
|
||||
# Version after compiler
|
||||
(
|
||||
"foo %bar@1.0 @2.0",
|
||||
"foo @2.0 %bar@1.0",
|
||||
[
|
||||
Token(SpecTokens.UNQUALIFIED_PACKAGE_NAME, value="foo"),
|
||||
Token(SpecTokens.COMPILER_AND_VERSION, value="%bar@1.0"),
|
||||
Token(SpecTokens.VERSION, value="@2.0"),
|
||||
Token(SpecTokens.COMPILER_AND_VERSION, value="%bar@1.0"),
|
||||
],
|
||||
"foo@2.0 %bar@1.0",
|
||||
),
|
||||
@@ -175,15 +175,15 @@ def _specfile_for(spec_str, filename):
|
||||
dependency_with_version("openmpi ^hwloc@1.2e6:1.4b7-rc3"),
|
||||
# Complex specs with multiple constraints
|
||||
(
|
||||
"mvapich_foo ^_openmpi@1.2:1.4,1.6%intel@12.1+debug~qt_4 ^stackwalker@8.1_1e",
|
||||
"mvapich_foo ^_openmpi@1.2:1.4,1.6+debug~qt_4 %intel@12.1 ^stackwalker@8.1_1e",
|
||||
[
|
||||
Token(SpecTokens.UNQUALIFIED_PACKAGE_NAME, value="mvapich_foo"),
|
||||
Token(SpecTokens.DEPENDENCY, value="^"),
|
||||
Token(SpecTokens.UNQUALIFIED_PACKAGE_NAME, value="_openmpi"),
|
||||
Token(SpecTokens.VERSION, value="@1.2:1.4,1.6"),
|
||||
Token(SpecTokens.COMPILER_AND_VERSION, value="%intel@12.1"),
|
||||
Token(SpecTokens.BOOL_VARIANT, value="+debug"),
|
||||
Token(SpecTokens.BOOL_VARIANT, value="~qt_4"),
|
||||
Token(SpecTokens.COMPILER_AND_VERSION, value="%intel@12.1"),
|
||||
Token(SpecTokens.DEPENDENCY, value="^"),
|
||||
Token(SpecTokens.UNQUALIFIED_PACKAGE_NAME, value="stackwalker"),
|
||||
Token(SpecTokens.VERSION, value="@8.1_1e"),
|
||||
@@ -191,15 +191,15 @@ def _specfile_for(spec_str, filename):
|
||||
"mvapich_foo ^_openmpi@1.2:1.4,1.6+debug~qt_4 %intel@12.1 ^stackwalker@8.1_1e",
|
||||
),
|
||||
(
|
||||
"mvapich_foo ^_openmpi@1.2:1.4,1.6%intel@12.1~qt_4 debug=2 ^stackwalker@8.1_1e",
|
||||
"mvapich_foo ^_openmpi@1.2:1.4,1.6~qt_4 debug=2 %intel@12.1 ^stackwalker@8.1_1e",
|
||||
[
|
||||
Token(SpecTokens.UNQUALIFIED_PACKAGE_NAME, value="mvapich_foo"),
|
||||
Token(SpecTokens.DEPENDENCY, value="^"),
|
||||
Token(SpecTokens.UNQUALIFIED_PACKAGE_NAME, value="_openmpi"),
|
||||
Token(SpecTokens.VERSION, value="@1.2:1.4,1.6"),
|
||||
Token(SpecTokens.COMPILER_AND_VERSION, value="%intel@12.1"),
|
||||
Token(SpecTokens.BOOL_VARIANT, value="~qt_4"),
|
||||
Token(SpecTokens.KEY_VALUE_PAIR, value="debug=2"),
|
||||
Token(SpecTokens.COMPILER_AND_VERSION, value="%intel@12.1"),
|
||||
Token(SpecTokens.DEPENDENCY, value="^"),
|
||||
Token(SpecTokens.UNQUALIFIED_PACKAGE_NAME, value="stackwalker"),
|
||||
Token(SpecTokens.VERSION, value="@8.1_1e"),
|
||||
@@ -207,17 +207,17 @@ def _specfile_for(spec_str, filename):
|
||||
"mvapich_foo ^_openmpi@1.2:1.4,1.6~qt_4 debug=2 %intel@12.1 ^stackwalker@8.1_1e",
|
||||
),
|
||||
(
|
||||
"mvapich_foo ^_openmpi@1.2:1.4,1.6%intel@12.1 cppflags=-O3 +debug~qt_4 "
|
||||
"mvapich_foo ^_openmpi@1.2:1.4,1.6 cppflags=-O3 +debug~qt_4 %intel@12.1 "
|
||||
"^stackwalker@8.1_1e",
|
||||
[
|
||||
Token(SpecTokens.UNQUALIFIED_PACKAGE_NAME, value="mvapich_foo"),
|
||||
Token(SpecTokens.DEPENDENCY, value="^"),
|
||||
Token(SpecTokens.UNQUALIFIED_PACKAGE_NAME, value="_openmpi"),
|
||||
Token(SpecTokens.VERSION, value="@1.2:1.4,1.6"),
|
||||
Token(SpecTokens.COMPILER_AND_VERSION, value="%intel@12.1"),
|
||||
Token(SpecTokens.KEY_VALUE_PAIR, value="cppflags=-O3"),
|
||||
Token(SpecTokens.BOOL_VARIANT, value="+debug"),
|
||||
Token(SpecTokens.BOOL_VARIANT, value="~qt_4"),
|
||||
Token(SpecTokens.COMPILER_AND_VERSION, value="%intel@12.1"),
|
||||
Token(SpecTokens.DEPENDENCY, value="^"),
|
||||
Token(SpecTokens.UNQUALIFIED_PACKAGE_NAME, value="stackwalker"),
|
||||
Token(SpecTokens.VERSION, value="@8.1_1e"),
|
||||
@@ -486,10 +486,10 @@ def _specfile_for(spec_str, filename):
|
||||
"a@1:",
|
||||
),
|
||||
(
|
||||
"% intel @ 12.1:12.6 + debug",
|
||||
"+ debug % intel @ 12.1:12.6",
|
||||
[
|
||||
Token(SpecTokens.COMPILER_AND_VERSION, value="% intel @ 12.1:12.6"),
|
||||
Token(SpecTokens.BOOL_VARIANT, value="+ debug"),
|
||||
Token(SpecTokens.COMPILER_AND_VERSION, value="% intel @ 12.1:12.6"),
|
||||
],
|
||||
"+debug %intel@12.1:12.6",
|
||||
),
|
||||
@@ -640,15 +640,15 @@ def test_parse_single_spec(spec_str, tokens, expected_roundtrip, mock_git_test_p
|
||||
["mvapich cppflags=-O3", "emacs"],
|
||||
),
|
||||
(
|
||||
"mvapich emacs @1.1.1 %intel cflags=-O3",
|
||||
"mvapich emacs @1.1.1 cflags=-O3 %intel",
|
||||
[
|
||||
Token(SpecTokens.UNQUALIFIED_PACKAGE_NAME, value="mvapich"),
|
||||
Token(SpecTokens.UNQUALIFIED_PACKAGE_NAME, value="emacs"),
|
||||
Token(SpecTokens.VERSION, value="@1.1.1"),
|
||||
Token(SpecTokens.COMPILER, value="%intel"),
|
||||
Token(SpecTokens.KEY_VALUE_PAIR, value="cflags=-O3"),
|
||||
Token(SpecTokens.COMPILER, value="%intel"),
|
||||
],
|
||||
["mvapich", "emacs @1.1.1 %intel cflags=-O3"],
|
||||
["mvapich", "emacs @1.1.1 cflags=-O3 %intel"],
|
||||
),
|
||||
(
|
||||
'mvapich cflags="-O3 -fPIC" emacs^ncurses%intel',
|
||||
@@ -1232,7 +1232,7 @@ def test_compare_abstract_specs():
|
||||
"foo.foo@foo+foo",
|
||||
"foo.foo@foo+foo arch=foo-foo-foo",
|
||||
"foo.foo@foo+foo arch=foo-foo-foo %foo",
|
||||
"foo.foo@foo+foo arch=foo-foo-foo %foo cflags=foo",
|
||||
"foo.foo@foo+foo arch=foo-foo-foo cflags=foo %foo",
|
||||
]
|
||||
specs = [SpecParser(s).next_spec() for s in constraints]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user