summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)AuthorFilesLines
2021-07-16API Docs: fix broken reference targetsAdam J. Stewart57-471/+510
2021-07-16Python: query distutils to find site-packages directory (#24095)Adam J. Stewart3-43/+32
Third-party Python libraries may be installed in one of several directories: 1. `lib/pythonX.Y/site-packages` for Spack-installed Python 2. `lib64/pythonX.Y/site-packages` for system Python on RHEL/CentOS/Fedora 3. `lib/pythonX/dist-packages` for system Python on Debian/Ubuntu Previously, Spack packages were hard-coded to use the (1). Now, we query the Python installation itself and ask it which to use. Ever since #21446 this is how we've been determining where to install Python libraries anyway. Note: there are still many packages that are hard-coded to use (1). I can change them in this PR, but I don't have the bandwidth to test all of them. * Python: handle dist-packages and site-packages * Query Python to find site-packages directory * Add try-except statements for when distutils isn't installed * Catch more errors * Fix root directory used in import tests * Rely on site_packages_dir property
2021-07-15archspec: added support for arm compiler on graviton2 (#24904)Massimiliano Culpo2-1/+7
2021-07-14spec may be a string, use precomputed namespace (#24867)Greg Becker1-1/+1
2021-07-13binary_distribution: relocate x-pie-executable files (#24854)eugeneswalker1-1/+1
2021-07-13Fix KeyboardInterrupt signal for Python 2Adam J. Stewart1-1/+4
2021-07-12Enable/disable bootstrapping and customize store location (#23677)Massimiliano Culpo11-10/+299
* Permit to enable/disable bootstrapping and customize store location This PR adds configuration handles to allow enabling and disabling bootstrapping, and to customize the store location. * Move bootstrap related configuration into its own YAML file * Add a bootstrap command to manage configuration
2021-07-12build output: filter padding out of console output when `padded_length` is ↵Todd Gamblin5-7/+188
used (#24514) Spack allows users to set `padded_length` to pad out the installation path in build farms so that any binaries created are more easily relocatable. The issue with this is that the padding dominates installation output and makes it difficult to see what is going on. The padding also causes logs to easily exceed size limits for things like GitLab artifacts. This PR fixes this by adding a filter in the logger daemon. If you use a setting like this: config: install_tree: padded_length: 512 Then lines like this in the output: ==> [2021-06-23-15:59:05.020387] './configure' '--prefix=/Users/gamblin2/padding-log-test/opt/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_pla/darwin-bigsur-skylake/apple-clang-12.0.5/zlib-1.2.11-74mwnxgn6nujehpyyalhwizwojwn5zga will be replaced with the much more readable: ==> [2021-06-23-15:59:05.020387] './configure' '--prefix=/Users/gamblin2/padding-log-test/opt/[padded-to-512-chars]/darwin-bigsur-skylake/apple-clang-12.0.5/zlib-1.2.11-74mwnxgn6nujehpyyalhwizwojwn5zga You can see that the padding has been replaced with `[padded-to-512-chars]` to indicate the total number of characters in the padded prefix. Over a long log file, this should save a lot of space and allow us to see error messages in GitHub/GitLab log output. The *actual* build logs still have full paths in them. Also lines that are output by Spack and not by a package build are not filtered and will still display the fully padded path. There aren't that many of these, so the change should still help reduce file size and readability quite a bit.
2021-07-11docs: fix reference to count of system packages (#24821)Matthew Fernandez1-1/+1
015e29efe105ddd039e8b395e12cf78a3787ebb3 that introduced this section to the documentation said “two” here instead of the actual count, three. 9f54cea5c500bb19d2301149460c741e96be1f8b then added a fourth, BLAS/LAPACK. Rather than trying to keep this leading count in sync, this change just replaces the wording with something more generic/stable.
2021-07-10Fix out of date remote spec.yamls while updating the index (#24811)Scott Wittenburg2-10/+130
2021-07-09debug: initial global debug flag support (#24285)Vanessasaurus2-0/+74
The developer can export environment variables that are seen by the compiler wrapper to then add the flags
2021-07-10spec.splice: properly handle cached hash invalidations (#24795)Greg Becker3-18/+91
* spec.splice: properly handle cached hash invalidations * make package_hash a cached hash on the spec
2021-07-09ci: tolerate 'InvalidAccessKeyId' (#24741)Zack Galbreath1-1/+1
Add 'InvalidAccessKeyId' to the list of error messages we expect and tolerate in push_mirror_contents()
2021-07-09Remove unnecessary compiler id override for XL (#24799)Chris White1-15/+0
2021-07-08imports: sort imports everywhere in Spack (#24695)Todd Gamblin327-863/+1045
* fix remaining flake8 errors * imports: sort imports everywhere in Spack We enabled import order checking in #23947, but fixing things manually drives people crazy. This used `spack style --fix --all` from #24071 to automatically sort everything in Spack so PR submitters won't have to deal with it. This should go in after #24071, as it assumes we're using `isort`, not `flake8-import-order` to order things. `isort` seems to be more flexible and allows `llnl` mports to be in their own group before `spack` ones, so this seems like a good switch.
2021-07-07cvs tests: don't use dateutil at allTodd Gamblin1-18/+21
`dateutil.parser` was an optional dependency for CVS tests. It was failing on macOS beacuse the dateutil types were not being installed, and mypy was failing *even when the CVS tests were skipped*. This seems like it was an oversight on macOS -- `types-dateutil-parser` was not installed there, though it was on Linux unit tests. It takes 6 lines of YAML and some weird test-skipping logic to get `python-dateutil` and `types-python-dateutil` installed in all the tests where we need them, but it only takes 4 lines of code to write the date parser we need for CVS, so I just did that instead. Note that CVS date format can vary from system to system, but it seems like it's always pretty similar for the parts we care about. - [x] Replace dateutil.parser with a simpler date regex - [x] Lose the dependency on `dateutil.parser`
2021-07-07style: get close to full coverage of `spack style`Todd Gamblin3-95/+182
Previous tests of `spack style` didn't really run the tools -- they just ensure that the commands worked enough to get coverage. This adds several real tests and ensures that we hit the corner cases in `spack style`. This also tests sucess as well as failure cases.
2021-07-07style: clean up and restructure `spack style` commandTodd Gamblin1-93/+77
This consolidates code across tools in `spack style` so that each `run_<tool>` function can be called indirecty through a dictionary of handlers, and os that checks like finding the executable for the tool can be shared across commands. - [x] rework `spack style` to use decorators to register tools - [x] define tool order in one place in `spack style` - [x] fix python 2/3 issues to Get `isort` checks working - [x] make isort error regex more robust across versions - [x] remove unused output option - [x] change vestigial `TRAVIS_BRANCH` to `GITHUB_BASE_REF` - [x] update completion
2021-07-07style: Move isort configuration to pyproject.tomlTodd Gamblin1-4/+0
- [x] Remove flake8-import-order checks, as we only need isort for this - [x] Clean up configuration and requirements
2021-07-07style: add support for `isort` and `--fix`Danny McClanahan1-9/+55
2021-07-06oneAPI packages: add 2021.3 release (#24617)Vasily Danilin2-12/+35
2021-07-06fix buffered download (#24623)Harmen Stoppels1-8/+8
* Use shutil to do a buffered copy from http response to file * Fix flake8... * Somehow flake8 still complains about unrelated files
2021-07-06installer: fix double print of exception (#24697)eugeneswalker1-0/+1
2021-07-02Fix fetching for Python 3.9.6 (#24686)Adam J. Stewart1-6/+6
When using Python 3.9.6, Spack is no longer able to fetch anything. Commands like `spack fetch` and `spack install` all break. Python 3.9.6 includes a [new change](https://github.com/python/cpython/pull/25853/files#diff-b3712475a413ec972134c0260c8f1eb1deefb66184f740ef00c37b4487ef873eR462) that means that `scheme` must be a string, it cannot be None. The solution is to use an empty string like the method default. Fixes #24644. Also see https://github.com/Homebrew/homebrew-core/pull/80175 where this issue was discovered by CI. Thanks @branchvincent for reporting such a serious issue before any actual users encountered it! Co-authored-by: Todd Gamblin <tgamblin@llnl.gov>
2021-07-02Pipelines: Improve broken specs check (#24643)Scott Wittenburg2-21/+25
We should not fail the generate stage simply due to the presence of a broken-spec somewhere in the DAG. Only fail if the known broken spec needs to be rebuilt.
2021-07-02Add `when` context manager to group common constraints in packages (#24650)Massimiliano Culpo4-63/+183
This PR adds a context manager that permit to group the common part of a `when=` argument and add that to the context: ```python class Gcc(AutotoolsPackage): with when('+nvptx'): depends_on('cuda') conflicts('@:6', msg='NVPTX only supported in gcc 7 and above') conflicts('languages=ada') conflicts('languages=brig') conflicts('languages=go') ``` The above snippet is equivalent to: ```python class Gcc(AutotoolsPackage): depends_on('cuda', when='+nvptx') conflicts('@:6', when='+nvptx', msg='NVPTX only supported in gcc 7 and above') conflicts('languages=ada', when='+nvptx') conflicts('languages=brig', when='+nvptx') conflicts('languages=go', when='+nvptx') ``` which needs a repetition of the `when='+nvptx'` argument. The context manager might help improving readability and permits to group together directives related to the same semantic aspect (e.g. all the directives needed to model the behavior of `gcc` when `+nvptx` is active). Modifications: - [x] Added a `when` context manager to be used with package directives - [x] Add unit tests and documentation for the new feature - [x] Modified `cp2k` and `gcc` to show the use of the context manager
2021-07-01meson: fix typo (libs instead of default_library) (#24649)Harmen Stoppels1-2/+2
2021-06-30ci: only write to broken-specs list on SpackError (#24618)Zack Galbreath2-18/+20
ci: only write to broken-specs list on SpackError Only write to the broken-specs list when `spack install` raises a SpackError, instead of writing to this list unnecessarily when infrastructure-related problems prevent a develop job from completing successfully.
2021-06-30ci: Don't raise an exception if we fail to relate CDash builds (#24299)Zack Galbreath4-73/+96
ci: Do not allow cdash-related errors to cause pipeline failure
2021-06-29spack style: warn if flake8-import-order is missing (#24590)Adam J. Stewart1-4/+7
2021-06-29Fix prefix-collision detection for projections (#24049)Harmen Stoppels4-32/+80
If two Specs have the same hash (and prefix) but are not equal, Spack originally had logic to detect this and raise an error (since both cannot be installed in the same place). Recently this has eroded and the check no-longer works; moreover, when defining projections (which may truncate the hash or other distinguishing properties from the prefix) Spack was also failing to detect collisions (in both of these cases, Spack would overwrite the old prefix with the new Spec). This PR maintains a list of all "taken" prefixes: if a hash is not registered (i.e. recorded as installed in the database) but the prefix is occupied, that is a collision. This can detect collisions created by defining projections (specifically when they omit the hash). The PR does not detect collisions where specs have the same hash (and prefix) but are not equal.
2021-06-28Use flake8-import-order to enforce PEP-8 compliance (#23947)Adam J. Stewart1-9/+9
2021-06-28CUDA: 11.0.3 (11.0 "Update 1") (#24481)Axel Huebl1-4/+4
Add CUDA 11.0.3. This release adds new features such as NVCC flags `--forward-unknown-to-host-compiler` and `--forward-unknown-to-host-linker`
2021-06-27docs: link projections docs to spec format (#24478)Dylan Simon1-1/+2
2021-06-26Update archspec to support arm compiler on a64fx (#24524)Massimiliano Culpo2-1/+13
2021-06-25Doc: Note on required changes after merge of reproducible builds (#24347)Adrien Bernede1-1/+18
* Suggestion of a note for conversion of existing pipelines. * Wording * Fix format in .rst note * Wording
2021-06-25Add support for .tbz file extensions (#24479)Adam J. Stewart2-1/+3
2021-06-24Environment modifications: de-prioritize external packages (#23824)Peter Scheibel4-170/+270
Prior to any Spack build, Spack modifies PATH etc. to help the build find the dependencies it needs. It also allows any package to define custom environment modifications (and furthermore a package can specify environment modifications to apply when it is used as a dependency). If an external package defines custom environment modifications that alter PATH, and the external package is in a merged or system prefix, then that prefix could "override" the Spack-built packages. This commit reorders environment modifications so that PrependPath actions which expose Spack-built packages override PrependPath actions for custom environment modifications of external packages. In more detail, the original order of environment modifications is: * Modules * Compiler flag variables * PATH, CMAKE_PREFIX_PATH, and PKG_CONFIG_PATH for dependencies * Custom package.py modifications in the following order: * dependencies * root This commit changes the order: * Modules * Compiler flag variables * For each external dependency * PATH, CMAKE_PREFIX_PATH, and PKG_CONFIG_PATH modifications * Custom modifications * For each Spack-built dependency * PATH, CMAKE_PREFIX_PATH, and PKG_CONFIG_PATH modifications * Custom modifications
2021-06-24Pipelines: Set a pipeline type variable (#24505)Scott Wittenburg3-13/+17
Spack pipelines need to take specific actions internally that depend on whether the pipeline is being run on a PR to spack or a merge to the develop branch. Pipelines can also run in other repositories, which represents other possible use cases than just the two mentioned above. This PR creates a "SPACK_PIPELINE_TYPE" gitlab variable which is propagated to rebuild jobs, and is also used internally to determine which pipeline-specific tasks to run. One goal of the PR is fix an issue where rebuild jobs which failed on develop pipelines did not properly report the broken full hash to the "broken-specs-url".
2021-06-24Add Externally Findable section to info command (#24503)Asher Mancinelli2-0/+37
* Add Externally Findable section to info command * Use comma delimited detection attributes in addition to boolean value * Unit test externally detectable part of spack info
2021-06-23Update command to setup tutorial (#24488)Massimiliano Culpo1-2/+2
2021-06-23spack ci: use return codes to signal exit status (#24090)Scott Wittenburg1-3/+3
2021-06-23Fix broken CI for package only PRs, make dateutil not strictly required (#24484)Massimiliano Culpo1-6/+5
* Force the Python interpreter with an env variable This commit forces the Python interpreter with an environment variable, to ensure that the Python set by the "setup-python" action is the one being used. Due to the policy adopted by Spack to prefer python3 over python we may end up picking a Python 3.X interpreter where Python 2.7 was meant to be used. * Revert "Update conftest.py (#24473)" This reverts commit 477c8ce8205ec149fa897c9d83e530815c978d8b. * Make python-dateutil a soft dependency for unit tests Before #23212 people could clone spack and run ``` spack unit-tests ``` while now this is not possible, since python-dateutil is a required but not vendored dependency. This change makes it not a hard requirement, i.e. it will be used if found in the current interpreter. * Workaround mypy complaint
2021-06-22filter_compiler_wrappers: include realpath of compiler wrappers (#24456)eugeneswalker1-1/+5
2021-06-22Add config option to use urllib to fetch if curl missing (#21398)loulawrence5-117/+227
* Use Python module urllib to fetch in the case that curl is missing
2021-06-22Update conftest.py (#24473)Peter Scheibel1-2/+2
2021-06-22ASP-based solver: fix provider logic (#24351)Massimiliano Culpo2-10/+31
This commit fixes a subtle bug that may occur when a package is a "possible_provider" of a virtual but no "provides_virtual" can be deduced. In that case the cardinality constraint on "provides_virtual" may arbitrarily assign a package the role of provider even if the constraints for it to be one are not fulfilled. The fix reworks the logic around three concepts: - "possible_provider": a package may provide a virtual if some constraints are met - "provides_virtual": a package meet the constraints to provide a virtual - "provider": a package selected to provide a virtual
2021-06-22ASP-based solver: fix facts for default providers (#24380)Massimiliano Culpo1-1/+2
Facts used to compute weights for providers only need the package name, since the other attributes are computed as part of the solve.
2021-06-22Implement CVS fetcher (#23212)Erik Schnetter4-2/+423
Spack packages can now fetch versions from CVS repositories. Note this fetch mechanism is unsafe unless using :extssh:. Most public CVS repositories use an insecure protocol implemented as part of CVS.
2021-06-22adding save of build times on install (#24350)Vanessasaurus6-44/+123
Here we are adding an install_times.json into the spack install metadata folder. We record a total, global time, along with the times for each phase. The type of phase or install start / end is included (e.g., build or fail) Signed-off-by: vsoch <vsoch@users.noreply.github.com> Co-authored-by: vsoch <vsoch@users.noreply.github.com>