summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)AuthorFilesLines
2021-12-23Bump version and update CHANGELOG.mdMassimiliano Culpo1-1/+1
2021-12-23locks: allow locks to work under high contention (#27846)Tom Scogland1-3/+6
* locks: allow locks to work under high contention This is a bug found by Harshitha Menon. The `lock=None` line shouldn't be a release but should be ``` return (lock_type, None) ``` to inform the caller it couldn't get the lock type requested without disturbing the existing lock object in the database. There were also a couple of bugs due to taking write locks at the beginning without any checking or release, and not releasing read locks before requeueing. This version no longer gives me read upgrade to write errors, even running 200 instances on one box. * Change lock in check_deps_status to read, release if not installed, not sure why this was ever write, but read definitely is more appropriate here, and the read lock is only held out of the scope if the package is installed. * Release read lock before requeueing to reduce chance of livelock, the timeout that caused the original issue now happens in roughly 3 of 200 workers instead of 199 on average.
2021-12-23Regenerate views when specs already installed (#28113)Harmen Stoppels1-4/+2
With this commit: ``` $ spack env activate --temp $ spack install zlib ==> All of the packages are already installed ==> Updating view at /tmp/spack-faiirgmt/.spack-env/view $ spack install zlib ==> All of the packages are already installed ``` Before this PR: ``` $ spack env activate --temp $ spack install zlib ==> All of the packages are already installed $ spack install zlib ==> All of the packages are already installed ``` No view was generated
2021-12-23sbang: respect package permissive package permissions for sbang (#25764)Paul Spencer2-12/+96
Co-authored-by: Todd Gamblin <tgamblin@llnl.gov> Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com>
2021-12-23Add setdefault option to tcl module (#14686)victorusu4-18/+69
This commit introduces the command spack module tcl setdefault <package> similar to the one already available for lmod Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2021-12-23Set backup=False by default in filter_file (#28036)Harmen Stoppels1-1/+1
2021-12-23Fix table formatting (#28037)Harmen Stoppels1-1/+1
2021-12-23Revert "patches: make re-applied patches idempotent (#26784)" (#27625)Harmen Stoppels4-137/+25
This reverts commit c5ca0db27fce5d772dc8a4fcffec3b62bb0bf1f3.
2021-12-23MANPATH needs a trailing ':' to utilize system defaults (#21682)Andrew W Elble2-1/+22
otherwise spack breaks using system man pages by default. Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
2021-12-23Added opensuse/leap:15 to spack containerize (#27837)Christian Goll2-0/+21
Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2021-12-23Provide meaningful message for empty environment installs (#28031)Tamara Dahlgren2-9/+26
* Provide a meaningful failure message for installation of an empty environment * Allow regenerating view per offline discussion
2021-12-23Add option to minimize full debug cores. include warning message about ↵Greg Becker4-21/+73
performance (#27970) Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
2021-12-23Install dir creation message demoted to "debug" level (#27911)Harmen Stoppels1-2/+1
2021-12-23Improve debug info from concretizer (#27707)Greg Becker2-2/+33
2021-12-23spack audit: fix API calls (#27713)Massimiliano Culpo1-4/+4
This broke in #24858
2021-12-23Handle byte sequences which are not encoded as UTF8 while logging. (#21447)Paul Ferrell1-1/+6
Fix builds which produce a lines with non-UTF8 output while logging The alternative is to read in binary mode, and then decode while ignoring errors.
2021-12-23ci: run style unit tests only if we target develop (#27472)Harmen Stoppels2-2/+17
Some tests assume the base branch is develop, but this branch may not have been checked out.
2021-12-23Turn some verbose messages into debug messages (#27408)Harmen Stoppels1-8/+8
2021-12-23Fix overloaded argparse keys (#27379)Harmen Stoppels5-15/+14
Commands should not reuse option names defined in main.
2021-12-23Fix log-format reporter ignoring install errors (#25961)Jordan Galby3-31/+48
When running `spack install --log-format junit|cdash ...`, install errors were ignored. This made spack continue building dependents of failed install, ignoring `--fail-fast`, and exit 0 at the end.
2021-12-23make --enable-locks actually enable locks (#24675)Dylan Simon1-2/+3
2021-11-05bump version number to 0.17.0Todd Gamblin2-2/+2
2021-11-05Prevent additional properties to be in the answer set when reusing specs ↵Massimiliano Culpo3-1/+42
(#27240) * Prevent additional properties to be in the answer set when reusing specs fixes #27237 The mechanism to reuse concrete specs relies on imposing the set of constraints stemming from the concrete spec being reused. We also need to prevent that other constraints get added to this set.
2021-11-05make version docs reflect reality (#27149)Harmen Stoppels1-26/+30
* make version docs reflect reality * typo and make things * 2.6 -> 2.7 in example
2021-11-05commands: `spack load --list` alias for `spack find --loaded` (#27184)Todd Gamblin4-10/+50
See #25249 and https://github.com/spack/spack/pull/27159#issuecomment-958163679. This adds `spack load --list` as an alias for `spack find --loaded`. The new command is not as powerful as `spack find --loaded`, as you can't combine it with all the queries or formats that `spack find` provides. However, it is more intuitively located in the command structure in that it appears in the output of `spack load --help`. The idea here is that people can use `spack load --list` for simple stuff but fall back to `spack find --loaded` if they need more. - add help to `spack load --list` that references `spack find` - factor some parts of `spack find` out to be called from `spack load` - add shell tests - update docs Co-authored-by: Peter Josef Scheibel <scheibel1@llnl.gov> Co-authored-by: Richarda Butler <39577672+RikkiButler20@users.noreply.github.com>
2021-11-05docs for experimental `--reuse` argument to `spack install`Todd Gamblin1-0/+28
Add docs for `--reuse`, along with a warning that it will likely be removed and refactored.
2021-11-05error message for reusing multiple hashes for packageGregory Becker1-1/+2
2021-11-05concretizer: add error messages and simplify asp.pyTodd Gamblin2-8/+18
2021-11-05Fix logic program for multi-valued variantsMassimiliano Culpo1-45/+71
Reformulate variant rules so that we minimize both 1. The number of non-default values being used 2. The number of default values not-being used This is crucial for MV variants where we may have more than one default value
2021-11-05bugfix: handle hashes that only exist in input specsTodd Gamblin1-27/+48
In our tests, we use concrete specs generated from mock packages, which *only* occur as inputs to the solver. This fixes two problems: 1. We weren't previously adding facts to encode the necessary `depends_on()` relationships, and specs were unsatisfiable on reachability. 2. Our hash lookup for reconstructing the DAG does not consider that a hash may have come from the inputs.
2021-11-05concretizer: exempt already-installed specs from compiler and variant rulesTodd Gamblin2-7/+22
Concrete specs that are already installed or that come from a buildcache may have compilers and variant settings that we do not recognize, but that shouldn't prevent reuse (at least not until we have a more detailed compiler model). - [x] make sure compiler and variant consistency rules only apply to built specs - [x] don't validate concrete specs on input, either -- they're concrete and we shouldn't apply today's rules to yesterday's build
2021-11-05spack diff: more flexible tests, restore transitive diff with spec_clausesTodd Gamblin3-12/+39
In switching to hash facts for concrete specs, we lost the transitive facts from dependencies. This was fine for solves, because they were implied by the imposed constraints from every hash. However, for `spack diff`, we want to see what the hashes mean, so we need another mode for `spec_clauses()` to show that. This adds a `expand_hashes` argument to `spec_clauses()` that allows us to output *both* the hashes and their implications on dependencies. We use this mode in `spack diff`.
2021-11-05Add a missing definition in the logic programMassimiliano Culpo1-0/+1
2021-11-05Add buildcache to reusable specsMassimiliano Culpo4-16/+51
2021-11-05spack install: add --reuse argumentMassimiliano Culpo2-4/+6
2021-11-05spack concretize: add --reuse argumentMassimiliano Culpo4-16/+35
2021-11-05spack spec: add --reuse argumentMassimiliano Culpo4-16/+33
2021-11-05concretizer: get rid of last maximize directive in concretize.lpTodd Gamblin1-32/+5
- [x] Get rid of forgotten maximize directive. - [x] Simplify variant handling - [x] Fix bug in treatment of defaults on externals (don't count non-default variants on externals against them)
2021-11-05Trim dependencies on externalsMassimiliano Culpo1-1/+2
2021-11-05Fix a unit test to match the new OS semanticsMassimiliano Culpo1-1/+1
CNL, debian6 and Suse are not compatible
2021-11-05ASP-based solve: if an OS is set, respect the valueMassimiliano Culpo1-0/+3
2021-11-05Fix a type in "variant_not_default" ruleMassimiliano Culpo1-1/+1
2021-11-05concretizer: rework spack solve output to handle reuse betterTodd Gamblin3-75/+137
2021-11-05spec: ensure_valid_variants() should not validate concrete specsTodd Gamblin1-0/+4
Variants in concrete specs are "always" correct -- or at least we assume them to be b/c they were concretized before. Their variants need not match the current version of the package.
2021-11-05concretizer: unify handling of single- and multi-valued variantsTodd Gamblin1-18/+5
Multi-valued variants previously maximized default values to handle cases where the default contained two values, e.g.: variant("foo", default="bar,baz") This is because previously we were minimizing non-default values, and `foo=bar`, `foo=baz`, and `foo=bar,baz` all had the same score, as none of them had any "non-default" values. This commit changes the approach and considers a non-default value to be either a value set to something not default *or* the absence of a default value from the set value. This allows multi- and single-valued variants to be handled the same way, with the same minimization criterion. It alse means that the "best" value for every optimization criterion is now zero, which allows us to make useful assumptions about the optimization criteria.
2021-11-05concretizer: reuse installs, but assign default values for new buildsTodd Gamblin1-35/+119
Minimizing builds is tricky. We want a minimizing criterion because we want to reuse the avaialble installs, but we also want things that have to be built to stick to *default preferences* from the package and from the user. We therefore treat built specs differently and apply a different set of optimization criteria to them. Spack's *first* priority is to reuse what it can, but if it builds something, the built specs will respect defaults and preferences. This is implemented by bumping the priority of optimization criteria for built specs -- so that they take precedence over the otherwise topmost-priority criterion to reuse what is installed. The scheme relies on all of our optimization criteria being minimizations. That is, we need the case where all specs are reused to be better than any built spec could be. Basically, if nothing is built, all the build criteria are zero (the best possible) and the number of built packages dominates. If something *has* to be built, it must be strictly worse than full reuse, because: 1. it increases the number of built specs 2. it must have either zero or some positive number for all criteria Our optimziation criteria effectively sum into two buckets at once to accomplish this. We use a `build_priority()` number to shift the priority of optimization criteria for built specs higher.
2021-11-05tests: make `spack diff` test more lenientTodd Gamblin1-4/+12
The constraints in the `spack diff` test were very specific and assumed a lot about the structure of what was being diffed. Relax them a bit to make them more resilient to changes.
2021-11-05concretizer: only minimize builds when `--reuse` is enabled.Todd Gamblin2-1/+4
Make the first minimization conditional on whether `--reuse` is enabled in the solve. If `--reuse` is not enabled, there will be nothing in the set to minimize and the objective function (for this criterion) will be 0 for every answer set.
2021-11-05concretizer: adjust integrity constraints to only apply to builds.Todd Gamblin1-6/+13
Many of the integrity constraints in the concretizer are there to restrict how solves are done, but they ignore that past solves may have had different initial conditions. For example, for things we're building, we want the allowed variants to be restricted to those currently in Spack packages, but if we are reusing a concrete spec, we need to be flexible about names that may have existed in old packages. Similarly, restrictions around compatibility of OS's, compiler versions, compiler OS support, etc. are really only about what is supported by the *current* set of compilers/build tools known to Spack, not about what we may get from concrete specs. - [x] restrict certain integrity constraints to only apply to packages that we need to build, and omit concrete specs from consideration.
2021-11-05concretizer: rework operating system semantics for installed packagesTodd Gamblin2-64/+104
The OS logic in the concretizer is still the way it was in the first version. Defaults are implemented in a fairly inflexible way using straight logic. Most of the other sections have been reworked to leave these kinds of decisions to optimization. This commit does that for OS's as well. As with targets, we optimize for target matches. We also try to optimize for OS matches between nodes. Additionally, this commit adds the notion of "OS compatibility" where we allow for builds to depend on binaries for certain other OS's. e.g, for macos, a bigsur build can depend on an already installed (concrete) catalina build. One cool thing about this is that we can declare additional compatible OS's later, e.g. CentOS and RHEL.