summaryrefslogtreecommitdiff
path: root/lib/spack/external
AgeCommit message (Collapse)AuthorFilesLines
2021-08-17Use a patched argparse only in Python 2.X (#25376)Massimiliano Culpo1-0/+0
Spack is internally using a patched version of `argparse` mainly to backport Python 3 functionality into Python 2. This PR makes it such that for the supported Python 3 versions we use `argparse` from the standard Python library. This PR has been extracted from #25371 where it was needed to be able to use recent versions of `pytest`. * Fixed formatting issues when using a pristine argparse.py * Fix error message for Python 3.X when missing positional arguments * Account for the change of API in Python 3.7 * Layout multi-valued args into columns in error messages * Seamless transition in develop if argparse.pyc is in external * Be more defensive in case we can't remove the file.
2021-07-15archspec: added support for arm compiler on graviton2 (#24904)Massimiliano Culpo2-1/+7
2021-06-26Update archspec to support arm compiler on a64fx (#24524)Massimiliano Culpo2-1/+13
2021-05-20spack: update archspecMassimiliano Culpo3-7/+172
This fixes the detection of Apple M1 and adds virtual levels for x86_64 architectures
2021-05-03archspec: updated external dependency (#23311)Massimiliano Culpo3-13/+71
Added support for Apple M1, extended support for zen3 with more compiler flags.
2021-04-22Docs: Updated copyrights in files still using 2020 as ending year (#23215)Tamara Dahlgren1-1/+1
2021-03-18archspec: update to latest version (#22357)Massimiliano Culpo2-2/+45
2021-02-01Python 3.10 support: collections.abc (#20441)Adam J. Stewart11-23/+71
2021-01-02copyrights: update all files with license headers for 2021Todd Gamblin2-2/+2
- [x] add `concretize.lp`, `spack.yaml`, etc. to licensed files - [x] update all licensed files to say 2013-2021 using `spack license update-copyright-year` - [x] appease mypy with some additions to package.py that needed for oneapi.py
2020-12-28archspec: fixed a typo in the vendored library (#20584)Massimiliano Culpo2-2/+2
2020-12-22add mypy to style checks; rename `spack flake8` to `spack style` (#20384)Tom Scogland1-0/+84
I lost my mind a bit after getting the completion stuff working and decided to get Mypy working for spack as well. This adds a `.mypy.ini` that checks all of the spack and llnl modules, though not yet packages, and fixes all of the identified missing types and type issues for the spack library. In addition to these changes, this includes: * rename `spack flake8` to `spack style` Aliases flake8 to style, and just runs flake8 as before, but with a warning. The style command runs both `flake8` and `mypy`, in sequence. Added --no-<tool> options to turn off one or the other, they are on by default. Fixed two issues caught by the tools. * stub typing module for python2.x We don't support typing in Spack for python 2.x. To allow 2.x to support `import typing` and `from typing import ...` without a try/except dance to support old versions, this adds a stub module *just* for python 2.x. Doing it this way means we can only reliably use all type hints in python3.7+, and mypi.ini has been updated to reflect that. * add non-default black check to spack style This is a first step to requiring black. It doesn't enforce it by default, but it will check it if requested. Currently enforcing the line length of 79 since that's what flake8 requires, but it's a bit odd for a black formatted project to be quite that narrow. All settings are in the style command since spack has no pyproject.toml and I don't want to add one until more discussion happens. Also re-format `style.py` since it no longer passed the black style check with the new length. * use style check in github action Update the style and docs action to use `spack style`, adding in mypy and black to the action even if it isn't running black right now.
2020-11-26archspec: added support for aocc (#20124)Massimiliano Culpo3-2/+145
2020-11-18spack test (#15702)Greg Becker1-0/+1
Users can add test() methods to their packages to run smoke tests on installations with the new `spack test` command (the old `spack test` is now `spack unit-test`). spack test is environment-aware, so you can `spack install` an environment and then run `spack test run` to run smoke tests on all of its packages. Historical test logs can be perused with `spack test results`. Generic smoke tests for MPI implementations, C, C++, and Fortran compilers as well as specific smoke tests for 18 packages. Inside the test method, individual tests can be run separately (and continue to run best-effort after a test failure) using the `run_test` method. The `run_test` method encapsulates finding test executables, running and checking return codes, checking output, and error handling. This handles the following trickier aspects of testing with direct support in Spack's package API: - [x] Caching source or intermediate build files at build time for use at test time. - [x] Test dependencies, - [x] packages that require a compiler for testing (such as library only packages). See the packaging guide for more details on using Spack testing support. Included is support for package.py files for virtual packages. This does not change the Spack interface, but is a major change in internals. Co-authored-by: Tamara Dahlgren <dahlgren1@llnl.gov> Co-authored-by: wspear <wjspear@gmail.com> Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2020-11-11fix typo wrt target=graviton (#19865)Satish Balay2-2/+2
* fix typo wrt target=graviton This fixes spack build on aarch64 box * update archspec hash
2020-10-30Make archspec a vendored dependency (#19600)Massimiliano Culpo19-0/+3273
- Added archspec to the list of vendored dependencies - Removed every reference to llnl.util.cpu - Removed tests from Spack code base
2020-03-23Vendoring: remove dependency on Setuptools from vendored pytest (#15612)Todd Gamblin3-51/+17
If the Python used by Spack does not include Setuptools, then 'spack test' will fail because Spack's vendored pytest dependency imports and uses Setuptools in some of its functions. It turns out that Spack doesn't use the functionality those methods enable, so this PR removes those functions and thereby allows 'spack test' to run without Setuptools.
2020-03-16Buildcache: Install into non-default directory layouts (#13797)Patrick Gartung1-3/+6
* Buildcache: Install into non-default directory layouts Store a dictionary mapping of original dependency prefixes to dependency hashes Use the loaded spec to grab the new dependency prefixes in the new directory layout. Map the original dependency prefixes to the new dependency prefixes using the dependency hashes. Use the dependency prefixes map to replace original rpaths with new rpaths preserving the order. For mach-o binaries, use the dependency prefixes map to replace the dependency library entires for libraries and executables and the replace the library id for libraries. On Linux, patchelf is used to replace the rpaths of elf binaries. On macOS, install_name_tool is used to replace the rpaths and dependency libraries of mach-o binaries and the id of mach-o libraries. On Linux, macholib is used to replace the dependency libraries of mach-o binaries and the id of mach-o libraries. Binary text with padding replacement is attempted for all binaries for the following paths: spack layout root spack prefix sbang script location dependency prefixes package prefix Text replacement is attempted for all text files using the paths above. Symbolic links to the absolute path of the package install prefix are replaced, all others produce warnings.
2020-02-28Fix detection of redhat enterprise compute node (#15253)Adam J. Stewart1-0/+1
* Fix detection of redhat enterprise compute node * Add comma * Remove space
2019-12-30copyright: update copyright dates for 2020 (#14328)Todd Gamblin2-2/+2
2019-12-24tests: finish removing pyqver from the repository (#14294)Todd Gamblin2-2/+2
Remove a few remaining mentions of the pyqver package, which was removed in #14289.
2019-12-24tests: check min required python version with vermin (#14289)Massimiliano Culpo3-600/+0
This commit removes the `python_version.py` unit test module and the vendored dependencies `pyqver2.py` and `pyqver3.py`. It substitutes them with an equivalent check done using `vermin` that is run as a separate workflow via Github Actions. This allows us to delete 2 vendored dependencies that are unmaintained and substitutes them with a maintained tool. Also, updates the list of vendored dependencies.
2019-09-26External: add macholib and altgraph needed to relocate Mach-o binaries on ↵Patrick Gartung25-0/+5425
Linux (#12909)
2019-09-22externals: add note to jsonschema about modifications (#12895)Todd Gamblin1-1/+3
2019-09-21externals: avoid importing requests in jsonschemaTodd Gamblin1-4/+1
Spack doesn't need `requests`, and neither does `jsonschema`, but `jsonschema` tries to import it, and it'll succeed if `requests` is on your machine (which is likely, given how popular it is). This commit removes the import to improve Spack's startup time a bit. On a mac with SSD, the import of requests is ~28% of Spack's startup time when run as `spack --print-shell-vars sh,modules` (.069 / .25 seconds), which is what `setup-env.sh` runs. On a Linux cluster where Python is mounted from NFS, this reduces `setup-env.sh` source time from ~1s to .75s. Note: This issue will be eliminated if we upgrade to a newer `jsonschema` (we'd need to drop Python 2.6 for that). See https://github.com/Julian/jsonschema/pull/388.
2019-01-01copyright: update license headers for 2013-2019 copyright.Todd Gamblin2-2/+2
2018-11-09externals: bugfix in ruamel for ordereddict in Python 2.6Todd Gamblin1-2/+2
- args weren't being delegated properly from CommentedMap to OrderedDict
2018-10-17relicense: replace LGPL headers with Apache-2.0/MIT SPDX headersTodd Gamblin2-46/+8
- remove the old LGPL license headers from all files in Spack - add SPDX headers to all files - core and most packages are (Apache-2.0 OR MIT) - a very small number of remaining packages are LGPL-2.1-only
2018-08-20yaml: use ruamel.yaml instead of pyyamlTodd Gamblin56-8113/+5146
- ruamel.yaml allows round-tripping comments from/to files - ruamel.yaml is single-source, python2/python3 compatible
2018-06-20pytest: add _pytest/_version.py and LICENSETodd Gamblin4-1/+49
- pytest was not reporing the correct version from pytest.__version__. It reported 'unknown' - this fixes issues on some systems where system-installed pytest plugins would try to use the version and convert it to an int
2018-06-20externals: move spack.util.ordereddict to external/ordereddict_backportTodd Gamblin2-4/+41
2018-06-02Less sensitive error detection in build logs (#8278)Adam J. Stewart1-5/+2
* Less sensitive error detection in build logs * Fix test_log_parser unit test
2018-05-15Capture source line number in CTest log parserZack Galbreath1-1/+1
2018-05-15Fix typo in commentZack Galbreath1-1/+1
2018-03-24Update copyright on LLNL files for 2018. (#7592)Todd Gamblin1-1/+1
2018-02-12Fix issues with `spack [cmd] -h` help outputTodd Gamblin1-2/+0
- Shorten Spack command usage for short options. Short options are now shown as [-abc] instead of as [-a] [-b] [-c] - fix bug that mixed long and short options for top-level `spack help`
2018-01-31Improve log parsing performance (#7093)Todd Gamblin1-55/+216
* Allow dashes in command names and fix command name handling - Command should allow dashes in their names like the reest of spack, e.g. `spack log-parse` - It might be too late for `spack build-cache` (since it is already called `spack buildcache`), but we should try a bit to avoid inconsistencies in naming conventions - The code was inconsistent about where commands should be called by their python module name (e.g. `log_parse`) and where the actual command name should be used (e.g. `log-parse`). - This made it hard to make a command with a dash in the name, and it made `SpackCommand` fail to recognize commands with dashes. - The code now uses the user-facing name with dashes for function parameters, then converts that the module name when needed. * Improve performance of log parsing - A number of regular expressions from ctest_log_parser have really poor performance, most due to untethered expressions with * or + (i.e., they don't start with ^, so the repetition has to be checked for every position in the string with Python's backtracking regex implementation) - I can't verify that CTest's regexes work with an added ^, so I don't really want to touch them. I tried adding this and found that it caused some tests to break. - Instead of using only "efficient" regular expressions, Added a prefilter() class that allows the parser to quickly check a precondition before evaluating any of the expensive regexes. - Preconditions do things like check whether the string contains "error" or "warning" (linear time things) before evaluating regexes that would require them. It's sad that Python doesn't use Thompson string matching (see https://swtch.com/~rsc/regexp/regexp1.html) - Even with Python's slow implementation, this makes the parser ~200x faster on the input we tried it on. * Add `spack log-parse` command and improve the display of parsed logs - Add better coloring and line wrapping to the log parse output. This makes nasty build output look better with the line numbers. - `spack log-parse` allows the log parsing logic used at the end of builds to be executed on arbitrary files, which is handy even outside of spack. - Also provides a profile option -- we can profile arbitrary files and show which regular expressions in the magic CTest parser take the most time. * Parallelize log parsing - Log parsing now uses multiple threads for long logs - Lines from logs are divided into chnks and farmed out to <ncpus> - Add -j option to `spack log-parse`
2018-01-16Vendor ordereddict for python2.6 only (#6931)Massimiliano Culpo3-271/+131
* Vendor ordereddict for python2.6 only This commit substitutes the custom module 'ordereddict_backport' with the more known 'ordereddict' and vendors it only for python 2.6. Other supported versions of python will use 'collections.OrderedDict'. * Use absolute imports also for python 2.6 See PEP-328 for more information on the subject * Added provenance of vendored ordereddict
2018-01-10Keep track of source and versions for external libraries (#6803)Adam J. Stewart1-16/+98
* Keep track of source and versions for external libraries * Note source of more obscure libraries * We aren't upgrading jsonschema after all * Add note on modifications made to pytest
2018-01-10Update to pytest 3.2.5 (#6801)Adam J. Stewart48-2109/+3303
* Update to pytest 3.2.5 * Get pytest to pass Python 2.6 compatibility checks
2018-01-10Update to the latest version of jinja2 (#6790)Adam J. Stewart23-365/+728
2018-01-10Update to py 1.4.34 (#6789)Adam J. Stewart9-79/+25
* Update to the latest version of py * Revert back to py 1.4.34
2018-01-10Update to the latest version of six (#6787)Adam J. Stewart1-3/+8
2017-12-30Update to the latest version of argparse (#6786)Adam J. Stewart1-53/+36
* Update to the latest version of argparse * Re-add colified logic
2017-12-30Update to distro 1.0.4 (#6788)Adam J. Stewart1-24/+39
* Update to the latest version of distro * Update distro to 1.0.4
2017-11-04Replace github.com/llnl/spack with github.com/spack/spack (#6142)Todd Gamblin1-1/+1
We moved to a new GitHub org! Now make the code and docs reflect that.
2017-09-30Port CTest's log scraping logic to Spack (#5561)Todd Gamblin1-0/+313
- This steals the magic regular expressions that CTest uses to parse log files and addds them to Spack. See here: https://github.com/Kitware/CMake/blob/master/Source/CTest/cmCTestBuildHandler.cxx These are BSD licensed, so the port is in `externa/ctest_log_parser.py` - We currently use these to do better filtering of errors from build output. Plan is to use them to generate good CDash output.
2017-09-19Modulefiles generated with a template engine (#3183)Massimiliano Culpo37-0/+12790
* Module files now are generated using a template engine refers #2902 #3173 jinja2 has been hooked into Spack. The python module `modules.py` has been splitted into several modules under the python package `spack/modules`. Unit tests stressing module file generation have been refactored accordingly. The module file generator for Lmod has been extended to multi-providers and deeper hierarchies. * Improved the support for templates in module files. Added an entry in `config.yaml` (`template_dirs`) to list all the directories where Spack could find templates for `jinja2`. Module file generators have a simple override mechanism to override template selection ('modules.yaml' beats 'package.py' beats 'default'). * Added jinja2 and MarkupSafe to vendored packages. * Spec.concretize() sets mutual spec-package references The correct place to set the mutual references between spec and package objects at the end of concretization. After a call to concretize we should now be ensured that spec is the same object as spec.package.spec. Code in `build_environment.py` that was performing the same operation has been turned into an assertion to be defensive on the new behavior. * Improved code and data layout for modules and related tests. Common fixtures related to module file generation have been extracted in `conftest.py`. All the mock configurations for module files have been extracted from python code and have been put into their own yaml file. Added a `context_property` decorator for the template engine, to make it easy to define dictionaries out of properties. The default for `verbose` in `modules.yaml` is now False instead of True. * Extendable module file contexts + short description from docstring The contexts that are used in conjunction with `jinja2` templates to generate module files can now be extended from package.py and modules.yaml. Module files generators now infer the short description from package.py docstring (and as you may expect it's the first paragraph) * 'module refresh' regenerates all modules by default `module refresh` without `--module-type` specified tries to regenerate all known module types. The same holds true for `module rm` Configure options used at build time are extracted and written into the module files where possible. * Fixed python3 compatibility, tests for Lmod and Tcl. Added test for exceptional paths of execution when generating Lmod module files. Fixed a few compatibility issues with python3. Fixed a bug in Tcl with naming_scheme and autoload + unit tests * Updated module file tutorial docs. Fixed a few typos in docstrings. The reference section for module files has been reorganized. The idea is to have only three topics at the highest level: - shell support + spack load/unload use/unuse - module file generation (a.k.a. APIs + modules.yaml) - module file maintenance (spack module refresh/rm) Module file generation will cover the entries in modules.yaml Also: - Licenses have been updated to include NOTICE and extended to 2017 - docstrings have been reformatted according to Google style * Removed redundant arguments to RPackage and WafPackage. All the callbacks in `RPackage` and `WafPackage` that are not build phases have been modified not to accept a `spec` and a `prefix` argument. This permits to leverage the common `configure_args` signature to insert by default the configuration arguments into the generated module files. I think it's preferable to handling those packages differently than `AutotoolsPackage`. Besides only one package seems to override one of these methods. * Fixed broken indentation + improved resiliency of refresh Fixed broken indentation in `spack module refresh` (probably a rebase gone silently wrong?). Filter the writers for blacklisted specs before searching for name clashes. An error with a single writer will not stop regeneration, but instead will print a warning and continue the command.
2017-09-06Update copyright notices for 2017 (#5295)Michael Kuhn1-1/+1
2017-06-24Make LICENSE recognizable by GitHub. (#4598)Todd Gamblin1-1/+1
2017-03-31Use key sorting instead of cmp()Todd Gamblin1-0/+17
- Get rid of pkgsort() usage for preferred variants. - Concretization is now entirely based on key-based sorting. - Remove PreferredPackages class and various spec cmp() methods. - Replace with PackagePrefs class that implements a key function for sorting according to packages.yaml. - Clear package pref caches on config test. - Explicit compare methods instead of total_ordering in Version. - Our total_ordering backport wasn't making Python 3 happy for some reason. - Python 3's functools.total_ordering and spelling the operators out fixes the problem. - Fix unicode issues with spec hashes, json, & YAML - Try to use str everywhere and avoid unicode objects in python 2.