summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)AuthorFilesLines
2020-03-20version bump: 0.14.1Todd Gamblin1-1/+1
2020-03-20multiprocessing: allow Spack to run uninterrupted in background (#14682)Greg Becker1-47/+83
Spack currently cannot run as a background process uninterrupted because some of the logging functions used in the install method (especially to create the dynamic verbosity toggle with the v key) cause the OS to issue a SIGTTOU to Spack when it's backgrounded. This PR puts the necessary gatekeeping in place so that Spack doesn't do anything that will cause a signal to stop the process when operating as a background process.
2020-03-20Cray bugfix: TERM missing while reading default target (#15381)Greg Becker1-6/+8
Bug: Spack hangs on some Cray machines Reason: The TERM environment variable is necessary to run bash -lc "echo $CRAY_CPU_TARGET", but we run that command within env -i, which wipes the environment. Fix: Manually forward the TERM environment variable to env -i /bin/bash -lc "echo $CRAY_CPU_TARGET"
2020-03-20Upstreams: don't write metadata directory to upstream DB (#15526)Kai Germaschewski1-1/+1
When trying to use an upstream Spack repository, as of f2aca86 Spack was attempting to write to the upstream DB based on a new metadata directory added in that commit. Upstream DBs are read-only, so this should not occur. This adds a check to prevent Spack from writing to the upstream DB
2020-03-20Creating versions from urls doesn't modify class attributes (#15452)Massimiliano Culpo3-3/+3
fixes #15449 Before this PR a call to pkg.url_for_version was modifying class attributes determining different results for subsequents calls and an error when the urls was empty.
2020-03-20bugfix: fix install_missing_compilers option bug from v0.14.0 (#15416)Greg Becker1-0/+18
* bugfix: ensure bootstrapped compilers built before packages using the compiler
2020-03-20bugfix: installer.py shouldn't be executable (#15386)Todd Gamblin1-0/+0
This is a minor permission fix on the new installer.py introduced in #13100.
2020-03-20Add function replace_prefix_nullterm for use on mach-o rpaths. (#15347)Patrick Gartung1-3/+34
This recovers the old behavior of replace_prefix_bin that was modified to work with elf binaries by prefixing os.sep to new prefix until length is the same as old prefix.
2020-03-20ArchSpec: fix semantics of satisfies when not concrete and strict is true ↵Massimiliano Culpo2-0/+17
(#15319)
2020-03-20testing: increase installer coverage (#15237)Tamara Dahlgren3-109/+280
2020-03-20bugfix: resolve undefined source_pkg_dir failure (#15339)Tamara Dahlgren2-8/+74
2020-03-20Bugfix: resolve StopIteration message attribute failure (#15341)Massimiliano Culpo2-1/+22
Testing the install StopIteration exception resulted in an attribute error: AttributeError: 'StopIteration' object has no attribute 'message' This PR adds a unit test and resolves that error.
2020-03-20Recover coverage from subprocesses during unit tests (#15354)Tamara Dahlgren4-19/+13
* Recover coverage from subprocesses during unit tests
2020-03-20Correct pytest.raises matches to match (#15346)Massimiliano Culpo3-10/+10
2020-03-20bugfix: Add dependents when initializing spec from yaml (#15220)Tamara Dahlgren2-11/+17
The new build process, introduced in #13100 , relies on a spec's dependents in addition to their dependencies. Loading a spec from a yaml file was not initializing the dependents. - [x] populate dependents when loading from yaml
2020-03-20Uniquify suffixes added to module names (#14920)Seth R. Johnson3-1/+4
2020-03-20bugfix: ensure proper dependency handling for package-only installs (#15197)Tamara Dahlgren3-17/+149
The distributed build PR (#13100) -- did not check the install status of dependencies when using the `--only package` option so would refuse to install a package with the claim that it had uninstalled dependencies whether that was the case or not. - [x] add install status checks for the `--only package` case. - [x] add initial set of tests
2020-03-20Fix for being able to 'spack load' packages that have been renamed. (#14348)Andrew W Elble2-1/+36
* Fix for being able to 'spack load' packages that have been renamed. * tests: add test for 'spack load' of a installed, but renamed/deleted package
2020-03-20modules: store configure args during build (#11084)Michael Kuhn4-11/+41
This change stores packages' configure arguments during build and makes use of them while refreshing module files. This fixes problems such as in #10716.
2020-03-20fetch_strategy: remove vestigial code (#15431)Greg Becker1-18/+0
2020-02-23version bump: 0.14.0Todd Gamblin4-1/+11713
2020-02-21Emit a sensible error message if compiler's target is overly specific (#14888)Massimiliano Culpo2-0/+33
* Emit a sensible error message if compiler's target is overly specific fixes #14798 fixes #13733 Compiler specifications require a generic architecture family as their target. This commit improves the error message that is displayed to users if they edit compilers.yaml and use an overly specific name.
2020-02-20Updated installer module copyright (#15138)Tamara Dahlgren1-1/+1
Update the copyright for `installer.py`.
2020-02-20Restore package-related unsigned binary changes from PR 11107 (#15134)Tamara Dahlgren2-12/+21
Restore package-related unsigned binary changes from PR 11107
2020-02-20Package hashing: fix detection of directives (#14763)Peter Scheibel2-0/+19
The hashing logic looks for function calls that are Spack directives. It expects that when a Spack directive is used that it is referenced directly by name, and that the directive function is not itself retrieved by calling another function. When the hashing logic encountered a function call where the function was determined dynamically, it would fail (attempting to access a name attribute that does not happen to exist in this case). This updates the hashing logic to filter out function calls where the function is determined dynamically when looking for uses of Spack directives.
2020-02-20Use get_spec in relocated _try_install_from_binary_cache (#15131)Patrick Gartung1-1/+1
* Use get_spec in relocated _try_install_from_binary_cache
2020-02-20Compilers require an exact match on version during concretization (#14752)Massimiliano Culpo2-2/+26
Spack now requires an exact match of the compiler version requested by the user. A loose constraint can be given to Spack by using a version range instead of a concrete version (e.g. 4.5: instead of 4.5).
2020-02-19Use shutil.copy2 in install_tree (#15058)Dr. Christian Tacke1-1/+1
Sometimes one needs to preserve the (relative order) of mtimes on installed files. So it's better to just copy over all the metadata from the source tree to the install tree. If permissions need fixing, that will be done anyway afterwards. One major use case are resource()s: They're unpacked in one place and then copied to their final place using install_tree(). If the resource is a source tree using autoconf/automake, resetting mtimes uncorrectly might force unwanted autoconf/etc calls.
2020-02-19Docs: configure_args -> cmake_args (#15102)Adam J. Stewart1-1/+1
2020-02-19Fix relocate.mime_type if slashes in subtype (#11788)Oliver Breitwieser1-1/+2
If the mimetype returned from `file -h -b --mime-type` contains slashes in its subtype, the tuple returned from `spack.relocate.mime_type` will have a size larger than two, which leads to errors. Change-Id: I31de477e69f114ffdc9ae122d00c573f5f749dbb
2020-02-19Buildcache: join rpaths returned by get_existing_elf_rpaths with ':'. (#15086)Patrick Gartung1-1/+1
This reproduces the behavior expected by patchelf_is_relocatable test.
2020-02-19Distributed builds (#13100)Tamara Dahlgren18-724/+2919
Fixes #9394 Closes #13217. ## Background Spack provides the ability to enable/disable parallel builds through two options: package `parallel` and configuration `build_jobs`. This PR changes the algorithm to allow multiple, simultaneous processes to coordinate the installation of the same spec (and specs with overlapping dependencies.). The `parallel` (boolean) property sets the default for its package though the value can be overridden in the `install` method. Spack's current parallel builds are limited to build tools supporting `jobs` arguments (e.g., `Makefiles`). The number of jobs actually used is calculated as`min(config:build_jobs, # cores, 16)`, which can be overridden in the package or on the command line (i.e., `spack install -j <# jobs>`). This PR adds support for distributed (single- and multi-node) parallel builds. The goals of this work include improving the efficiency of installing packages with many dependencies and reducing the repetition associated with concurrent installations of (dependency) packages. ## Approach ### File System Locks Coordination between concurrent installs of overlapping packages to a Spack instance is accomplished through bottom-up dependency DAG processing and file system locks. The runs can be a combination of interactive and batch processes affecting the same file system. Exclusive prefix locks are required to install a package while shared prefix locks are required to check if the package is installed. Failures are communicated through a separate exclusive prefix failure lock, for concurrent processes, combined with a persistent store, for separate, related build processes. The resulting file contains the failing spec to facilitate manual debugging. ### Priority Queue Management of dependency builds changed from reliance on recursion to use of a priority queue where the priority of a spec is based on the number of its remaining uninstalled dependencies. Using a queue required a change to dependency build exception handling with the most visible issue being that the `install` method *must* install something in the prefix. Consequently, packages can no longer get away with an install method consisting of `pass`, for example. ## Caveats - This still only parallelizes a single-rooted build. Multi-rooted installs (e.g., for environments) are TBD in a future PR. Tasks: - [x] Adjust package lock timeout to correspond to value used in the demo - [x] Adjust database lock timeout to reduce contention on startup of concurrent `spack install <spec>` calls - [x] Replace (test) package's `install: pass` methods with file creation since post-install `sanity_check_prefix` will otherwise error out with `Install failed .. Nothing was installed!` - [x] Resolve remaining existing test failures - [x] Respond to alalazo's initial feedback - [x] Remove `bin/demo-locks.py` - [x] Add new tests to address new coverage issues - [x] Replace built-in package's `def install(..): pass` to "install" something (i.e., only `apple-libunwind`) - [x] Increase code coverage
2020-02-18buildcache: Check for tar.bz2 and set tar.gz if not found (#15054)Patrick Gartung1-0/+4
* Check for tar.bz2 and set tar.gz if not found * Move check for tarfile after it is extracted
2020-02-18skip gpg tests when no gpg executable (#14935)Greg Becker4-1/+38
* skip gpg tests when no gpg executable * flake
2020-02-17spack extensions prints list of extendable packages (#14473)Adam J. Stewart2-1/+21
* spack extensions prints list of extendable packages * Update tab completion scripts
2020-02-14Buildcache creation/extraction use temp tarfile to preserve hardlinks during ↵Patrick Gartung2-26/+30
copy to/from prefix. (#15003) * Buildcache creation change the way prefix is copied to workdir. * install_tree copies hardlinked files * tarfile creates hardlinked files on extraction. * create a temporary tarfile from prefix and extract it to workdir * Use temp tarfile to move workdir to prefix to preserve hardlinks instead of copying
2020-02-14docs: fix typo in arch in build settings examples (#14998)Paul1-6/+6
2020-02-13spack compiler info: quick fix for failing command (#14928)Massimiliano Culpo1-1/+1
fixes #14927
2020-02-13Replace direct call to patchelf with get_existing_elf_rpaths which handles ↵Patrick Gartung1-9/+2
exceptions. (#14929) * Replace direct call to patchelf with get_existing_elf_rpaths which handles exceptions. * Remove unused patchelf definition. * Convert to set.
2020-02-12spack python: add -m option to run modules as scriptsTodd Gamblin2-1/+31
It's often useful to run a module with `python -m`, e.g.: python -m pyinstrument script.py Running a python script this way was hard, though, as `spack python` did not have a similar `-m` option. This PR adds a `-m` option to `spack python` so that we can do things like this: spack python -m pyinstrument ./test.py This makes it easy to write a script that uses a small part of Spack and then profile it. Previously thee easiest way to do this was to write a custom Spack command, which is often overkill.
2020-02-11bugfix: `spack -V` should use `working_dir()` instead of `git -C`Todd Gamblin1-2/+4
- `git -C` doesn't work on git before 1.8.5 - `working_dir` gets us the same effect
2020-02-10Spack find: fix queries that specify dependencies (#14757)Massimiliano Culpo2-1/+22
Fixes #10019 If multiple instances of a package were installed in a single instance of Spack, and they differed in terms of dependencies, then "spack find" would not distinguish specs based on their dependencies. For example if two instances of X were installed, one with Y and one with Z, then "spack find X ^Y" would display both instances of X.
2020-02-09Merge branch 'releases/v0.13' into developTodd Gamblin1-1/+1
2020-02-07version bump: 0.13.4Todd Gamblin1-1/+1
2020-02-07bugfix: make `_source_single_file` work in venvs (#14569)Massimiliano Culpo2-6/+10
Using `sys.executable` to run Python in a sub-shell doesn't always work in a virtual environment as the `sys.executable` Python is not necessarily compatible with any loaded spack/other virtual environment. - revert use of sys.executable to print out subshell environment (#14496) - try instead to use an available python, then if there *is not* one, use `sys.executable` - this addresses RHEL8 (where there is no `python` and `PYTHONHOME` issue in a simpler way
2020-02-07Fix use of sys.executable for module/env commands (#14496)Adam J. Stewart2-4/+6
* Fix use of sys.executable for module/env commands * Fix unit tests * More consistent quotation, less duplication * Fix import syntax
2020-02-07RHEL8 bugfix for module_cmd (#14349)Sajid Ali1-1/+2
2020-02-07Remove extensions from view in the correct order (#12961)Jeffrey Salmond2-17/+39
When removing packages from a view, extensions were being deactivated in an arbitrary order. Extensions must be deactivated in preorder traversal (dependents before dependencies), so when this order was violated the view update would fail. This commit ensures that views deactivate extensions based on a preorder traversal and adds a test for it.
2020-02-07bugfix: hashes should use ordered dictionaries (#14390)Todd Gamblin3-8/+81
Despite trying very hard to keep dicts out of our hash algorithm, we seem to still accidentally add them in ways that the tests can't catch. This can cause errors when hashes are not computed deterministically. This fixes an error we saw with Python 3.5, where dictionary iteration order is random. In this instance, we saw a bug when reading Spack environment lockfiles -- The load would fail like this: ``` ... File "/sw/spack/lib/spack/spack/environment.py", line 1249, in concretized_specs yield (s, self.specs_by_hash[h]) KeyError: 'qcttqplkwgxzjlycbs4rfxxladnt423p' ``` This was because the hashes differed depending on whether we wrote `path` or `module` first when recomputing the build hash as part of reading a Spack lockfile. We can fix it by ensuring a determistic iteration order. - [x] Fix two places (one that caused an issue, and one that did not... yet) where our to_node_dict-like methods were using regular python dicts. - [x] Also add a check that statically analyzes our to_node_dict functions and flags any that use Python dicts. The test found the two errors fixed here, specifically: ``` E AssertionError: assert [] == ['Use syaml_dict instead of ...pack/spack/spec.py:1495:28'] E Right contains more items, first extra item: 'Use syaml_dict instead of dict at /Users/gamblin2/src/spack/lib/spack/spack/spec.py:1495:28' E Full diff: E - [] E + ['Use syaml_dict instead of dict at ' E + '/Users/gamblin2/src/spack/lib/spack/spack/spec.py:1495:28'] ``` and ``` E AssertionError: assert [] == ['Use syaml_dict instead of ...ack/architecture.py:359:15'] E Right contains more items, first extra item: 'Use syaml_dict instead of dict at /Users/gamblin2/src/spack/lib/spack/spack/architecture.py:359:15' E Full diff: E - [] E + ['Use syaml_dict instead of dict at ' E + '/Users/gamblin2/src/spack/lib/spack/spack/architecture.py:359:15'] ```
2020-02-06Allow installing unsigned binary packages (#11107)Oliver Breitwieser2-4/+10
This commit introduces a `--no-check-signature` option for `spack install` so that unsigned packages can be installed. It is off by default (signatures required).