summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin.mock/packages/a/package.py
AgeCommit message (Collapse)AuthorFilesLines
2024-01-02Update copyright year to 2024 (#41919)Todd Gamblin1-1/+1
It was time to run `spack license update-copyright-year` again.
2023-04-19make version(...) kwargs explicit (#36998)Harmen Stoppels1-2/+2
- [x] Replace `version(ver, checksum=None, **kwargs)` signature with `version(ver, checksum=None, *, sha256=..., ...)` explicitly listing all arguments. - [x] Fix various issues in packages: - `tags` instead of `tag` - `default` instead of `preferred` - `sha26` instead of `sha256` - etc Also, use `sha256=...` consistently. Note: setting `sha256` currently doesn't validate the checksum length, so you could do `sha256="a"*32` and it would get checked as `md5`... but that's something for another PR.
2023-02-16Style: black 23, skip magic trailing comma (#35351)Adam J. Stewart1-3/+1
* Style: black 23, skip magic trailing commas * isort should use same line length as black * Fix unused import * Update version of black used in CI * Update new packages * Update new packages
2023-01-18license year bump (#34921)Harmen Stoppels1-1/+1
* license bump year * fix black issues of modified files * mypy * fix 2021 -> 2023
2022-10-26Allow for packages with multiple build-systems (#30738)Massimiliano Culpo1-5/+7
This commit extends the DSL that can be used in packages to allow declaring that a package uses different build-systems under different conditions. It requires each spec to have a `build_system` single valued variant. The variant can be used in many context to query, manipulate or select the build system associated with a concrete spec. The knowledge to build a package has been moved out of the PackageBase hierarchy, into a new Builder hierarchy. Customization of the default behavior for a given builder can be obtained by coding a new derived builder in package.py. The "run_after" and "run_before" decorators are now applied to methods on the builder. They can also incorporate a "when=" argument to specify that a method is run only when certain conditions apply. For packages that do not define their own builder, forwarding logic is added between the builder and package (methods not found in one will be retrieved from the other); this PR is expected to be fully backwards compatible with unmodified packages that use a single build system.
2022-07-31black: reformat entire repository with blackTodd Gamblin1-18/+13
2022-05-28refactor: packages import `spack.package` explicitly (#30404)Tom Scogland1-1/+1
Explicitly import package utilities in all packages, and corresponding fallout. This includes: * rename `spack.package` to `spack.package_base` * rename `spack.pkgkit` to `spack.package` * update all packages in builtin, builtin_mock and tutorials to include `from spack.package import *` * update spack style * ensure packages include the import * automatically add the new import and remove any/all imports of `spack` and `spack.pkgkit` from packages when using `--fix` * add support for type-checking packages with mypy when SPACK_MYPY_CHECK_PACKAGES is set in the environment * fix all type checking errors in packages in spack upstream * update spack create to include the new imports * update spack repo to inject the new import, injection persists to allow for a deprecation period Original message below: As requested @adamjstewart, update all packages to use pkgkit. I ended up using isort to do this, so repro is easy: ```console $ isort -a 'from spack.pkgkit import *' --rm 'spack' ./var/spack/repos/builtin/packages/*/package.py $ spack style --fix ``` There were several line spacing fixups caused either by space manipulation in isort or by packages that haven't been touched since we added requirements, but there are no functional changes in here. * [x] add config to isort to make sure this is maintained going forward
2022-01-14Update copyright year to 2022Todd Gamblin1-1/+1
2021-09-20Allow setting variant name in AutotoolsPackage._activate_or_not (#26054)iarspider1-0/+2
2021-09-08url stats: add `--show-issues` option (#25792)Todd Gamblin1-1/+1
* tests: make `spack url [stats|summary]` work on mock packages Mock packages have historically had mock hashes, but this means they're also invalid as far as Spack's hash detection is concerned. - [x] convert all hashes in mock package to md5 or sha256 - [x] ensure that all mock packages have a URL - [x] ignore some special cases with multiple VCS fetchers * url stats: add `--show-issues` option `spack url stats` tells us how many URLs are using what protocol, type of checksum, etc., but it previously did not tell us which packages and URLs had the issues. This adds a `--show-issues` option to show URLs with insecure (`http`) URLs or `md5` hashes (which are now deprecated by NIST).
2021-01-02copyrights: update all files with license headers for 2021Todd Gamblin1-1/+1
- [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-11-26concretizer: allow a bool to be passed as argument for tests dependencies ↵Massimiliano Culpo1-0/+1
(#20082) refers #20079 Added docstrings to 'concretize' and 'concretized' to document the format for tests. Added tests for the activation of test dependencies.
2020-02-19Distributed builds (#13100)Tamara Dahlgren1-1/+3
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
2019-12-30copyright: update copyright dates for 2020 (#14328)Todd Gamblin1-1/+1
2019-05-24build env: simplify handling of parallel jobs (#11524)Massimiliano Culpo1-0/+2
This PR implements several refactors requested in #11373, specifically: - Config scopes are used to handle builtin defaults, command line overrides and package overrides (`parallel=False`) - `Package.make_jobs` attribute has been removed; `make_jobs` remains as a module-scope variable in the build environment. - The use of the argument `-j` has been rationalized across commands - move '-j'/'--jobs' argument into `spack.cmd.common.arguments` - Add unit tests to check that setting parallel jobs works as expected - add new test to ensure that build job setting is isolated to each build - Fix packages that used `Package.make_jobs` (i.e. `bazel`)
2019-01-04Multi-valued variants: better support for combinations (#9481)Massimiliano Culpo1-5/+2
This enforces conventions that allow for correct handling of multi-valued variants where specifying no value is an option, and adds convenience functionality for specifying multi-valued variants with conflicting sets of values. This also adds a notion of "feature values" for variants, which are those that are understood by the build system (e.g. those that would appear as configure options). In more detail: * Add documentation on variants to the packaging guide * Forbid usage of '' or None as a possible variant value, in particular as a default. To indicate choosing no value, the user must explicitly define an option like 'none'. Without this, multi-valued variants with default set to None were not parsable from the command line (Fixes #6314) * Add "disjoint_sets" function to support the declaration of multi-valued variants with conflicting sets of options. For example a variant "foo" with possible values "a", "b", and "c" where "c" is exclusive of the other values ("foo=a,b" and "foo=c" are valid but "foo=a,c" is not). * Add "any_combination_of" function to support the declaration of multi-valued variants where it is valid to choose none of the values. This automatically defines "none" as an option (exclusive with all other choices); this value does not appear when iterating over the variant's values, for example in "with_or_without" (which constructs autotools option strings from variant values). * The "disjoint_sets" and "any_combination_of" methods return an object which tracks the possible values. It is also possible to indicate that some of these values do not correspond to options understood by the package's build system, such that methods like "with_or_without" will not define options for those values (this occurs automatically for "none") * Add documentation for usage of new functions for specifying multi-valued variants
2019-01-01copyright: update license headers for 2013-2019 copyright.Todd Gamblin1-1/+1
2018-10-17relicense: replace LGPL headers with Apache-2.0/MIT SPDX headersTodd Gamblin1-23/+4
- 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-03-24Update copyright on LLNL files for 2018. (#7592)Todd Gamblin1-1/+1
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-11'with_or_without' accepts bool variantsMassimiliano Culpo1-0/+2
Fixes #4112 This commit extends the support of the AutotoolsPackage methods `with_or_without` and `enable_or_disable` to bool-valued variants. It also defines for those functions a convenience short-cut if the activation parameter is the prefix of a spec (like in `--with-{pkg}={prefix}`). This commit also includes: * Updates to viennarna and adios accordingly: they have been modified to use `enable_or_disable` and `with_or_without` * Improved docstrings in `autotools.py`. Raise `KeyError` if name is not a variant.
2017-09-06Update copyright notices for 2017 (#5295)Michael Kuhn1-1/+1
2017-08-07Variant satisfaction for indirect dependenciesscheibelp1-0/+1
Fixes #4898 Constraints that were supposed to be conditionally activated for specified values of a single-valued variant were being activated unconditionally in the case that the variant was associated with an implicit dependency. For example if X->Y->Z and Y places a conditional constraint on Z for a given single-valued variant on Y, then it would have been applied unconditionally when concretizing X.
2017-07-22Make testing spack commands simpler (#4868)Todd Gamblin1-1/+1
Adds SpackCommand class allowing Spack commands to be easily in Python Example usage: from spack.main import SpackCommand info = SpackCommand('info') out, err = info('mpich') print(info.returncode) This allows easier testing of Spack commands. Also: * Simplify command tests * Simplify mocking in command tests. * Simplify module command test * Simplify python command test * Simplify uninstall command test * Simplify url command test * SpackCommand uses more compatible output redirection
2017-06-24Make LICENSE recognizable by GitHub. (#4598)Todd Gamblin1-1/+1
2017-05-04SV variants are evaluated correctly in "when=" (#4118)Massimiliano Culpo1-0/+2
* SV variants are evaluated correctly in `when=` statements fixes #4113 The problem here was tricky: ```python spec.satisfies(other) ``` changes already the MV variants in others into SV variants (where necessary) if spec is concrete. If it is not concrete it does nothing because we may be acting at a pure syntactical level. When evaluating a `when=` keyword spec is for sure not concrete as it is in the middle of the concretization process. In this case we have to trigger manually the substitution in other to not end up comparing a MV variant "foo=bar" to a SV variant "foo=bar" and having False in return. Which is wrong. * sv variants: improved error message for typos in "when=" statements
2017-05-01Multi-valued variants (#2386)Massimiliano Culpo1-1/+31
Modifications: - added support for multi-valued variants - refactored code related to variants into variant.py - added new generic features to AutotoolsPackage that leverage multi-valued variants - modified openmpi to use new features - added unit tests for the new semantics
2016-08-10Spack packages now PEP8 compliant.Todd Gamblin1-0/+1
2016-05-11Correct LLNL LGPL license template for clarity.Todd Gamblin1-0/+24
2015-11-26New, cleaner package repository structure.Todd Gamblin1-0/+12
Package repositories now look like this: top-level-dir/ repo.yaml packages/ libelf/ package.py mpich/ package.py ... This leaves room at the top level for additional metadata, source, per-repo configs, indexes, etc., and it makes it easy to see that something is a spack repo (just look for repo.yaml and packages).