summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)AuthorFilesLines
2023-03-06compiler flags: fix multiple compilers with different flags (#35721)Greg Becker3-2/+27
Currently, if two compilers with the same spec differ on the flags, the concretizer will: 1. mix both sets of flags for the spec in the ASP program 2. error noting that the set of flags from the compiler (both of them) doesn't match the set from the lower priority compiler This PR fixes both -- only flags from the highest priority compiler with a given spec are considered.
2023-03-05windows: use `sys.platform == "win32"` instead of `is_windows` (#35640)Todd Gamblin30-147/+94
`mypy` only understands `sys.platform == "win32"`, not indirect assignments of that value to things like `is_windows`. If we don't use the accepted platform checks, `mypy` registers many Windows-only symbols as not present on Linux, when it should skip the checks for platform-specific code.
2023-03-03Polish `spack.util.environment` (#35812)Massimiliano Culpo7-336/+341
Update `spack.util.environment` to remove legacy idioms. * Remove kwargs from method signature and use a class for traces * Uppercase a few global variables * spack.util.environment: add type-hints * Improve docstrings * Fixed most style issues reported by pylint
2023-03-01Detection of Cray's slingshot detection has relied on the presence of (#35779)Brian Van Essen1-1/+1
a shared library /lib64/libcxi.so, which seems to also appear on other non-slingshot systems. This patch also checks to make sure that there is a Cray programming enviornment in /opt/cray/pe in addition to the shared library.
2023-03-01Simplify `spack help --spec` output (#35626)Adam J. Stewart1-7/+2
2023-03-01Docs: fix link to PythonPackage docs (#35725)Adam J. Stewart1-1/+1
2023-03-01Remove handling of deprecated target names (graviton) (#35537)Massimiliano Culpo1-13/+0
* Update target names for Gitlab pipelines * Remove handling of deprecated names for graviton
2023-02-24fix dump problem (#35673)Alberto Invernizzi1-1/+1
if dump file existed it was not truncating the file, resulting in a file with unaltered filesize, with the new content at the beginning, "padded" with the tail of the old content, since the new content was not enough to overwrite it.
2023-02-23colify.py: get rid of **kwargs (#35641)Todd Gamblin1-37/+62
`colify` is an old module in Spack that still uses `**kwargs` liberally. We should be more explicit. Doing this eliminates the need for many checks (can't pass the wrong arg if it isn't allowed) and makes the function documentation more clear.
2023-02-23buildcache push: ensure bool arguments for include_* (#35632)Harmen Stoppels3-3/+73
Fixes a bug introduced in 44ed0de8c077630148c213d3c7f40a8965eb6f94 where the push method of binary_distribution now takes named args include_root and include_depedencies, to avoid the **kwarg hole. But the call site wasn't update and we passed a dict of keys/values instead of arguments, which resulted in a call like this: ``` push(include_root={"include_root": True, "include_dependencies": False}) ``` This commit fixes that, and adds a test to see if we push the correct packages.
2023-02-22copy_files_to_artifacts: error -> warning (#35613)Harmen Stoppels1-4/+1
This error shows up a lot, typically it's harmless because an error happened before the source build even started, in which case we don't have build logs to copy. So, warn instead of error, cause it distracts from the actual CI error.
2023-02-22add cdash arg to source build only (#35565)Harmen Stoppels1-5/+8
2023-02-22spack build-env: error when deps are not installed (#35533)Harmen Stoppels4-2/+70
Currently we attempt to setup the build environment even when dependencies are not installed, which typically results in error while searching for libraries or executables in a dependency's prefix. With this change, we get a more user friendly error: ``` $ spack build-env perl ==> Error: Not all dependencies of perl are installed, cannot setup build environment: - qpj6dw5 perl@5.36.0%apple-clang@14.0.0+cpanm+open+shared+threads build_system=generic arch=darwin-ventura-m1 - jq2plbe ^berkeley-db@18.1.40%apple-clang@14.0.0+cxx~docs+stl build_system=autotools patches=26090f4,b231fcc arch=darwin-ventura-m1 ... $ echo $? 1 ```
2023-02-22Allow users to specify root env dir (#32836)psakievich11-29/+92
* Allow users to specify root env dir Environments managed by spack have some advantages over anonymous Environments but they are tucked away inside spack's directory tree. This PR gives users the ability to specify where the environments should live. See #32823 This is also taken as an opportunity to ensure that all references are to "managed environments", rather than "named environments". Prior to this PR some references to the latter persisted. Co-authored-by: Tom Scogland <scogland1@llnl.gov> Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com> Co-authored-by: Gregory Becker <becker33@llnl.gov>
2023-02-21Spec.satisfies should be commutative when strict=False (#35598)Harmen Stoppels2-10/+36
The call: ``` x.satisfies(y[, strict=False]) ``` is commutative, and tests non-empty intersection, whereas: ``` x.satsifies(y, strict=True) ``` is not commutative, and tests set-inclusion. There are 2 fast paths. When strict=False both self and other need to be concrete, when strict=True we can optimize when other is concrete.
2023-02-21nonexistent module concise error message (#35502)simon-Leary421-4/+10
2023-02-20Fix view support for optional Python extensions (#35489)Adam J. Stewart1-0/+3
Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
2023-02-20environment views: better, earlier error on clash (#35541)Harmen Stoppels4-9/+53
Spack generally ignores file-file projection clashes in environment views, but would eventually error when linking the `.spack` directory for two specs of the same package. This leads to obscure errors where users have no clue what the issue is and how to fix it. On top of that, the error comes very late, since it happens when the .spack dir contents are linked (which happens after everything else) This PR improves that by doing a quick check ahead of time if clashes are going to be anticipated (by simply checking for clashes in the projection of each spec's .spack metadir). If there are clashes, a human-readable error is thrown which shows two of the conflicting specs, and tells users to user unify:true, view:false, or set up custom projections.
2023-02-20Patchel shutil.copystat to avoid PermissionError on Lustre (#27247)Ben Wibking1-0/+68
2023-02-20spack ci: remove 120s db timeout since 60s is the default now (#35566)Harmen Stoppels1-8/+0
2023-02-20Revert "lib/spack/spack/store.py: Fix #28170 for padding relocation ↵Harmen Stoppels1-1/+0
(#33122)" (#35077) This reverts commit c721aab0067e127cd9db6a4eb919747814549b4f.
2023-02-20Pass `tests` argument to solver method when concretizing together (#35290)elenimath1-3/+1
to make the workaround for #29447 work with `concretizer:unify:true` option
2023-02-20Fix broken links in docs (#35582)Adam J. Stewart8-16/+15
2023-02-18Improve error handling in buildcache downloads (#35568)Harmen Stoppels6-44/+67
The checksum exception was not detailed enough and not reraised when using cache only, resulting in useless error messages. Now it dumps the file path, expected hash, computed hash, and the downloaded file summary.
2023-02-17clang/apple-clang correct c/c++ standard flags (#35062)Harmen Stoppels3-17/+83
2023-02-16Style: black 23, skip magic trailing comma (#35351)Adam J. Stewart158-1650/+367
* Style: black 23, skip magic trailing commas * isort should use same line length as black * Fix unused import * Update version of black used in CI * Update new packages * Update new packages
2023-02-16view: fix issue with non-contributing specs (#34661)Harmen Stoppels3-13/+68
Specs that did not contribute any files to an env view caused a problem where zip(specs, files grouped by prefix) got "out of sync", causing the wrong merge map to be passed to a package's `add_files_to_view`, which specifically caused an issue where *sometimes* bin/python ended up as a symlink instead of a copy. One such example is kokkos + kokkos-nvcc-wrapper, as the latter package only provides the file bin/nvcc_wrapper, which is also added to view by kokkos, causing kokkos-nvcc-wrapper to contribute 0 files. The test feels a bit contrived, but it captures the problem... pkg a is added first and has 0 files to contribute, pkg b adds a single file, and we check if pkg b receives a merge map (and a does not).
2023-02-16simplify cdash filename (#35509)Harmen Stoppels1-8/+1
2023-02-16spack buildcache create: push all deps / cleanup (#34860)Harmen Stoppels2-38/+28
2023-02-16spack uninstall: follow run/link edges on --dependents (#34058)Harmen Stoppels2-42/+44
`spack gc` removes build deps of explicitly installed specs, but somehow if you take one of the specs that `spack gc` would remove, and feed it to `spack uninstall /<hash>` by hash, it complains about all the dependents that still rely on it. This resolves the inconsistency by only following run/link type deps in spack uninstall. That way you can finally do `spack uninstall cmake` without having to remove all packages built with cmake.
2023-02-16Avoid verifying variants in default package requirements (#35037)Massimiliano Culpo3-23/+58
Default package requirements might contain variants that are not defined in each package, so we shouldn't verify them when emitting facts for the ASP solver. Account for group when enforcing requirements packages:all : don't emit facts for requirement conditions that can't apply to current spec
2023-02-16buildcache create: avoid prefix copy (#35173)Harmen Stoppels1-37/+40
2023-02-15Use the `maintainers` directive in all base classes (#35324)Adam J. Stewart5-13/+22
* Use the `maintainers` directive in all base classes * Update unit tests
2023-02-14Update cce.py (#35469)luker1-0/+5
* Update cce.py adding c++17 flag for cce * Update cce.py
2023-02-10MSBuilder/MSVC: correct toolchain ver (#35424)John W. Parent1-1/+1
#35098 added the correct extraction of toolset version for the MSVC compiler. This updates the associated method in MSBuilder to retrieve the (now correct) property.
2023-02-10Restore our ability to submit build/test results to CDash from GitLab CI ↵Zack Galbreath3-14/+36
(#35328) * Restore our ability to submit build/test results to CDash from GitLab CI * Don't use CDash upload URL as report filename
2023-02-08spack help --spec: fix indentation (#35383)Adam J. Stewart1-2/+2
2023-02-08Ensure we print the correct branch number for tutorials (#35371)Massimiliano Culpo1-4/+4
2023-02-08bindist: use append as a method, not assignable attr (#35379)Scott Wittenburg1-4/+6
2023-02-07Windows: Fix spack.bat handling of env commands (#35143)Dan Lipsa1-9/+7
This PR enables the successful execution of the spack binary cache tutorial on Windows. It assumes gnupg and file are available (they can be installed with choco). * Fix handling of args with quotes in spack.bat * `file` utility can be installed on Windows (e.g. with choco): update error message accordingly
2023-02-06Fix path handling in prefix inspections (#35318)Matthias Wolf1-1/+1
At least with ZSH, prefix inspections containing `./bin` result in a `$PREFIX/./bin` and result in strange `$PATH` handling. I.e., `module load git` will prepend `/path/to/git/./bin`, `which git` will find the right executable, but `git --version` will print the system one. Normalize the relative path to avoid this behavior. See also spack/spack#31867.
2023-02-06GenericBuilder: facilitate post-install phase test callbacks (#35314)Tamara Dahlgren1-2/+11
2023-02-05Don't use CDash upload URL as report filename (#35338)Massimiliano Culpo4-31/+55
fixes #35337
2023-02-03MSVC compiler: add platform toolset version (#35098)John W. Parent1-2/+13
2023-02-02NMake builder: fix incorrect variable reference (#34937)John W. Parent1-1/+1
2023-02-01Use the `maintainers` directive in all packages (#35201)Massimiliano Culpo3-2/+8
2023-02-01Pin black to 22.12.0 to avoid spurious style changes (#35282)Massimiliano Culpo1-1/+1
We need to sync changes on major versions with spackbot, to avoid the bot saying everything is allright and have CI failing nonetheless.
2023-01-27Add a `maintainers` directive (#35083)Massimiliano Culpo6-24/+95
fixes #34879 This commit adds a new maintainer directive, which by default extend the list of maintainers for a given package. The directive is backward compatible with the current practice of having a "maintainers" list declared at the class level.
2023-01-26Cleanup of binary text relocation (#34188)Harmen Stoppels8-484/+561
Move the relocation of binary text in its own class Drop threaded text replacement, since the current bottleneck is decompression. It would be better to parallellize over packages, instead of over files per package. A small improvement with separate classes for text replacement is that we now compile the regex in the constructor; previously it was compiled per binary to be relocated.
2023-01-26Extract functions to read spec files from different format (#35094)Massimiliano Culpo17-256/+374
This commit makes explicit the format version of the spec file we are reading from. Before there were different functions capable of reading some part of the spec file at multiple format versions. The decision was implicit, since checks were based on the structure of the JSON without ever checking a format version number. The refactor makes also explicit which spec file format is used by which database and lockfile format, since the information is stored in global mappings. To ensure we don't change the hash of old specs, JSON representations of specs have been added as data. A unit tests checks that we read the correct hash in, and that the hash stays the same when we re-serialize the spec using the most recent format version. Co-authored-by: Harmen Stoppels <me@harmenstoppels.nl>