Compare commits
8 Commits
features/r
...
features/r
Author | SHA1 | Date | |
---|---|---|---|
![]() |
89b4d2a33e | ||
![]() |
546e5a9a54 | ||
![]() |
401c183de9 | ||
![]() |
b757500d9e | ||
![]() |
2b759cf853 | ||
![]() |
a8e2da5bb8 | ||
![]() |
97750189b6 | ||
![]() |
bcd40835a0 |
@@ -34,6 +34,7 @@ an object, with the following keys:
|
||||
|
||||
1. ``roots``: if ``true`` root specs are reused, if ``false`` only dependencies of root specs are reused
|
||||
2. ``from``: list of sources from which reused specs are taken
|
||||
3. ``namespaces``: list of namespaces from which to reuse specs, or the string ``"any"``.
|
||||
|
||||
Each source in ``from`` is itself an object:
|
||||
|
||||
@@ -56,6 +57,7 @@ For instance, the following configuration:
|
||||
concretizer:
|
||||
reuse:
|
||||
roots: true
|
||||
namespaces: [builtin]
|
||||
from:
|
||||
- type: local
|
||||
include:
|
||||
@@ -63,7 +65,8 @@ For instance, the following configuration:
|
||||
- "%clang"
|
||||
|
||||
tells the concretizer to reuse all specs compiled with either ``gcc`` or ``clang``, that are installed
|
||||
in the local store. Any spec from remote buildcaches is disregarded.
|
||||
in the local store. Any spec from remote buildcaches is disregarded. Any spec from a namespace other than
|
||||
Spack's builtin repo is disregarded.
|
||||
|
||||
To reduce the boilerplate in configuration files, default values for the ``include`` and
|
||||
``exclude`` options can be pushed up one level:
|
||||
|
@@ -25,6 +25,12 @@
|
||||
"roots": {"type": "boolean"},
|
||||
"include": LIST_OF_SPECS,
|
||||
"exclude": LIST_OF_SPECS,
|
||||
"namespaces": {
|
||||
"oneOf": [
|
||||
{"type": "string", "enum": ["any"]},
|
||||
{"type": "array", "items": {"type": "string"}},
|
||||
]
|
||||
},
|
||||
"from": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
|
@@ -3986,6 +3986,7 @@ def __init__(self, configuration: spack.config.Configuration) -> None:
|
||||
self.configuration = configuration
|
||||
self.store = spack.store.create(configuration)
|
||||
self.reuse_strategy = ReuseStrategy.ROOTS
|
||||
self.reuse_namespaces = "any"
|
||||
|
||||
reuse_yaml = self.configuration.get("concretizer:reuse", False)
|
||||
self.reuse_sources = []
|
||||
@@ -4016,6 +4017,7 @@ def __init__(self, configuration: spack.config.Configuration) -> None:
|
||||
self.reuse_strategy = ReuseStrategy.ROOTS
|
||||
else:
|
||||
self.reuse_strategy = ReuseStrategy.DEPENDENCIES
|
||||
self.reuse_namespaces = reuse_yaml.get("namespaces", "any")
|
||||
default_include = reuse_yaml.get("include", [])
|
||||
default_exclude = reuse_yaml.get("exclude", [])
|
||||
default_sources = [{"type": "local"}, {"type": "buildcache"}]
|
||||
@@ -4083,6 +4085,9 @@ def reusable_specs(self, specs: List[spack.spec.Spec]) -> List[spack.spec.Spec]:
|
||||
if self.reuse_strategy == ReuseStrategy.DEPENDENCIES:
|
||||
result = [spec for spec in result if not any(root in spec for root in specs)]
|
||||
|
||||
if self.reuse_namespaces != "any":
|
||||
result = [spec for spec in result if spec.namespace in self.reuse_namespaces]
|
||||
|
||||
return result
|
||||
|
||||
|
||||
|
@@ -1460,6 +1460,35 @@ def test_no_reuse_when_variant_condition_does_not_hold(self, mutable_database, m
|
||||
new2 = spack.concretize.concretize_one("conditional-variant-pkg +two_whens")
|
||||
assert new2.satisfies("@2 +two_whens +version_based")
|
||||
|
||||
def test_reuse_by_namespace(self, mutable_database, mock_packages):
|
||||
spack.config.set("concretizer:reuse", True)
|
||||
# Set spack to prefer an older version when doing new builds, but prioritize reuse higher
|
||||
spack.config.set("packages:libelf", {"version": ["0.8.10"]})
|
||||
|
||||
# Expected behavior is to reuse the libelf@0.8.13 from mutable database
|
||||
# despite configured preference for older version
|
||||
reuse = spack.concretize.concretize_one("libelf")
|
||||
assert reuse.installed
|
||||
assert reuse.satisfies("@0.8.13")
|
||||
|
||||
# Reuse is turned off, so preference will be respected
|
||||
spack.config.set("concretizer:reuse", {"namespaces": []})
|
||||
noreuse = spack.concretize.concretize_one("libelf")
|
||||
assert not noreuse.installed
|
||||
assert noreuse.satisfies("@0.8.10")
|
||||
|
||||
# Expected behavior same as first concretization
|
||||
spack.config.set("concretizer:reuse", {"namespaces": ["builtin.mock"]})
|
||||
noreuse = spack.concretize.concretize_one("libelf")
|
||||
assert noreuse.installed
|
||||
assert noreuse.satisfies("@0.8.13")
|
||||
|
||||
# Expected behavior same as second concretization
|
||||
spack.config.set("concretizer:reuse", {"namespaces": ["foobar"]})
|
||||
noreuse = spack.concretize.concretize_one("libelf")
|
||||
assert not noreuse.installed
|
||||
assert noreuse.satisfies("@0.8.10")
|
||||
|
||||
def test_reuse_with_flags(self, mutable_database, mutable_config):
|
||||
spack.config.set("concretizer:reuse", True)
|
||||
spec = spack.concretize.concretize_one("pkg-a cflags=-g cxxflags=-g")
|
||||
|
@@ -36,7 +36,7 @@ bin/spack -h
|
||||
bin/spack help -a
|
||||
|
||||
# Profile and print top 20 lines for a simple call to spack spec
|
||||
spack -p --lines 20 spec mpileaks%gcc ^dyninst@10.0.0 ^elfutils@0.170
|
||||
spack -p --lines 20 spec mpileaks%gcc
|
||||
$coverage_run $(which spack) bootstrap status --dev --optional
|
||||
|
||||
# Check that we can import Spack packages directly as a first import
|
||||
|
@@ -92,9 +92,9 @@ def pgo_train(self):
|
||||
|
||||
# Set PGO training flags.
|
||||
generate_mods = EnvironmentModifications()
|
||||
generate_mods.append_flags("CFLAGS", "-fprofile-generate={}".format(reports))
|
||||
generate_mods.append_flags("CXXFLAGS", "-fprofile-generate={}".format(reports))
|
||||
generate_mods.append_flags("LDFLAGS", "-fprofile-generate={} --verbose".format(reports))
|
||||
generate_mods.append_flags("CFLAGS", f"-fprofile-generate={reports}")
|
||||
generate_mods.append_flags("CXXFLAGS", f"-fprofile-generate={reports}")
|
||||
generate_mods.append_flags("LDFLAGS", f"-fprofile-generate={reports}")
|
||||
|
||||
with working_dir(self.build_directory, create=True):
|
||||
cmake(*cmake_options, sources, extra_env=generate_mods)
|
||||
@@ -118,14 +118,14 @@ def pgo_train(self):
|
||||
# Clean the build dir.
|
||||
rmtree(self.build_directory, ignore_errors=True)
|
||||
|
||||
if self.spec.satisfies("%clang") or self.spec.satisfies("apple-clang"):
|
||||
if self.spec.satisfies("%clang") or self.spec.satisfies("%apple-clang"):
|
||||
# merge reports
|
||||
use_report = join_path(reports, "merged.prof")
|
||||
raw_files = glob.glob(join_path(reports, "*.profraw"))
|
||||
llvm_profdata("merge", "--output={}".format(use_report), *raw_files)
|
||||
use_flag = "-fprofile-instr-use={}".format(use_report)
|
||||
llvm_profdata("merge", f"--output={use_report}", *raw_files)
|
||||
use_flag = f"-fprofile-instr-use={use_report}"
|
||||
else:
|
||||
use_flag = "-fprofile-use={}".format(reports)
|
||||
use_flag = f"-fprofile-use={reports}"
|
||||
|
||||
# Set PGO use flags for next cmake phase.
|
||||
use_mods = EnvironmentModifications()
|
||||
|
@@ -17,6 +17,7 @@ class PyMaturin(PythonPackage):
|
||||
|
||||
license("Apache-2.0")
|
||||
|
||||
version("1.8.2", sha256="e31abc70f6f93285d6e63d2f4459c079c94c259dd757370482d2d4ceb9ec1fa0")
|
||||
version("1.6.0", sha256="b955025c24c8babc808db49e0ff90db8b4b1320dcc16b14eb26132841737230d")
|
||||
version("1.5.1", sha256="3dd834ece80edb866af18cbd4635e0ecac40139c726428d5f1849ae154b26dca")
|
||||
version("1.4.0", sha256="ed12e1768094a7adeafc3a74ebdb8dc2201fa64c4e7e31f14cfc70378bf93790")
|
||||
@@ -42,4 +43,5 @@ class PyMaturin(PythonPackage):
|
||||
# May be an accidental dependency, remove in the future
|
||||
# https://git.alpinelinux.org/aports/commit/?id=7ad298b467403b96a6b97d050170e367f147a75f
|
||||
# https://patchwork.yoctoproject.org/project/oe-core/patch/8803dc101b641c948805cab9e5784c38f43b0e51.1702791173.git.tim.orling@konsulko.com/
|
||||
depends_on("bzip2", when="platform=darwin")
|
||||
# This seems to still be an issue for others
|
||||
depends_on("bzip2")
|
||||
|
Reference in New Issue
Block a user