summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)AuthorFilesLines
2023-10-18abi.py: fix typo, add type-hints (#38216)Greg Becker2-13/+20
Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2023-10-17Allow / in GitVersion (#39398)Peter Scheibel16-27/+214
This commit allows version specifiers to refer to git branches that contain forward slashes. For example, the following is valid syntax now: pkg@git.releases/1.0 It also adds a new method `Spec.format_path(fmt)` which is like `Spec.format`, but also maps unsafe characters to `_` after interpolation. The difference is as follows: >>> Spec("pkg@git.releases/1.0").format("{name}/{version}") 'pkg/git.releases/1.0' >>> Spec("pkg@git.releases/1.0").format_path("{name}/{version}") 'pkg/git.releases_1.0' The `format_path` method is used in all projections. Notice that this method also maps `=` to `_` >>> Spec("pkg@git.main=1.0").format_path("{name}/{version}") 'pkg/git.main_1.0' which should avoid syntax issues when `Spec.prefix` is literally copied into a Makefile as sometimes happens in AutotoolsPackage or MakefilePackage
2023-10-17Support `spack env activate --with-view <name> <env>` (#40549)Harmen Stoppels5-69/+114
Currently `spack env activate --with-view` exists, but is a no-op. So, it is not too much of a breaking change to make this redundant flag accept a value `spack env activate --with-view <name>` which activates a particular view by name. The view name is stored in `SPACK_ENV_VIEW`. This also fixes an issue where deactivating a view that was activated with `--without-view` possibly removes entries from PATH, since now we keep track of whether the default view was "enabled" or not.
2023-10-16Use string representation of deptypes for concrete specs (#40566)Massimiliano Culpo1-1/+5
2023-10-15spack checksum: handle all versions dropped better (#40530)Harmen Stoppels3-3/+21
* spack checksum: fix error when all versions are dropped * add test
2023-10-13spack checksum: improve interactive filtering (#40403)Harmen Stoppels6-55/+352
* spack checksum: improve interactive filtering * fix signature of executable * Fix restart when using editor * Don't show [x version(s) are new] when no known versions (e.g. in spack create <url>) * Test ^D in test_checksum_interactive_quit_from_ask_each * formatting * colorize / skip header on invalid command * show original total, not modified total * use colify for command list * Warn about possible URL changes * show possible URL change as comment * make mypy happy * drop numbers * [o]pen editor -> [e]dit
2023-10-13Expand multiple build systems section (#39589)Harmen Stoppels1-51/+102
Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2023-10-13Better error message when wrong platform is used (#40492)Massimiliano Culpo1-1/+2
fixes #40299
2023-10-13containerize: update docs to activate env before using container templates ↵Matthew Chan1-0/+7
(#40493)
2023-10-12modules:prefix_inspections: allow empty dict (#40485)Harmen Stoppels1-2/+2
Currently ``` modules: prefix_inspections:: {} ``` gives you the builtin defaults instead of no mapping.
2023-10-12build(deps): bump python-levenshtein in /lib/spack/docs (#40461)dependabot[bot]1-1/+1
Bumps [python-levenshtein](https://github.com/maxbachmann/python-Levenshtein) from 0.22.0 to 0.23.0. - [Release notes](https://github.com/maxbachmann/python-Levenshtein/releases) - [Changelog](https://github.com/maxbachmann/python-Levenshtein/blob/main/HISTORY.md) - [Commits](https://github.com/maxbachmann/python-Levenshtein/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: python-levenshtein 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>
2023-10-12Remove deprecated "extra_instructions" option for containers (#40365)Massimiliano Culpo4-46/+1
2023-10-11buildcache: Tell servers not to cache index or hash (#40339)Scott Wittenburg1-2/+2
2023-10-11cmake: drop CMAKE_STATIC_LINKER_FLAGS (#40423)Victor Brunini2-4/+3
Because those end up being passed to ar which does not understand linker arguments. This was making ldflags largely unusuable for statically linked cmake packages.
2023-10-11Update bootstrap buildcache to support Python 3.12 (#40404)Massimiliano Culpo4-5/+5
* Add support for Python 3.12 * Use optimized build of clingo
2023-10-11spider: respect <base> tag (#40443)Harmen Stoppels1-8/+20
2023-10-11build(deps): bump mypy from 1.5.1 to 1.6.0 in /lib/spack/docs (#40424)dependabot[bot]1-1/+1
Bumps [mypy](https://github.com/python/mypy) from 1.5.1 to 1.6.0. - [Commits](https://github.com/python/mypy/compare/v1.5.1...v1.6.0) --- 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>
2023-10-11Update legacy `.format()` calls to fstrings in installer.py (#40426)Alec Scott1-152/+132
2023-10-11spack buildcache: fix a typo in a function call (#40446)Massimiliano Culpo1-3/+3
fixes #40415
2023-10-10More helpful error when patch lookup fails (#40379)Harmen Stoppels2-10/+21
2023-10-09unparse: drop python 3.3 remnants (#40331)Harmen Stoppels1-20/+8
2023-10-09docs: update Spack prerequisites (#40381)Harmen Stoppels1-2/+1
2023-10-09build(deps): bump python-levenshtein in /lib/spack/docs (#40220)dependabot[bot]1-1/+1
Bumps [python-levenshtein](https://github.com/maxbachmann/python-Levenshtein) from 0.21.1 to 0.22.0. - [Release notes](https://github.com/maxbachmann/python-Levenshtein/releases) - [Changelog](https://github.com/maxbachmann/python-Levenshtein/blob/main/HISTORY.md) - [Commits](https://github.com/maxbachmann/python-Levenshtein/compare/v0.21.1...v0.22.0) --- updated-dependencies: - dependency-name: python-levenshtein 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>
2023-10-09racket packages: fix typo after multiple build systems support (#40088)Thomas Dickerson1-1/+1
2023-10-09parser: use non-capturing groups (#40373)Harmen Stoppels1-23/+23
2023-10-07Remove warning for custom module configuration, when no module is enabled ↵Massimiliano Culpo3-47/+2
(#40358) The warning was added in v0.20 and was slated for removal in v0.21
2023-10-06VersionRange: improve error message for empty range (#40345)Harmen Stoppels4-4/+15
2023-10-06unparse: drop python 2 remnants (#40329)Harmen Stoppels1-40/+0
2023-10-06Make "minimal" the default duplicate strategy (#39621)Massimiliano Culpo8-97/+2930
* Allow branching out of the "generic build" unification set For cases like the one in https://github.com/spack/spack/pull/39661 we need to relax rules on unification sets. The issue is that, right now, nodes in the "generic build" unification set are unified together with their build dependencies. This was done out of caution to avoid the risk of circular dependencies, which would ultimately cause a very slow solve. For build-tools like Cython, however, the build dependencies is masked by a long chain of "build, run" dependencies that belong in the "generic build" unification space. To allow splitting on cases like this, we relax the rule disallowing branching out of the "generic build" unification set. * Fix issue with pure build virtual dependencies Pure build virtual dependencies were not accounted properly in the list of possible virtuals. This caused some facts connecting virtuals to the corresponding providers to not be emitted, and in the end lead to unsat problems. * Fixed a few issues in packages py-gevent: restore dependency on py-cython@3 jsoncpp: fix typo in build dependency ecp-data-vis-sdk: update spack.yaml and cmake recipe py-statsmodels: add v0.13.5 * Make dependency on "blt" of type "build"
2023-10-06python: add 3.12.0 (but keep 3.11 preferred) (#40282)Harmen Stoppels1-1/+8
2023-10-05unparse: drop python 3.4 remnants (#40333)Harmen Stoppels1-15/+0
2023-10-04Improve build isolation in PythonPipBuilder (#40224)Harmen Stoppels1-1/+99
We run pip with `--no-build-isolation` because we don't wanna let pip install build deps. As a consequence, when pip runs hooks, it runs hooks of *any* package it can find in `sys.path`. For Spack-built Python this includes user site packages -- there shouldn't be any system site packages. So in this case it suffices to set the environment variable PYTHONNOUSERSITE=1. For external Python, more needs to be done, cause there is no env variable that disables both system and user site packages; setting the `python -S` flag doesn't work because pip runs subprocesses that don't inherit this flag (and there is no API to know if -S was passed) So, for external Python, an empty venv is created before invoking pip in Spack's build env ensures that pip can no longer see anything but standard libraries and `PYTHONPATH`. The downside of this is that pip will generate shebangs that point to the python executable from the venv. So, for external python an extra step is necessary where we fix up shebangs post install.
2023-10-03ci: Change how job names appear in gitlab (#39963)Scott Wittenburg2-38/+13
2023-10-03build(deps): bump urllib3 from 2.0.5 to 2.0.6 in /lib/spack/docs (#40286)dependabot[bot]1-1/+1
Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.0.5 to 2.0.6. - [Release notes](https://github.com/urllib3/urllib3/releases) - [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst) - [Commits](https://github.com/urllib3/urllib3/compare/v2.0.5...2.0.6) --- updated-dependencies: - dependency-name: urllib3 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>
2023-10-03Buildcache tarballs with rootfs structure (#39341)Harmen Stoppels2-73/+162
Two changes in this PR: 1. Register absolute paths in tarballs, which makes it easier to use them as container image layers, or rootfs in general, outside of Spack. Spack supports this already on develop. 2. Assemble the tarfile entries "by hand", which has a few advantages: 1. Avoid reading `/etc/passwd`, `/etc/groups`, `/etc/nsswitch.conf` which `tar.add(dir)` does _for each file it adds_ 2. Reduce the number of stat calls per file added by a factor two, compared to `tar.add`, which should help with slow, shared filesystems where these calls are expensive 4. Create normalized `TarInfo` entries from the start, instead of letting Python create them and patching them after the fact 5. Don't recurse into subdirs before processing files, to avoid keeping nested directories opened. (this changes the tar entry order slightly, it's like sorting by `(not is_dir, name)`.
2023-10-02buildcache: ignore errors of newer buildcache version (#40279)Harmen Stoppels1-2/+2
Currently buildcaches are forward incompatible in an annoying way: spack errors out when trying to use them. With this change, you just get a warning.
2023-10-02Spack python 3.12: PEP 695 unparse support (#40155)Harmen Stoppels1-0/+28
2023-10-01docs: Replace package list with packages.spack.io (#40251)Todd Gamblin8-86/+30
For a long time, the docs have generated a huge, static HTML package list. It has some disadvantages: * It's slow to load * It's slow to build * It's hard to search We now have a nice website that can tell us about Spack packages, and it's searchable so users can easily find the one or two packages out of 7400 that they're looking for. We should link to this instead of including a static package list page in the docs. - [x] Replace package list link with link to packages.spack.io - [x] Remove `package_list.html` generation from `conf.py`. - [x] Add a new section for "Links" to the docs. - [x] Remove docstring notes from contribution guide (we haven't generated RST for package docstrings for a while) - [x] Remove referencese to `package-list` from docs.
2023-09-29Windows: detect all available SDK versions (#39823)John W. Parent1-28/+35
Currently, Windows SDK detection will only pick up SDK versions related to the current version of Windows Spack is running on. However, in some circumstances, we want to detect other version of the SDK, for example, for compiling on Windows 11 for Windows 10 to ensure an API is compatible with Win10.
2023-09-29Cray manifest: compiler handling fixes (#40061)Peter Scheibel5-131/+215
* Make use of `prefix` in the Cray manifest schema (prepend it to the relative CC etc.) - this was a Spack error. * Warn people when wrong-looking compilers are found in the manifest (i.e. non-existent CC path). * Bypass compilers that we fail to add (don't allow a single bad compiler to terminate the entire read-cray-manifest action). * Refactor Cray manifest tests: module-level variables have been replaced with fixtures, specifically using the `test_platform` fixture, which allows the unit tests to run with the new concretizer. * Add unit test to check case where adding a compiler raises an exception (check that this doesn't prevent processing the rest of the manifest).
2023-09-29Print error when missing git (#40254)Jordan Galby1-1/+5
Like a missing curl.
2023-09-29Don't drop build deps on overwrite install (#40252)Harmen Stoppels2-4/+26
If you `spack install x ^y` where `y` is a pure build dep of `x`, and then uninstall `y`, and then `spack install --overwrite x ^y`, the build fails because `y` is not re-installed. Same can happen when you install a develop spec, run `spack gc`, modify sources, and install again; develop specs rely on overwrite install to work correctly.
2023-09-29Test package detection in a systematic way (#18175)Massimiliano Culpo10-23/+457
This PR adds a new audit sub-command to check that detection of relevant packages is performed correctly in a few scenarios mocking real use-cases. The data for each package being tested is in a YAML file called detection_test.yaml alongside the corresponding package.py file. This is to allow encoding detection tests for compilers and other widely used tools, in preparation for compilers as dependencies.
2023-09-28Partial removal of circular dependencies between `spack` and `llnl` (#40090)Massimiliano Culpo30-258/+297
Modifications: - [x] Move `spack.util.string` to `llnl.string` - [x] Remove dependency of `llnl` on `spack.error` - [x] Move path of `spack.util.path` to `llnl.path` - [x] Move `spack.util.environment.get_host_*` to `spack.spec`
2023-09-28Use st_nlink in hardlink tracking (#39328)Harmen Stoppels2-11/+12
Only add potential hardlinks to a set/dict, instead of each file. This should be much cheaper, since hardlinks are very rare.
2023-09-28Support optional vars script arguments (#40064)Brian Vanderwende1-1/+6
2023-09-26spack --profile: dump to stderr (#40209)Harmen Stoppels1-1/+1
2023-09-24build(deps): bump urllib3 from 2.0.4 to 2.0.5 in /lib/spack/docs (#40119)dependabot[bot]1-1/+1
Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.0.4 to 2.0.5. - [Release notes](https://github.com/urllib3/urllib3/releases) - [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst) - [Commits](https://github.com/urllib3/urllib3/compare/2.0.4...v2.0.5) --- updated-dependencies: - dependency-name: urllib3 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>
2023-09-22Remove distutils dependency in Spack (#40153)Harmen Stoppels1-3/+2
* msvc.py: don't import distutils Introduced in #27021, makes Spack forward incompatible with Python. The module was already deprecated at the time of the PR. * update spack package
2023-09-22Add support for macOS Sonoma (#40115)Adam J. Stewart1-0/+1