Commit graph

5538 commits

Author SHA1 Message Date
Joseph Snyder
64b41b012c
Bug/fix credentials s3 buildcache update (#31391)
* Add connection information to buildcache update command

Ensure that the s3 connection made when attempting to update the content
of a buildcache attempts to use the extra connection information
from the mirror creation.

* Add unique help for endpoint URL argument

Fix copy/paste error for endpoint URL help which was the same as
the access token

* Re-work URL checking for S3 mirrors

Due to the fact that nested bucket URLs would never match the string used
for checking that the mirror is the same, switch the check used.

Sort all mirror URLs by length to have the most specific cases first
and see if the desired URL "starts with" the mirror URL.

* Long line style fixes

Add execptions for long lines and fix other style errors

* Use format() function to rebuild URL

Use the format command to rebuild the url instead of crafing a
formatted string out of known values

* Add early exit for URL checking

When a valid mirror is found, break from the loop
2022-07-14 20:49:46 +00:00
Todd Gamblin
3d0347ddd3
Deprecate blacklist/whitelist in favor of include/exclude (#31569)
For a long time the module configuration has had a few settings that use
`blacklist`/`whitelist` terminology. We've been asked by some of our users to replace
this with more inclusive language. In addition to being non-inclusive, `blacklist` and
`whitelist` are inconsistent with the rest of Spack, which uses `include` and `exclude`
for the same concepts.

- [x] Deprecate `blacklist`, `whitelist`, `blacklist_implicits` and `environment_blacklist`
      in favor of `exclude`, `include`, `exclude_implicits` and `exclude_env_vars` in module
      configuration, to be removed in Spack v0.20.
- [x] Print deprecation warnings if any of the deprecated names are in module config.
- [x] Update tests to test old and new names.
- [x] Update docs.
- [x] Update `spack config update` to fix this automatically, and include a note in the error
      that you can use this command.
2022-07-14 20:42:33 +00:00
Peter Scheibel
7741bfb7d1
Decompression: use tar exe vs. built-in Python tarfile support (#31563)
Python's built-in tarfile support doesn't address some general
cases of malformed tarfiles that are already handled by the system
'tar' utility; until these can be addressed, use that exclusively.
2022-07-13 14:12:21 -07:00
Massimiliano Culpo
7f2b5e8e57
spack.repo.get() can only be called on concrete specs (#31411)
The goal of this PR is to make clearer where we need a package object in Spack as opposed to a package class.

We currently instantiate a lot of package objects when we could make do with a class.  We should use the class
when we only need metadata, and we should only instantiate and us an instance of `PackageBase` at build time.

Modifications:
- [x] Remove the `spack.repo.get` convenience function (which was used in many places, and not really needed)
- [x] Use `spack.repo.path.get_pkg_class` wherever possible
- [x] Try to route most of the need for `spack.repo.path.get` through `Spec.package`
- [x] Introduce a non-data descriptor, that can be used as a decorator, to have "class level properties"
- [x] Refactor unit tests that had to be modified to reduce code duplication
- [x] `Spec.package` and `Repo.get` now require a concrete spec as input
- [x] Remove `RepoPath.all_packages` and `Repo.all_packages`
2022-07-12 19:45:24 -04:00
Harmen Stoppels
ea91e8f4ca
file_cache.py: idempotent remove without races (#31477)
There's a race condition in `remove()` as the lockfile is removed after
releasing the lock, which is a problem when another process acquires a
write lock during deletion.

Also simplify life a bit in multiprocessing when a file is possibly
removed multiple times, which currently is an error on the second
deletion, so the proposed fix is to make remove(...) idempotent and not
error when deleting non-existing cache entries.

Don't tests for existence of lockfile, cause windows/linux behavior is different
2022-07-12 15:03:48 +00:00
Harmen Stoppels
74e2625dcf
compression.py: buffered copy (#31533) 2022-07-12 16:49:59 +02:00
Harmen Stoppels
b2c519470b
environment.py: only acquire write lock when necessary (#31493) 2022-07-12 16:12:43 +02:00
Harmen Stoppels
d904a789d5
env depfile: add missing touch (#31494)
Oversight in #31433, the non-phony `env` target was missing a file being
created for it, which can cause make to infinitely loop when including
multiple generated makefiles.
2022-07-12 14:16:31 +02:00
Massimiliano Culpo
89b8d33d05
Remove os.getcwd from function signature (#31480)
fixes #29730

This is also wrong since it binds the directory at the time
of module import, rather than the one at the time of function
call.
2022-07-12 10:08:37 +02:00
Jonathon Anderson
25f198aa91
Sanitize ownership when extracting tarfiles (#31524) 2022-07-12 09:28:24 +02:00
Adam J. Stewart
5bd1074afb
py-hatchling: add new packages, document new build backend (#31512)
* py-hatchling: add new package, document new build backend

* Minor doc changes

Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com>

Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com>
2022-07-11 16:23:28 -07:00
Cory Bloor
bb92ea59a2
Fix spack edit message when no editor installed (#31412)
When no default editor is installed and no environment variable is set,
which_string would return None and this would be passed to os.execv
resulting in a TypeError. The message presented to the user would be:

    Error: execv: path should be string, bytes or os.PathLike,
    not NoneType

This change checks that which_string has returned successfully before
attempting to execute the result, resulting in a new error message:

    Error: No text editor found! Please set the VISUAL and/or EDITOR
    environment variable(s) to your preferred text editor.

It's not strictly necessary, but I've also changed try_exec to catch
all errors rather than just OSErrors. This would have provided slightly
more context for the original error message.
2022-07-07 17:08:15 +02:00
Tamara Dahlgren
1b919d306f
Documentation: Add SourceforgePackage to the build systems docs (#31473) 2022-07-07 14:30:22 +02:00
Vanessasaurus
6b1e86aecc
removing feature bloat: monitor and analyzers (#31130)
Signed-off-by: vsoch <vsoch@users.noreply.github.com>

Co-authored-by: vsoch <vsoch@users.noreply.github.com>
2022-07-07 00:49:40 -06:00
Tamara Dahlgren
e68ed3268b
Testing Bugfix: refactor clean --python-cache to support all (#31449)
There were two choices: 1) remove '-p' from '-a' or 2) allow monkeypatching
the cleaning of the python cache since clean's test_function_calls isn't
supposed to be actually cleaning anything.

This commit supports the latter and adds a test case for `-p`.
2022-07-06 11:44:41 -07:00
Harmen Stoppels
dac31ef3c4
Remove fetch from depfile (#31433) 2022-07-05 14:48:32 +02:00
Alberto Invernizzi
bb3a663392
ROCmPackage: unify amdgpu_targets (#30582)
* unify amdgpu_targets for rocsolver and rocblas

* add more archs

* adapt all roc packages to unified amdgpu_targets
2022-07-05 14:33:30 +02:00
Scott Wittenburg
87b8321fa9
gitlab: Fix pipeline generation for non-develop protected pipelines (#31378)
Release branches and tags run protected pipelines, and we noticed
that those pipelines were generating all jobs in the stack, even
when the mirror contained all the built specs and an up to date
index.  The problem was caused because the override mirror was
not present in spacks mirror configuration at the time when the
binary_distribution.update() method was called.  This fixes that
by always adding the mirror override, if present, to the list of
configured mirrors.
2022-07-01 11:56:36 -07:00
Peter Scheibel
abeee9e1fd
Cray manifest: compiler duplicates (#31173)
* remove unhelpful comment
* Filter compiler duplicates while reading manifest
* more-specific version matching edited to use module-specific version (to avoid an issue where a user might add a compiler with the same version to the initial test configuration
2022-06-29 17:05:29 -07:00
Adam J. Stewart
93c16f1ee3
PythonPackage: add default libs/headers attributes (#28527)
* PythonPackage: add default libs/headers attributes

* Style fix

* libs and headers should be properties

* Check both platlib and include

* Fix variable reference
2022-06-29 11:55:24 -07:00
Massimiliano Culpo
557abe04ec
Update containerize templates to account for view indirection (#31321)
fixes #30965
2022-06-29 15:39:18 +02:00
Wouter Deconinck
8f7f96ae2b
oneAPI supports cxx17_flag and cxx20_flag (#31274) 2022-06-28 10:33:19 +02:00
Greg Becker
df44045fdb
Feature: use git branches/tags as versions (#31200)
Building on #24639, this allows versions to be prefixed by `git.`. If a version begins `git.`, it is treated as a git ref, and handled as git commits are starting in the referenced PR.

An exception is made for versions that are `git.develop`, `git.main`, `git.master`, `git.head`, or `git.trunk`. Those are assumed to be greater than all other versions, as those prefixed strings are in other contexts.
2022-06-28 01:54:41 +00:00
Sergey Kosukhin
7fc68240fe
oneapi-* packages: improve use with modules (#30981)
This commit adds some changes which improve use of Spack-installed
oneAPI packages with Spack-generated modules, but not within Spack
(e.g. if you install some of these packages with Spack, then load
their associated modules to build other packages outside of Spack).

The majority of the PR diff is refactoring. The functional changes
are:

* intel-oneapi-mkl:
  * setup_run_environment: update Intel compiler flags to RPATH the
    mkl libs
* intel-oneapi-compilers: update the compiler configuration to RPATH
  libraries installed by this package (note that Spack already handled
  this when installing dependent packages with Spack, but this is
  specifically to use the intel-oneapi-compilers package outside
  of Spack). Specifically:
  * inject_rpaths: this modifies the binaries installed as part of
    the intel-oneapi-compilers package to RPATH libraries provided
    by this package
  * extend_config_flags: this instructs the compiler executables
    provided by this package to RPATH those same libraries

Refactoring includes:

* intel-oneapi-compilers: in addition to the functional changes,
  a large portion of this diff is reorganizing the creation of
  resources/archives downloaded for the install
* The base oneAPI package renamed component_path, so several packages
  changed as a result:
  * intel-oneapi-dpl
  * intel-oneapi-dnn
  * extrae
* intel-oneapi-mpi:
  * Perform file filtering in one pass rather than two
2022-06-27 16:34:15 -07:00
Peter Scheibel
f7ef064bdc
spack external find: handle manifest with bad permissions (#31201)
Allow `spack external find` (with no extra args) to proceed if the manifest file exists but
without sufficient permissions; in that case, print a warning. Also add a test for that behavior.

TODOs:

- [x] continue past any exception raised during manifest parsing as part of `spack external find`, 
      except for CTRL-C (and other errors that indicate immediate program termination)
- [x] Semi-unrelated but came up when discussing this with the user who reported this issue to
      me: the manifest parser now accepts older schemas 

See: https://github.com/spack/spack/issues/31191
2022-06-27 19:26:12 +00:00
Massimiliano Culpo
11d71ca85e
Rename os_facts.lp to os_compatibility.lp (#31206)
Follow-up from #31170
2022-06-27 09:15:25 -07:00
Cody Balos
147f39d7aa
Fix typo in documentation note about concretizer:unify (#31246) 2022-06-24 11:31:43 +02:00
Massimiliano Culpo
70650cacbd
ASP-based solver: rescale target weights so that 0 is always the best score (#31226)
fixes #30997

Instead of giving a penalty of 30 to all nodes when preferences
are not package specific, give a penalty of 100 to all targets
of a node where we have package specific preferences, if the target
is not explicitly preferred.
2022-06-23 23:33:36 -07:00
eugeneswalker
7ef52acfce
relocation: x-pie-executable needs relocation (#31248) 2022-06-22 23:55:28 +00:00
Adam J. Stewart
ef278c601c
spack create: fix for no URL (#31239) 2022-06-22 18:45:03 +00:00
Massimiliano Culpo
55cac3b098
Remove update functions used to ease the transition in v0.16 (#31216) 2022-06-22 11:15:57 +02:00
Massimiliano Culpo
649760dc1a
Canonicalize positional argument to spack bootstrap mirror (#31180)
fixes #31139
2022-06-21 19:25:01 +02:00
Massimiliano Culpo
aebb601b70
Stricter compatibility rules for OS and compiler when reusing specs (#31170)
* Stricter compatibility rules for OS and compiler when reusing specs
* Add unit test
2022-06-20 17:32:13 -07:00
Christian Goll
0fe57962b3
OpenSUSE Tumbleweed: use GLIBC version as distro version (#19895)
Tumbleweed is a rolling release that would have used a date 
as a version instead.
2022-06-20 22:20:31 +02:00
Sam Broderick
760a12c440
Fix request for bzip2, since bzip was pulled due to patent issues (#31198) 2022-06-20 08:13:20 +00:00
Brian Van Essen
15c35a3cff
Bugfix external find --all for libraries (#31186)
* Fixed a bug in the 'external find --all' command where the call failed
to find packages by both executable and library. The bug was that the
call `path.all_packages()` incorrectly turned the variable
`packages_to_check` into a generator rather than keeping it a list.
Thus the second call to `detection.by_library` had no work to do.

* Fixed the help message for the find external and compiler commands as
well as others that used the `scopes_metavar` field to define where
the results should be stored in configuration space.  Specifically,
the fact that configuration could be added to the environment was not
mentioned in the help message.
2022-06-17 21:52:06 +00:00
Massimiliano Culpo
13b609b4b6
docs: quote string to show valid YAML (#31178)
fixes #31167
2022-06-17 18:25:52 +02:00
Chuck Atkins
85dc20cb55
Spec: Add a new virtual-customizable home attribute (#30917)
* Spec: Add a new virtual-customizable home attribute

* java: Use the new builtin home attribute

* python: Use the new builtin home attribute
2022-06-17 10:29:08 -04:00
Robert Cohn
466572dc14
Update Intel package descriptions (#31150) 2022-06-17 09:23:40 +02:00
Massimiliano Culpo
267358a799
ASP-based solver: fix rules on version weights selection (#31153)
* ASP: sort and deduplicate version weights from installed specs

* Pick version weights according to provenance

* Add unit test
2022-06-16 14:17:40 -07:00
Peter Scheibel
392b548312
Manifest parsing: avoid irrelevant files (#31144)
* Manifest directory may not contain manifest files: exclude non-manifest files
* Manifest files use different name for rocmcc: add translation for it
2022-06-16 15:16:48 -05:00
Massimiliano Culpo
895ceeda38
concretize.lp: impose a lower bound on the number of version facts if a solution exists (#31142)
* concretize.lp: impose a lower bound on the number of version facts if a valid version exists

fixes #30864

* Add a unit test
2022-06-16 09:25:56 -07:00
Tom Scogland
b261b2a5ff
Allow bootstrapping to work when partial or incompatible modules exist in the module path (#31035) 2022-06-15 19:09:07 +02:00
G-Ragghianti
bf6220821b
Make the IntelPackage fail successfully (#30773)
Co-authored-by: Robert Cohn <rscohn2@gmail.com>
2022-06-14 15:06:06 +02:00
Jordan Galby
e50d08ce48
Fix spack style arbitrary git rev as base (#31019)
Allow `spack style -b @` or `spack style -b origin/develop` to work as
expected.

Regression since spack 0.17 #25085
2022-06-13 15:22:35 +00:00
Danny McClanahan
0c7fd9bd8c
fix doubly shell quoting args to spack spec (#29282)
* add test to verify fix works
* fix spec cflags/variants parsing test (breaking change)
* fix `spack spec` arg quoting issue
* add error report for deprecated cflags coalescing
* use .group(n) vs subscript regex group extraction for 3.5 compat
* add random test for untested functionality to pass codecov
* fix new test failure since rebase
2022-06-11 12:35:46 -07:00
Todd Gamblin
bf2b30a5f5
bugfix: preserve dict order for Spec.dag_hash() in Python 2 (#31092)
Fix a bug introduced in #21720. `spack_json.dump()` calls `_strify()` on dictionaries to
convert `unicode` to `str`, but it constructs `dict` objects instead of
`collections.OrderedDict` objects, so in Python 2 (or earlier versions of 3) it can
scramble dictionary order.

This can cause hashes to differ between Python 2 and Python 3, or between Python 3.7
and earlier Python 3's.

- [x] use `OrderedDict` in `_strify`
- [x] add a regression test
2022-06-10 20:32:35 -07:00
Sergey Kosukhin
a2afd5b82f
clingo: fix string formatting in error messages (#31084) 2022-06-10 16:24:27 +00:00
Tim Fuller
01f8236bf5
Allow more fine-grained control over what submodules are updated (#27293)
The "submodules" argument of the "version" directive can now accept
a callable that returns a list of submodules, in addition to the usual
Boolean values
2022-06-09 07:45:49 +02:00
Massimiliano Culpo
d245c46487
bootstrap: account for disabled sources (#31042)
* bootstrap: account for disabled sources

Fix a bug introduced in #30192, which effectively skips
any prescription on disabled bootstrapping sources.

* Add unit test to avoid regression
2022-06-08 07:17:37 -06:00