summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)AuthorFilesLines
2024-08-02build(deps): bump mypy from 1.11.0 to 1.11.1 in /lib/spack/docs (#45530)dependabot[bot]1-1/+1
Bumps [mypy](https://github.com/python/mypy) from 1.11.0 to 1.11.1. - [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md) - [Commits](https://github.com/python/mypy/compare/v1.11...v1.11.1) --- updated-dependencies: - dependency-name: mypy dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-02Allow spec queries by `namespace` (#45416)Todd Gamblin5-105/+134
* Allow spec queries by `namespace` Spack specs have "namespaces" that indicate what package repository they come from, but there has not been a way to use the spec syntax to match one. You can say things like this: ```console spack find builtin.zlib spack find myrepo.zlib ``` But, because namespaces are written as a dot-separated prefix on the name, you can't say "find me all specs in namespace myrepo". The syntax doesn't allow it. This PR allows you to specify anonymous specs with namespaces on the CLI. Specifically you can do queries like this: ```console spack find namespace=builtin spack find namespace=myrepo ``` You can use this anywhere else you use spec syntax, e.g. in a config file to separate installations based on what repo they came from: ```yaml spack: config: install_tree: root: $spack/opt/spack projections: namespace=myrepo: "myrepo_special_path/{name}-{hash}" namespace=builtin: "builtin/{name}-{hash}" ``` This PR adds a special `namespace_if_anonymous` attribute to specs, which returns the `namespace` if the spec has no name, otherwise it returns `None`. This allows us to print the namespace for anonymous specs but to continue hiding it for most views, as we've done so far. This is implemented as a special case, but it's one that already exists, along with `platform`, `os`, `target`, etc. This also reserves existing special case names for variants so that users cannot define them in their package files. This change is potentially breaking, but I do not think it will be common. There are no builtin packages with a variant called `namespace`, and defining `os`, `target`, or `platform` as a variant would've likely caused other problems if they were already being used. Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2024-08-01format: allow spaces in format specifiers (#45487)Todd Gamblin4-47/+88
* format: allow spaces in format specifiers Key-value pair format specifiers can now contain spaces in the key. This allows us to add spaces to format strings that are *only* present when the attribute formatted is not ``None``. Instead of writing: ``` {arch=architecture} ``` and special casing `arch=` like a sigil in `Spec.format()`, we can now write: ``` { arch=architecture} ``` And the space is *only* printed when `architecture` is not `None`. This allows us to remove the special case in `Spec.format()` for `arch=`. Previously the only `key=` prefix allowed in format specifiers was `arch=`, but this PR removes that requirement, and the `key=` part of a key-value specifier can be any name. It does *not* have to correspond to the formatted attribute. - [x] modify `SPEC_FORMAT_RE` to allow arbitrary keys in key-value pairs. - [x] remove special case for `arch=` from `Spec.format()`. - [x] modify format strings using `{arch=architecture}` to use `{ arch=architecture}` - [x] add more tests for formatting This PR saves other more complex attributes like compiler flags and their spacing for later. Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2024-08-01Windows msvsc: Report accurate platform toolset version for VS2022 (#45525)John W. Parent1-7/+38
VC toolset versions 144 and 143 are both associated with the platform toolset 143; this deviates from prior version choices made by the MSVC devs; add a special case to report platform toolset version as 143 when VC toolset version is >= 143 (this will need revisiting for later releases).
2024-07-29wasi-sdk: add default providerTodd Gamblin2-13/+16
This was missed in #45394 because we don't run unit tests for package PRs, and `test_all_virtual_packages_have_default_providers`, which would've caught it, is a unit test, not an audit. - [x] add a default provider for `wasi-sdk` in `etc/spack/defaults/packages.yaml` (which we require for all virtuals) - [x] rework `test_all_virtual_packages_have_default_providers` as an audit called `_ensure_all_virtual_packages_have_default_providers` Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2024-07-24`spack pkg grep`: don't warn when grepping for quoted strings (#45412)Todd Gamblin2-2/+5
The `Executable` class emits a warning when you pass quoted arguments to it: ``` > spack pkg grep '"namespace"' ==> Warning: Quotes in command arguments can confuse scripts like configure. The following arguments may cause problems when executed: "namespace" Quotes aren't needed because spack doesn't use a shell. Consider removing them. If multiple levels of quotation are required, use `ignore_quotes=True`. ``` This is to warn new package authors who aren't used to calling build commands in python. It's not useful for `spack pkg grep`, where we really are passing args on the command line, and if we pass a quoted string, we probably meant to. - [x] make `ignore_quotes` an instance variable, not just an argument to ``__call__` - [x] set `ignore_quotes` to `True` in `spack pkg grep` Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2024-07-23build(deps): bump pytest from 8.2.2 to 8.3.1 in /lib/spack/docs (#45377)dependabot[bot]1-1/+1
Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.2.2 to 8.3.1. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/8.2.2...8.3.1) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-23build(deps): bump sphinx from 7.4.6 to 7.4.7 in /lib/spack/docs (#45376)dependabot[bot]1-1/+1
Bumps [sphinx](https://github.com/sphinx-doc/sphinx) from 7.4.6 to 7.4.7. - [Release notes](https://github.com/sphinx-doc/sphinx/releases) - [Changelog](https://github.com/sphinx-doc/sphinx/blob/master/CHANGES.rst) - [Commits](https://github.com/sphinx-doc/sphinx/compare/v7.4.6...v7.4.7) --- updated-dependencies: - dependency-name: sphinx dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-23GoPackage: default `-modcacherw` to ensure stage cleanup (#45350)Wouter Deconinck1-1/+1
2024-07-20build(deps): bump mypy from 1.10.1 to 1.11.0 in /lib/spack/docs (#45337)dependabot[bot]1-1/+1
Bumps [mypy](https://github.com/python/mypy) from 1.10.1 to 1.11.0. - [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md) - [Commits](https://github.com/python/mypy/compare/v1.10.1...v1.11) --- updated-dependencies: - dependency-name: mypy dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-20Testing: omit test on windows (#45340)Peter Scheibel1-0/+1
Re-disable a test that was enabled in #45031
2024-07-19Windows Tests: enable more cmd tests on Windows (#45031)Nicole C.8-22/+3
* Several tests can be enabled on Windows with no changes to logic (either the test logic or logic being tested) * Test for `spack location` requires modification of the test logic, but with a minor change can be enabled on Windows
2024-07-19docs: util/environment.py: use `re.Pattern[str]` instead of `re` (#45329)Wouter Deconinck2-3/+3
* docs: util/environment.py: use `re.Pattern[str]` instead of `re` * docs: sphinx==7.4.6
2024-07-18Do not initialize previous store state in "use_store" (#45268)Massimiliano Culpo2-1/+22
The "use_store" context manager is used to swap the value of a global variable (spack.store.STORE), while keeping another global variable consistent (spack.config.CONFIG). When doing that it tries to evaluate the previous value of the store, if that was not done already. This is wrong, since the configuration might be in an "intermediate" state that was never meant to trigger side effects. Remove that operation, and add a unit test to prevent regressions.
2024-07-17environment: handle view root at existing directory better (#45263)Wouter Deconinck2-0/+43
- remove empty dir if exists at view root - error better if non-empty dir Co-authored-by: Harmen Stoppels <me@harmenstoppels.nl>
2024-07-17Run minimization of weights only on known targets (#45269)Massimiliano Culpo1-0/+3
This prevents excessive output from clingo of the kind: .../spack/lib/spack/spack/solver/concretize.lp:1640:5-11: info: tuple ignored: #sup@2
2024-07-16Fix order of deserialization in subprocess context (#45229)Massimiliano Culpo1-1/+3
Since the the MetaPathFinder now owns a lazily constructed RepoPath object, we need to deserialize environments before the package that needs to be restored. Before we were relying on globals to be inconsistent in a way that let the entire process go.
2024-07-16concretizer: show input specs on error (#45245)Harmen Stoppels1-8/+11
2024-07-16Fix error message for test log in child process (#45233)Massimiliano Culpo1-1/+1
If we don't have a log, we'll mask the real error with another caused by using None as an argument to os.path.join
2024-07-16cmd/dependents.py: remove unused loop over all packages (#45166)Wouter Deconinck1-10/+0
2024-07-15unparser.py: remove print statements (#45235)Harmen Stoppels1-2/+0
2024-07-15cuda: add v12.5.1 (#44342)pauleonix1-1/+7
- Add explicit conflict on ppc64le for 12.5 and newer. - Update/fix intel compiler conflict to reflect that intel@2021 is compatible only since 11.4.1 and not since 11.1.1. - Add intel compiler conflicts to reflect strict support matrix since 12.2.0.
2024-07-12Add c to the list of languages (#45191)Harmen Stoppels1-1/+1
2024-07-12directives: types, avoid redundant parsing (#45208)Harmen Stoppels3-23/+23
2024-07-12Add pkg- prefix to builtin.mock a b c d ... (#45205)Harmen Stoppels36-493/+546
2024-07-11Buildcache: remove deprecated --allow-root and preview subcommand (#45204)Tamara Dahlgren3-29/+1
2024-07-11concretize.lp: drop 0 weight of external providers (#45025)Harmen Stoppels3-21/+13
If an external happens to be a provider of anything, the solver would set its weight to 0, meaning that it is most preferred, even if packages.yaml config disagrees. That was done so that `spack external find mpich` would be sufficent to pick it up as mpi provider. That may have made sense for mpi specifically, but doesn't make sense for other virtuals. For example `glibc` provides iconv, and is an external by design, but it's better to use libiconv as a separate package as a provider. Therefore, drop this rule, and instead let users add config: ``` mpi: require: [mpich] ``` or ``` mpi: buildable: false ``` which is well-documented.
2024-07-11external find --not-buildable: mark virtuals (#45159)Harmen Stoppels4-7/+74
This change makes `spack external find --not-buildable` mark virtuals provided by detected packages as non-buildable, so that it's sufficient for users to let spack detect say mpich and have the concretizer pick it up as mpi provider even when openmpi is "more preferred".
2024-07-11checksum: fix circular imports on macOS (#45187)Massimiliano Culpo4-6/+4
2024-07-10Spack on Windows: update dev_build tests to run on Windows (#45039)Nicole C1-6/+3
2024-07-10Avoid duplicate detectable tag (#45160)Harmen Stoppels1-3/+3
in case of inheritance the static tags prop may be updated multiple times, and it turns out builder classes magically inherit from traditional package classes
2024-07-10Set `LD_LIBRARY_PATH` for OneAPI compiler (#45059)Stephen Nicholas Swatman1-2/+6
While trying to build packages with the OneAPI compiler version 2024.1 I ran into the following error, indicating that the compiler is unable to find some necessary libraries: ``` /storage/Software/oneapi/2024.1/compiler/2024.1/bin/sycl-post-link: error while loading shared libraries: libonnxruntime.1.12.22.721.so: cannot open shared object file: No such file or directory icpx: error: unable to execute command: No such file or directory icpx: error: sycl-post-link command failed due to signal (use -v to see invocation) ``` Indeed, `libonnxruntime.1.12.22.721.so` does come bundled with the OneAPI compiler, but it is not available in the build environment by default. In this commit, I update the custom environment created by OneAPI to include the `lib/` directory in which these libraries reside in the `LD_LIBRARY_PATH` environment variable.
2024-07-10Remove unnecessary copy.deepcopy calls (#45135)Massimiliano Culpo5-53/+36
2024-07-09Add compatibility of sequoia with previous macOS versions (#45127)Massimiliano Culpo1-0/+1
* Add compatibility of sequoia with previous macOS versions * Add compatibility of sequoia with previous macOS versions
2024-07-09`spack find -c`: search all concretized-but-not-installed specs (#44713)Peter Scheibel3-19/+58
Originally if you had `x -> y -> z`, and an env with `x` in its speclist that is concretized but not installed, then `spack find -c y` would not show anything. This was intended: `spack find` has up-until-now only ever listed out installed specs (and `-c` was for adding a preamble section about roots). This changes `spack find` so: * `-c` makes it search through all concretized specs in the env (in a sense it is anticipated that a concretized environment would serve as a "speculative" DB and users may want to query it like they query the DB outside of envs) * Adds a `-i/--install-status` option, equivalent to `-I` from `spack spec` * Shows install status for either `-c` or `-i` * As a side effect to prior point, `spack find -i` can now distinguish different installation states (upstream/external) Examples: ``` $ spack find -r ==> In environment findtest ==> 1 root specs - raja ==> 6 installed packages (not shown) ==> 12 concretized packages to be installed (not shown) ``` ``` $ spack find ==> In environment findtest ==> 1 root specs - raja -- darwin-ventura-m1 / apple-clang@14.0.3 ----------------------- berkeley-db@18.1.40 bzip2@1.0.8 diffutils@3.10 gmake@4.4.1 gnuconfig@2022-09-17 libiconv@1.17 ==> 6 installed packages ==> 12 concretized packages to be installed (show with `spack find -c`) ``` ``` $ spack find -c ==> In environment findtest ==> 1 root specs - raja -- darwin-ventura-m1 / apple-clang@14.0.3 ----------------------- [+] berkeley-db@18.1.40 [+] bzip2@1.0.8 - cmake@3.29.4 [+] diffutils@3.10 [+] gmake@4.4.1 [+] libiconv@1.17 - nghttp2@1.62.0 - pkgconf@2.2.0 - readline@8.2 - blt@0.6.2 - camp@2024.02.1 - curl@8.7.1 - gdbm@1.23 [+] gnuconfig@2022-09-17 - ncurses@6.5 - perl@5.38.2 - raja@2024.02.2 - zlib-ng@2.1.6 ==> 6 installed packages ==> 12 concretized packages to be installed ``` $ spack -E find ... ==> 82 installed packages ```
2024-07-09Remove the "install_mockery_mutable_config" fixture (#45129)Massimiliano Culpo10-123/+42
This fixture was introduced in #16429, and made redundant in #39024
2024-07-09Fix conflicting use of `config` and `mutable_config` fixtures in unit tests ↵Massimiliano Culpo31-173/+122
(#45106) and add a fixture to detect use of conflicting fixtures
2024-07-08environments.rst: go from simple to advanced (#45004)Harmen Stoppels1-76/+86
* environments.rst: go from simple to advanced * improvements * notes about activation
2024-07-08spec.py: print right deptype in tree (#45091)Harmen Stoppels2-5/+32
Fix a bug where Spec.tree with cover=nodes reduces deptypes from all in-edges, including from nodes not reachable from the root, which almost always happens for concrete specs
2024-07-08spec.py: fix __getitem__ looking outside of dag (#45090)Harmen Stoppels2-18/+30
`Spec.__getitem__` queries dependent edges, which almost always point to nodes outside the sub-dag considered. It should only ever look at edges being traversed.
2024-07-08Add type-hints to RepoPath (#45068)Massimiliano Culpo6-89/+121
* Also, fix a bug with use_repositories + import spack.pkg
2024-07-06spack -C <env>: use env config w/o activation (#45046)Harmen Stoppels4-42/+77
Precedence: 1. Named environment 2. Anonymous environment 3. Generic directory
2024-07-05spack gc: remove debug print statement (#45067)Todd Gamblin1-1/+0
Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2024-07-05config: fix class hierarchy (#45044)Harmen Stoppels10-124/+128
1. Avoid that `self.path` is of type `Optional[str]` 2. Simplify immutable config with a property.
2024-07-05Inject dependencies in repo classes (#45053)Massimiliano Culpo16-176/+317
2024-07-04containers: rm centos7 since EOL (#45049)Wouter Deconinck2-10/+0
2024-07-04spack audit packages: Fix message (#45045)Jordan Galby1-1/+1
Fix message formatting of the "virtual dependency cannot have variants" error.
2024-07-04Heuristic decays to default over time (#45023)Massimiliano Culpo2-11/+15
This modifies heuristic to decay to clingo default over time. The hope is that this helps with specs that have an optimal solution with a high penalty. Let target and compiler heuristic decay too, do not guess compiler
2024-07-03Add support for macOS Sequoia (#45018)Adam J. Stewart1-0/+1
2024-07-02ci: deprecate the --dependencies and --optimize option (#45005)Massimiliano Culpo7-644/+16