summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)AuthorFilesLines
2024-10-12Fix splicing related unit tests (#46914)Massimiliano Culpo3-5/+7
Some assertion are not testing DAG invariants, and they are passing only because of the simple structure of the builtin.mock repository on develop. Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2024-10-11libunistring: 1.2 needs std=c18 for icc, add icc C++ flags update (#37607)Stephen Sachs2-0/+12
2024-10-10Installer: rewire spliced specs via RewireTask (#39136)Nathan Hanford17-371/+872
This PR allows users to configure explicit splicing replacement of an abstract spec in the concretizer. concretizer: splice: explicit: - target: mpi replacement: mpich/abcdef transitive: true This config block would mean "for any spec that concretizes to use mpi, splice in mpich/abcdef in place of the mpi it would naturally concretize to use. See #20262, #26873, #27919, and #46382 for PRs enabling splicing in the Spec object. This PR will be the first place the splice method is used in a user-facing manner. See https://spack.readthedocs.io/en/latest/spack.html#spack.spec.Spec.splice for more information on splicing. This will allow users to reuse generic public binaries while splicing in the performant local mpi implementation on their system. In the config file, the target may be any abstract spec. The replacement must be a spec that includes an abstract hash `/abcdef`. The transitive key is optional, defaulting to true if left out. Two important items to note: 1. When writing explicit splice config, the user is in charge of ensuring that the replacement specs they use are binary compatible with whatever targets they replace. In practice, this will likely require either specific knowledge of what packages will be installed by the user's workflow, or somewhat more specific abstract "target" specs for splicing, to ensure binary compatibility. 2. Explicit splices can cause the output of the concretizer not to satisfy the input. For example, using the config above and consider a package in a binary cache `hdf5/xyzabc` that depends on mvapich2. Then the command `spack install hdf5/xyzabc` will instead install the result of splicing `mpich/abcdef` into `hdf5/xyzabc` in place of whatever mvapich2 spec it previously depended on. When this occurs, a warning message is printed `Warning: explicit splice configuration has caused the the concretized spec {concrete_spec} not to satisfy the input spec {input_spec}". Highlighted technical details of implementation: 1. This PR required modifying the installer to have two separate types of Tasks, `RewireTask` and `BuildTask`. Spliced specs are queued as `RewireTask` and standard specs are queued as `BuildTask`. Each spliced spec retains a pointer to its build_spec for provenance. If a RewireTask is dequeued and the associated `build_spec` is neither available in the install_tree nor from a binary cache, the RewireTask is requeued with a new dependency on a BuildTask for the build_spec, and BuildTasks are queued for the build spec and its dependencies. 2. Relocation is modified so that a spack binary can be simultaneously installed and rewired. This ensures that installing the build_spec is not necessary when splicing from a binary cache. 3. The splicing model is modified to more accurately represent build dependencies -- that is, spliced specs do not have build dependencies, as spliced specs are never built. Their build_specs retain the build dependencies, as they may be built as part of installing the spliced spec. 4. There were vestiges of the compiler bootstrapping logic that were not removed in #46237 because I asked alalazo to leave them in to avoid making the rebase for this PR harder than it needed to be. Those last remains are removed in this PR. Co-authored-by: Nathan Hanford <hanford1@llnl.gov> Co-authored-by: Gregory Becker <becker33@llnl.gov> Co-authored-by: Tamara Dahlgren <dahlgren1@llnl.gov>
2024-10-10cuda: add v12.6.2 (#46864)pauleonix1-3/+3
* cuda: Add 12.6.2 * Update cuda build system - Remove gcc@6 conflict that was only a deprecation (probably has be added again with cuda@13) - Update cuda_arch support by CUDA version - Kepler support has ended with cuda@12 - Recently added 90a Hopper "experimental" features architecture was missing the dependency on cuda@12:
2024-10-10CMake: Improve incremental build speed. (#46878)psakievich1-0/+7
* CMake: Improve incremental build speed. CMake automatically embeds an updated configure step into make/ninja that will be called during the build phase. By default if a `CMakeCache.txt` file exists in the build directory CMake will use it and this + `spec.is_develop` is sufficient evidence of an incremental build. This PR removes duplicate work/expense from CMake packages when using `spack develop`. * Update cmake.py * [@spackbot] updating style on behalf of psakievich * Update cmake.py meant self not spec... --------- Co-authored-by: psakievich <psakievich@users.noreply.github.com>
2024-10-09Environment.clear: ensure clearing is passed through to manifest (#46880)Greg Becker2-0/+41
* Environment.clear: ensure clearing is passed through to manifest * test/cmd/env: make test_remove_commmand round-trip to disk * cleanup vestigial variables
2024-10-09python: rework how we compute the "command" property (#46850)Massimiliano Culpo1-0/+1
Some Windows Python installations may store the Python exe in Scripts/ rather than the base directory. Update `.command` to search in both locations on Windows. On all systems, the search is now done recursively from the search root: on Windows, that is the base install directory, and on other systems it is bin/.
2024-10-08Fix relocating MachO binary, when store projection changes (#46840)Massimiliano Culpo2-49/+49
* Remove "modify_object_macholib" According to documentation, this function is used when installing Mach-O binaries on linux. The implementation seems questionable at least, and the code seems to be never hit (Spack currently doesn't support installing Mach-O binaries on linux). * Fix relocation on macOS, when store projection changes --------- Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2024-10-07Windows/Testing: enable `spack view` tests on Windows (#46335)James Smillie3-9/+30
Enable tests for symlink-based views (this works with almost no modifications to the view logic). View logic is not yet robust for hardlink/junction-based views, so those are disabled for now (both in the tests and as subcommands to `spack view`).
2024-10-07Qt package: Add Windows Port (#46788)John W. Parent1-0/+11
Also adds support for Paraview and CMake to build with Qt support on Windows. The remaining edits are to enable building of Qt itself on Windows: * Several packages needed to update `.libs` to properly locate libraries on Windows * Qt needed a patch to allow it to build using a Python with a space in the path * Some Qt dependencies had not been ported to Windows yet (e.g. `harfbuzz` and `lcms`) This PR does not provide a sufficient GL for Qt to use Qt Quick2, as such Qt Quick2 is disabled on the Windows platform by this PR. --------- Co-authored-by: Dan Lipsa <dan.lipsa@kitware.com>
2024-10-07Bugfix/Installer: properly track task queueing (#46293)Tamara Dahlgren4-64/+121
* Bugfix/Installer: properly track task queueing * Move ordinal() to llnl.string; change time to attempt * Convert BuildTask to use kwargs (after pkg); convert STATUS_ to BuildStats enum * BuildTask: instantiate with keyword only args after the request * Installer: build request is required for initializing task * Installer: only the initial BuildTask cannnot have status REMOVED * Change queueing check * ordinal(): simplify suffix determination [tgamblin] * BuildStatus: ADDED -> QUEUED [becker33] * BuildTask: clarify TypeError for 'installed' argument
2024-10-04`gc`: restrict to specific specs (#46790)Todd Gamblin2-1/+23
`spack gc` has so far been a global or environment-specific thing. This adds the ability to restrict garbage collection to specific specs, e.g. if you *just* want to get rid of all your unused python installations, you could write: ```console spack gc python ``` - [x] add `constraint` arg to `spack gc` - [x] add a simple test Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2024-10-04re2c: rework package to use multiple build systems (#46748)Massimiliano Culpo7-7/+7
Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2024-10-03Better docs and typing for `_setup_pkg_and_run` (#46709)Todd Gamblin1-8/+52
There was a bit of mystery surrounding the arguments for `_setup_pkg_and_run`. It passes two file descriptors for handling the `gmake`'s job server in child processes, but they are unsed in the method. It turns out that there are good reasons to do this -- depending on the multiprocessing backend, these file descriptors may be closed in the child if they're not passed directly to it. - [x] Document all args to `_setup_pkg_and_run`. - [x] Document all arguments to `_setup_pkg_and_run`. - [x] Add type hints for `_setup_pkg_and_run`. - [x] Refactor exception handling in `_setup_pkg_and_run` so it's easier to add type hints. `exc_info()` was problematic because it *can* return `None` (just not in the context where it's used). `mypy` was too dumb to notice this. Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2024-10-03Stand-alone testing: remove deprecated methods (#45752)AcriusWinter15-475/+224
* Stand-alone testing: remove deprecated methods * audit: replace deprecated test method checks for test callbacks (AcriusWinter) * install_test: replace deprecated with new test method name starts (AcriusWinter) * package_base: removed deprecated test methods (AcriusWinter) * test/package_class: remove deprecated test methods (AcriusWinter) * test/reporters: remove deprecated test methods (AcriusWinter) * reporters/extract: remove deprecated test-related methods (AcriusWinter) * py-test-callback: rename test in callbacks and output (AcriusWinter) * reporters/extract: remove deprecated expected failure output capture (AcriusWinter) * stand-alone test cleanup: f-string, remove deprecation warning, etc. (AcriusWinter) * stand-alone tests: f-string fix and remove unused imports (AcriusWinter) * package_base: finish removing the rest of deprecated run_test method (AcriusWinter) * py-test-callback: remove stand-alone test method (AcriusWinter) * package_base: remove now unused imports (AcriusWinter) * Python: test_imports replaces test (tldahlgren) * mptensor, trivial-smoke-test: replace deprecated cache_extra_test_sources method (tldahlgren) * trivial-smoke-test: replace deprecated install_test_root method (tldahlgren) * docs: update perl and scons package's test methods (tldahlgren) * builder: remove deprecated test() method (tldahlgren) * Update legion and mfem test data for stand-alone tests (tldahlgren) * py-test-callback: restore the test method * Audit/stand-alone testing: Fix and added stand-alone test audit checks - fix audit failure message for build-time test callback check - remove empty test method check during stand-alone testing - change build-time test callback check to package_properties - add test method docstring audit check and mock fail-test-audit-docstring pkg - add test method implementation audit check and mock fail-test-audit-impl pkg - add new mock packages to test_package_audits and test_test_list_all * audits: loosen docstring content constraints * Add missing test method docstring * py-test-callback: resolve builder issues * Audits: Add checks for use of deprecated stand-alone test methods; improve output for other test-related checks * Fix style issues * test_test_list_all: add new fail-test-audit-deprecated package --------- Signed-off-by: Tamara Dahlgren <dahlgren1@llnl.gov> Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com>
2024-10-02Do not fail noop jobs in Spack CI (#46713)kwryankrattiger1-1/+3
2024-10-02aspell_dict: remove unused import (#46716)Harmen Stoppels1-1/+0
2024-10-02GoPackage: fix attributes to allow for custom build_directory values (#46707)Alec Scott1-2/+13
2024-10-02cuda: add conflict for aarch64 with gcc-13.2.0 and cuda@12.4 (#46694)Andrew W Elble1-0/+5
https://github.com/spack/spack/pull/39666#issuecomment-2377609263
2024-10-02Revert "`cc`: ensure that RPATHs passed to linker are unique" (#46712)Harmen Stoppels2-175/+136
* Revert "`cc`: ensure that RPATHs passed to linker are unique" This reverts commit 2613a14c43b11ab92181bdd7ba57cd5b99f128a8. * Revert "`cc`: simplify ordered list handling" This reverts commit a76a48c42e8d6657f9dcb0500bff574651f317d9.
2024-10-01Docs: environment update (#44087)Tamara Dahlgren3-124/+140
Updated the terminology for the two types of environments to be consistent with that used in the tutorial for the last three years. Additionally: * changed 'anonymous' to 'independent in environment command+test for consistency.
2024-10-01build_environment: small cleanup and add todo comments (#46687)Harmen Stoppels1-51/+44
2024-10-01stable_partition: use TypeVar (#46686)Harmen Stoppels2-6/+12
2024-10-01Do not use single letter packages in unit-tests (#46665)Massimiliano Culpo1-89/+106
#45205 already removed previous use of single letter packages from unit tests, in view of reserving `c` as a language (see #45191). Some use of them has been re-introduced accidentally in #46382, and is making unit-tests fail in the feature branch #45189 since there `c` is a virtual package. Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2024-09-30avoid rpath'ing default search paths (#44686)Harmen Stoppels3-14/+71
On sysroot systems like gentoo prefix, as well as nix/guix, our "is system path" logic is broken cause it's static. Talking about "the system paths" is not helpful, we have to talk about default search paths of the dynamic linker instead. If glibc is recent enough, we can query the dynamic loader's default search paths, which is a much more robust way to avoid registering rpaths to system dirs, which can shadow Spack dirs. This PR adds an **additional** filter on rpaths the compiler wrapper adds, dropping rpaths that are default search paths. The PR **does not** remove any of the original `is_system_path` code yet. This fixes issues where build systems run just-built executables linked against their *not-yet-installed libraries*, typically: ``` LD_LIBRARY_PATH=. ./exe ``` which happens in `perl`, `python`, and other non-cmake packages. If a default path is rpath'ed, it takes precedence over `LD_LIBRARY_PATH`, and a system library gets loaded instead of the just-built library in the stage dir, breaking the build. If default paths are not rpath'ed, then LD_LIBRARY_PATH takes precedence, as is desired. This PR additionally fixes an inconsistency in rpaths between cmake and non-cmake packages. The cmake build system computed rpaths by itself, but used a different order than computed for the compiler wrapper. In fact it's not necessary to compute rpaths at all, since we let cmake do that thanks to `CMAKE_INSTALL_RPATH_USE_LINK_PATH`. This covers rpaths for all dependencies. The only install rpaths we need to set are `<install prefix>/{lib,lib64}`, which cmake unfortunately omits, although it could also know these. Also, cmake does *not* delete rpaths added by the toolchain (i.e. Spack's compiler wrapper), so I don't think it should be controversial to simplify things.
2024-09-27Better shell completion support for packages (#44756)Alec Scott2-0/+49
2024-09-27Spec.splice: Allow splices when multiples nodes in the DAG share a name (#46382)Greg Becker6-136/+514
The current `Spec.splice` model is very limited by the inability to splice specs that contain multiple nodes with the same name. This is an artifact of the original algorithm design predating the separate concretization of build dependencies, which was the first feature to allow multiple specs in a DAG to share a name. This PR provides a complete reimplementation of `Spec.splice` to avoid that limitation. At the same time, the new algorithm ensures that build dependencies for spliced specs are not changed, since the splice by definition cannot change the build-time information of the spec. This is handled by splitting the dependency edges and link/run edges into separate dependencies as needed. Signed-off-by: Gregory Becker <becker33@llnl.gov>
2024-09-27CI: Add documentation for adding new stacks and runners (#42179)kwryankrattiger1-0/+209
* CI: Add documentation for adding new stacks and runners * More docs for runner registration --------- Co-authored-by: Zack Galbreath <zack.galbreath@kitware.com> Co-authored-by: Bernhard Kaindl <contact@bernhard.kaindl.dev>
2024-09-27spec: simplify string formatting (#46609)Massimiliano Culpo6-18/+20
This PR shorten the string representation for concrete specs, in order to make it more legible. Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2024-09-27docs: add --depth=2 to reduce download size (#46605)Alec Scott2-3/+12
* docs: add --depth=2 to reduce download size * Add note to tell users about --depth=2 and manyFiles * Fix inline code in info block
2024-09-27`cc`: ensure that RPATHs passed to linker are uniqueTodd Gamblin2-26/+114
macOS Sequoia's linker will complain if RPATHs on the CLI are specified more than once. To avoid errors due to this, make `cc` only append unique RPATHs to the final args list. This required a few improvements to the logic in `cc`: 1. List functions in `cc` didn't have any way to append unique elements to a list. Add a `contains()` shell function that works like our other list functions. Use it to implement an optional `"unique"` argument to `append()` and an `extend_unique()`. Use that to add RPATHs to the `args_list`. 2. In the pure `ld` case, we weren't actually parsing `RPATH` arguments separately as we do for `ccld`. Fix this by adding *another* nested case statement for raw `RPATH` parsing. There are now 3 places where we deal with `-rpath` and friends, but I don't see a great way to unify them, as `-Wl,`, `-Xlinker`, and raw `-rpath` arguments are all ever so slightly different. 3. Fix ordering of assertions to make `pytest` diffs more intelligible. The meaning of `+` and `-` in diffs changed in `pytest` 6.0 and the "preferred" order for assertions became `assert actual == expected` instead of the other way around. Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2024-09-27`cc`: simplify ordered list handlingTodd Gamblin1-114/+65
`cc` divides most paths up into system paths, spack managed paths, and other paths. This gets really repetitive and makes the code hard to read. Simplify the script by adding some functions to do most of the redundant work for us. Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2024-09-27aspell: various fixes and updates (#46383)Richard Berger1-13/+9
SimpleFilesystemView was producing an error due to looking for a <prefix>/lib/.spack folder. Also, view_destination had no effect and wasn't called. Changed this by instead patching in the correct installation prefix for dictionaries. Since aspell is using the resolved path of the executable prefix, the runtime environment variable ASPELL_CONF is set to correct the prefix when in a view. With this change aspell can now find installed dictionaries. Verified with: aspell dump config aspell dump dicts
2024-09-26Add a custom hook for dev_path changes (#46529)psakievich3-6/+21
* Add a custom hook for dev_path changes Co-authored-by: Greg Becker <becker33@llnl.gov>
2024-09-25Remove a few redundant imports (#46512)Harmen Stoppels5-5/+0
2024-09-24Fix off-by-one padding bug (#46560)Samuel Browne2-3/+27
If `add_padding()` is allowed to return a path with a trailing path separator, it will get collapsed elsewhere in Spack. This can lead to buildcache entries that have RPATHS that are too short to be replaced by other users whose install root happens to be padded to the correct length. Detect this and replace the trailing path separator with a concrete path character. Signed-off-by: Samuel E. Browne <sebrown@sandia.gov>
2024-09-23database: don't call `socket.getfqdn()` on every write (#46554)Todd Gamblin1-1/+13
We've seen `getfqdn()` cause slowdowns on macOS in CI when added elsewhere. It's also called by database.py every time we write the DB file. - [x] replace the call with a memoized version so that it is only called once per process. Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
2024-09-23solver: use a new heuristic (#46548)Massimiliano Culpo1-22/+27
This PR introduces a new heuristic for the solver, which behaves better when compilers are treated as nodes. Apparently, it performs better also on `develop`, where compilers are still node attributes. The new heuristic: - Sets an initial priority for guessing a few attributes. The order is "nodes" (300), "dependencies" (150), "virtual dependencies" (60), "version" and "variants" (30), and "targets" and "compilers" (1). This initial priority decays over time during the solve, and falls back to the defaults. - By default, it considers most guessed facts as "false". For instance, by default a node doesn't exist in the optimal answer set, or a version is not picked as a node version etc. - There are certain conditions that override the default heuristic using the _priority_ of a rule, which previously we didn't use. For instance, by default we guess that a `attr("variant", Node, Variant, Value)` is false, but if we know that the node is already in the answer set, and the value is the default one, then we guess it is true. Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2024-09-24spec: fix spelling (#46550)Justin Cook1-4/+4
Signed-off-by: Justin Cook <jscook@lbl.gov>
2024-09-21Remove `spack.target` from code (#46503)Massimiliano Culpo20-308/+178
The `spack.target.Target` class is a weird entity, that is just needed to: 1. Sort microarchitectures in lists deterministically 2. Being able to use microarchitectures in hashed containers This PR removes it, and uses `archspec.cpu.Microarchitecture` directly. To sort lists, we use a proper `key=` when needed. Being able to use `Microarchitecture` objects in sets is achieved by updating the external `archspec`. Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2024-09-20Docs/Windows: Clarify supported shells and caveats (#46381)John W. Parent2-22/+20
While the existing getting started guide does in fact reference the powershell support, it's a footnote and easily missed. This PR adds explicit, upfront mentions of the powershell support. Additionally this PR adds notes about some of the issues with certain components of the spec syntax when using CMD.
2024-09-20spack.modules: move get_module up (#46428)Harmen Stoppels4-67/+76
2024-09-20Remove code from Compiler that is not used anymore (#45982)Massimiliano Culpo19-314/+26
Signed-off-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2024-09-20do_install: post #46423 cleanup (#46496)Tamara Dahlgren3-4/+5
2024-09-19package_base: break dependency on installer (#46423)Harmen Stoppels29-196/+249
Removes `spack.package_base.PackageBase.do_{install,deprecate}` in favor of `spack.installer.PackageInstaller.install` and `spack.installer.deprecate` resp. That drops a dependency of `spack.package_base` on `spack.installer`, which is necessary to get rid of circular dependencies in Spack. Also change the signature of `PackageInstaller.__init__` from taking a dict as positional argument, to an explicit list of keyword arguments.
2024-09-19require spec in develop entry (#46485)Harmen Stoppels1-0/+1
2024-09-19url join: fix oci scheme (#46483)Harmen Stoppels3-4/+7
* url.py: also special case oci scheme in join * avoid fetching keys from oci mirror
2024-09-19Revert "For "when:" and install_environment.json: Support fully qualified ↵Harmen Stoppels2-4/+2
hos…" (#46478) This reverts commit 6b0011c8f1293510a784a0eaa0a2a10e03339f16. It caused a major performance penalty in unit test time on macOS (about 30 minutes).
2024-09-19docs: refer to upstreams.yaml in chain.rst title (#46475)Harmen Stoppels1-3/+3
2024-09-19spack.util.url: fix join breakage in python 3.12.6 (#46453)Harmen Stoppels2-318/+84