summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)AuthorFilesLines
2024-08-26`ci generate`: don't warn when no cdash config (#46004)Todd Gamblin1-1/+2
Right now if you run `spack ci generate` you get a warning about CDash credentials even if there's no CDash configuration specified. We should only warn if there was actually a CDash config. Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2024-08-26compilers: avoid redundant fs operations and cache (#46031)Harmen Stoppels2-13/+17
2024-08-24variant.py: extract spec bits into spec.py (#45941)Harmen Stoppels5-166/+156
2024-08-24PythonExtension: use different bin dir on Windows (#45427)John W. Parent1-1/+7
2024-08-24mirror: fetch by digest (#45809)Harmen Stoppels8-182/+173
Source mirrors store entries by digest and add a human readable alias of the form 'name-version'. If no digest is available, the alias is used as the primary storage location. Spack erroneously fetches by alias when the digest path does not exist. This is problematic if `version(..., sha256=...)` changes in package.py, and the mirror is populated with the old shasum. That would result in an error when a digest is available, but in case of git versions with a modified commit sha, the wrong sources would be fetched without error. With this PR, only the digest path is used, not the alias, in case a digest is available. This is also a small performance optimization, as the number of request is halved for mirrors that don't contain the sources. Further, for git sources the tag was used as a digest, but this is a moving target. Only commit sha is used now. Also whenever the alias already existed, Spack used to keep it in place when updating the mirror cache, which means that aliases would always point to outdated mirror entries whenever digests are modified. With this PR the alias is moved in place. Lastly, fix a recent regression where `Stage.disable_mirrors` disabled mirrors but not the local download cache, which was the intention.
2024-08-23Substitute `__import__` with `importlib.import_module` (#45965)Massimiliano Culpo8-49/+15
2024-08-23spack create: add depends_on(<lang>) statements (#45296)Harmen Stoppels4-106/+236
2024-08-23Add missing MultiMethodMeta metaclass in builders (#45879)Harmen Stoppels10-280/+277
* Add missing MultiMethodMeta metaclass in builders and remove the Python 2 fallback option in favor of hard errors to catch similar issues going forward. The fallback option can cause about 10K stat calls due to use of `realpath` in the inspect module, depending on how deep Spack itself is nested in the file system, which is ... undesirable. * code shuffling to avoid circular import * more reshuffling * move reserved variant names into variants module
2024-08-22Add a new audit to find missing package.py files (#45868)Massimiliano Culpo1-1/+28
* Add a new audit to find missing package.py files * Remove directory without package.py
2024-08-22Windows: port tests for mirror/blame (#45259)Nicole C.2-8/+6
2024-08-22Make spack compiler find use external find (#45784)Massimiliano Culpo16-1107/+336
so that there is no duplicate detection logic for compilers
2024-08-21Windows: Port icu4c; define cxx std flags for MSVC (#45547)John W. Parent1-0/+24
* Adds an MSBuild system + Builder to the icu4c package * Adds custom install method as MSBuild system does not vendor an install target * The cxxstd variant is not supported on Windows (there are no config options you use to tell the build system what cxx standard to build against), so the variant definition was updated to occur everywhere except Windows Also, this commit defines the c/cxx..._flag properties of the MSVC compiler (although they are not used by `icu4c` and not strictly necessary to bundle with this PR).
2024-08-20spack bootstrap status --dev: function call for new interface (#45822)Greg Becker1-1/+1
2024-08-20Increase min version for sparse_checkout (#45818)psakievich2-2/+4
* Increase min version for sparse_checkout * Update git_fetch.py * style
2024-08-20Unify url and oci buildcache push code paths (#45776)Harmen Stoppels10-142/+206
2024-08-19build_environment: explicitly disable ccache if disabled (#45275)Harmen Stoppels1-1/+4
2024-08-19Simplify URLFetchStrategy (#45741)Harmen Stoppels10-233/+93
2024-08-19Remove deprecated `--safe-only` in spack version cmd (#45765)Alec Scott2-19/+3
2024-08-17util/web.py: parse new GitLab JS dropdown links (#45764)Wouter Deconinck3-4/+31
Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
2024-08-16include_concrete: read from older env formats properly (#45766)Greg Becker3-39/+43
* include_concrete: read from older env formats properly * spack env rm: fix logic for checking env includes * regression test Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2024-08-16Windows: fix stage cleaning for long paths (#45786)James Smillie1-0/+6
Paths over 260 characters in length are not handled by `shutil.rmtree` unless they use the extended-length path syntax (using a prefix of "\\?\"). This fixes an issue where stage cleaning fails when paths in a stage exceed the normal 260-character limit. This indicates that other parts of the codebase should be examined/ refactored to handle long paths.
2024-08-16Revert "Change environment modifications to escape with double quotes ↵Harmen Stoppels2-45/+16
(#36789)" (#42780) This reverts commit 690394fabc29908bbc4188ec29fd187fbb3ba13b, as it causes arbitrary code execution.
2024-08-16oci: support --only=package (#45775)Harmen Stoppels3-36/+51
Previously `spack buildcache push --only=package` errored in the OCI case, but it's been requested that OCI can be used as pure storage w/o the need for runnable container images. This commit makes it so that 1. manifests refer only to runtime dependencies that were selected to be pushed 2. failure to upload a blob among the selected specs does not prevent a manifest/tag to be created for dependents: they just don't refer to the missing blob as a layer/dependency This fixes the following issues: 1. dependents of non-redistributable specs can now be pushed to oci build caches without error 2. failure to upload one tarball does not cause cascading failures for dependents whose tarballs do upload succesfully -- so it's better best-effort behavior 3. for some people uploading with deps caused a massive amount of fetches of their manifests (which certain registries count as a download of an image, even though their layers are not fetched) -- being able to specify --only=package reduces the number of fetches.
2024-08-16stage: provide mirrors in constructor (#45792)Harmen Stoppels6-94/+83
Stage objects create mirrors ad-hoc from current config. - There is no way to prevent mirrors from being used - There is no way to restrict mirrors to source/binary, which is of course context dependent. - Stage is also used in build caches, where iterating over mirrors is already implemented differently, and wouldn't work anyways cause it's source only, and in particular it makes no sense for OCI build caches. This commit: 1. Injects the sensible mirrors into the stage object from contexts where it is relevant 2. Separates mirrors from cache, so that w/o mirrors download cache can still be used
2024-08-16Remove "test_foreground_background"Massimiliano Culpo1-345/+0
2024-08-16Skip test_foreground_background + other minor cleanupsMassimiliano Culpo10-56/+24
The test_foreground_background unit test has been marked xfail for a while, meaning: - Nobody looks at the results of the test - It still runs every time That test happens to hang frequently on some Apple M1 I have access to, so here I mark it as skip. Also went through other xfailing and skipped tests, and applied minor changes.
2024-08-16Clean up `test/cmd/ci.py` (#45774)Massimiliano Culpo2-1036/+603
* Use absolute paths instead of https:// fake mirrors (this speed-up tests by avoiding requests) * Add a fixture to gather in a single place code that is copy/pasted in a lot of tests * General clean-up of tests and repeated code Co-authored-by: Harmen Stoppels <me@harmenstoppels.nl>
2024-08-15Update archspec to v0.2.5-dev (7e6740012b897ae4a950f0bba7e9726b767e921f) ↵Massimiliano Culpo5-37/+168
(#45721)
2024-08-15Add options for sparse checkout in GitFetcher (#45473)psakievich6-19/+225
* Add options for sparse checkout in GitFetcher Newer versions of git have a beta feature called sparse checkout that allow users to check out a portion of a large repo. This feature will be ideal for monolithic repo projects that want to model their infrastructure via spack. This PR implements an addition to the GitFetcher that allows users to add a `git_sparse_paths` attribute to package classes or versions which will then use sparse checkout on those directories/files for the package. * Style * Split git clone into multiple functions * Add sparse-checkout impl * Internalize src clone functions * Docs * Adding sparse clone test * Add test for partial clone * [@spackbot] updating style on behalf of psakievich * Small fixes * Restore default branch status * Fix attributes for package * Update lib/spack/docs/packaging_guide.rst Co-authored-by: Matthew Mosby <44072882+mdmosby@users.noreply.github.com> * Extend unit test to multiple git versions * style --------- Co-authored-by: psakievich <psakievich@users.noreply.github.com> Co-authored-by: Matthew Mosby <44072882+mdmosby@users.noreply.github.com>
2024-08-14spack info: use spec fullname (#45753)Greg Becker1-1/+1
2024-08-14OneapiPackage: do not use getpass.getuser (#45727)Greg Becker1-3/+3
* OneapiPackage: do not use getpass.getuser
2024-08-14SpecHashDescriptor: better repr in debugger (#45739)Massimiliano Culpo1-0/+6
2024-08-14spack buildcache push: parallel in general (#45682)Harmen Stoppels14-803/+833
Make spack buildcache push for the non-oci case also parallel, and --update-index more efficieny
2024-08-14Optimize marshaling of Repo and RepoPath (#45742)Massimiliano Culpo3-19/+62
When sending Repo and RepoPath over to a child process, we go through a marshaling procedure with pickle. The default behavior for these classes is highly inefficient, as it serializes a lot of specs that can just be reconstructed on the other end of the pipe. Here we write optimized procedures to __reduce__ both classes.
2024-08-14Micro-optimize finding executables (#45740)Massimiliano Culpo2-11/+8
2024-08-14Add schema for compiler options in packages.yaml (#45738)Massimiliano Culpo2-24/+35
2024-08-14Show underlying errors on fetch failure (#45714)Harmen Stoppels9-240/+198
- unwrap/flatten nested exceptions - improve tests - unify curl lookup
2024-08-13Bugfix: allow test_* build-time and stand-alone tests (#45699)Tamara Dahlgren1-0/+4
2024-08-13Fix a bug with automatic tag detection (#45696)Massimiliano Culpo3-11/+30
Extracted from #45638 When adding the "detectable" tag to a package class that has the "tag" attribute inherited from a base class, we need to copy it to avoid modifying the base class.
2024-08-13spack buildcache push: best effort (#45631)Harmen Stoppels7-171/+323
"spack buildcache push" for partially installed environments pushes all it can by default, and only dumps errors towards the end. If --fail-fast is provided, error out before pushing anything if any of the packages is uninstalled oci build caches using parallel push now use futures to ensure pushing goes in best-effort style.
2024-08-12debug: Update cmd and test for Windows (#45309)Nicole C.2-3/+3
* debug: Update cmd and test for Windows * Add comment tar options not supported by Win tar
2024-08-12deal with TimeoutError from ssl.py (#45683)Harmen Stoppels4-48/+30
2024-08-12buildcache: fix hard-coded, outdated layout version (#45645)Harmen Stoppels1-1/+1
2024-08-10Remove the old concretizer (#45215)Massimiliano Culpo35-1899/+286
The old concretizer is still used to bootstrap clingo from source. If we switch to a DAG model where compilers are treated as nodes, we need to either: 1. fix the old concretizer to support this (which is a lot of work and possibly research), or 2. bootstrap `clingo` without the old concretizer. This PR takes the second approach and gets rid of the old concretizer code. To bootstrap `clingo`, we store some concrete spec prototypes as JSON, select one according to the coarse-grained system architecture, and tweak them according to the current host. The old concretizer and related dead code are removed. In particular, this removes `Spec.normalize()` and related methods, which were used in many unit-tests to set up the test context. The tests have been updated not to use `normalize()`. - [x] Bootstrap clingo concretization based on a JSON file - [x] Bootstrap clingo *before* patchelf - [x] Remove any use of the old concretizer, including: * Remove only_clingo and only_original fixtures * Remove _old_concretize and _new_concretize * Remove _concretize_together_old * Remove _concretize_together_new * Remove any use of `SPACK_TEST_SOLVER` * Simplify CI jobs - [x] ensure bootstrapping `clingo` works on on Darwin and Windows - [x] Raise an intelligible error when a compiler is missing - [x] Ensure bootstrapping works on FreeBSD - [x] remove normalize and related methods Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2024-08-09Concretizer should respect namespace of reused specs (#45538)Greg Becker3-30/+95
* concretize.lp: improve coverage of internal_error facts * concretizer: track namespaces for reused packages * regression test
2024-08-09Remove execution permission from setup-env.sh (#45641)Dominic Hofer1-4/+0
`setup-env.sh` is meant to be sourced, not executed directly. By revoking execution permissions, users who accidentally execute the script will receive an error instead of seeing no effect. * Remove execution permission from `setup-env.sh` and friends * Don't make output file executable in `spack commands --update-completion` --------- Co-authored-by: Todd Gamblin <tgamblin@llnl.gov> Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2024-08-08Remove `Compiler.PrgEnv*` attributes (#45615)Massimiliano Culpo9-30/+1
2024-08-08Compiler wrapper: add env var to pass vcheck flags (#44588)Dom Heinzeller5-37/+110
Fixes #43494 Add a set of environment variables SPACK_ALWAYS_CFLAGS (etc.) that are always applied by the compiler wrapper. Unlike SPACK_CFLAGS, for example, these will also be applied to version checks (both SPACK_CFLAGS and SPACK_ALWAYS_CFLAGS will be applied to the other invocation modes like ccld etc.). Using this new functionality, the classic Intel and oneAPI compilers are updated to pass compiler flags that disable warning messages when newer versions are invoked via their older binary names (these warnings were also generated for version checks, hence the need for a new wrapper variable). --------- Co-authored-by: Peter Josef Scheibel <scheibel1@llnl.gov>
2024-08-07Fix SIP build system installing files into python-venv (#45360)Jordan Galby1-0/+4
For example: spack install py-pyqt5 or py-pyqt6 would install pylupdate5 pyrcc5 and pyuic5 into in python-venv's install prefix. Fix https://github.com/spack/spack/issues/45359
2024-08-06Fix spack url stats (#45584)Gavin John1-1/+1