Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deploy: merge upstream 0.16.3 #1305

Merged
merged 143 commits into from
Sep 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
143 commits
Select commit Hold shift + click to select a range
d6bd95d
py-ipykernel: fix install (#19617)
ax3l Nov 18, 2020
c42ce43
hip support for umpire, chai, raja, camp (#19715)
dtaller Nov 18, 2020
38cf4f9
fix error handling for spack test results command (#19987)
becker33 Nov 19, 2020
cda34ba
py-ipykernel: fix bug in phase method (#19986)
adamjstewart Nov 19, 2020
508534a
recognize macOS 11.1 as big sur (#20038)
aumuell Nov 23, 2020
ad84351
Docs: remove duplication in Command Reference (#20021)
adamjstewart Nov 23, 2020
8e1b5f7
concretizer: treat conditional providers correctly (#20086)
alalazo Nov 25, 2020
0ae4982
concretizer: allow a bool to be passed as argument for tests dependen…
alalazo Nov 26, 2020
b326d59
concretizer: prioritize matching compilers over newer versions (#20020)
alalazo Nov 26, 2020
d7ffdd7
concretizer: treat target ranges in directives correctly (#19988)
alalazo Nov 27, 2020
9628386
Typos: add missing closing parens (#20174)
hartzell Nov 30, 2020
22d7937
concretizer: swap priority of selecting provider and default variant …
alalazo Dec 1, 2020
1e1a6f4
concretizer: remove ad-hoc rule for external packages (#20193)
alalazo Dec 1, 2020
0b7a22d
spec: return early from concretization if a spec is already concrete …
alalazo Dec 1, 2020
24fb43c
Fixes compile time errors (#20006)
MichaelLaufer Dec 1, 2020
598c25b
concretizer: don't optimize emitting version_satisfies() (#20128)
aweits Dec 2, 2020
63d75cd
boost: disable find_package's config mode for boost prior to v1.70.0 …
alalazo Dec 2, 2020
571e367
Fix hipcc once more (#20095)
haampie Dec 2, 2020
b78cc5b
concretizer: try hard to infer the real version of compilers (#20099)
alalazo Dec 2, 2020
92de484
concretizer: call inject_patches_variants() on the roots of the specs…
aweits Dec 3, 2020
30290ac
avoid circular import (#20236)
becker33 Dec 3, 2020
b4f79f3
environment installs: fix reporting. (#20004)
matz-e Dec 3, 2020
a6d433b
concretizer: restrict maximizing variant values to MV variants (#20194)
alalazo Dec 4, 2020
ecfba13
concretizer: each external version is allowed by definition (#20247)
alalazo Dec 6, 2020
9499dc4
VTK-m: update to specify correct requirements to kokkos (#20097)
Dec 7, 2020
0e725f0
concretizer: refactor handling of special variants dev_build and patches
tgamblin Dec 6, 2020
30a9e64
bugfix: work around issue handling packages not in any repo
alalazo Dec 7, 2020
ab3f1b1
concretizer: try hard to obtain all needed variant_possible_value()'s…
aweits Dec 8, 2020
802c5bd
Tests: enable re-use of post-install tests in smoke tests (#20298)
tldahlgren Dec 10, 2020
27f6b3d
concretizer: remove clingo command-line driver (#20362)
tgamblin Dec 14, 2020
bf3a873
package sanity: ensure all variant defaults are allowed values (#20373)
alalazo Dec 15, 2020
12d035b
concretizer: don't use one_of_iff for range constraints (#20383)
tgamblin Dec 15, 2020
378af92
Fix comparisons for abstract specs (#20341)
becker33 Dec 15, 2020
d82d2bb
unit-tests: ensure that installed packages can be reused (#20307)
alalazo Dec 17, 2020
18c5f10
ci: fixes for compiler bootstrapping (#17563)
scottwittenburg Dec 18, 2020
a4066a5
asp: memoize the list of all target_specs to speed-up setup phase (#2…
alalazo Dec 19, 2020
d0dfd3c
concretizer: add #defined statements to avoid warnings.
tgamblin Dec 14, 2020
ea617f8
concretizer: pull _develop_specs_from_env out of main setup loop
tgamblin Dec 14, 2020
6c6631c
concretizer: spec_clauses should traverse dependencies
tgamblin Dec 14, 2020
ff9ee9f
concretizer: move conditional dependency logic into `concretize.lp`
tgamblin Dec 16, 2020
02e0ea6
concretizer: avoid redundant grounding on dependency types
alalazo Dec 16, 2020
364c5b6
concretizer: emit facts for constraints on imposed dependencies
alalazo Dec 16, 2020
ab3f53d
concretizer: emit facts for integrity constraints
alalazo Dec 17, 2020
cb76c5a
concretizer: fix failing unit tests
alalazo Dec 17, 2020
4bbc6ee
concretizer: optimized loop on node platforms
alalazo Dec 21, 2020
acd523c
concretizer: optimize loop on compiler version
alalazo Dec 21, 2020
1a1babe
concretizer: refactor conditional rules to be less repetitious (#20507)
tgamblin Dec 22, 2020
290043b
Add Intel oneAPI packages (#20411)
rscohn2 Dec 23, 2020
f719512
bugfix: do not write empty default dicts/lists in envs (#20526)
becker33 Dec 24, 2020
ec42016
concretizer: generate facts for externals
alalazo Dec 29, 2020
56acb5a
bugfix: infinite loop when building a set from incomplete specs (#20649)
tgamblin Jan 4, 2021
9bb0375
concretizer: more detailed section headers in concretize.lp
tgamblin Dec 23, 2020
66376ab
concretizer: make _condtion_id_counter an iterator
tgamblin Dec 28, 2020
6056cb7
concretizer: consolidate handling of virtuals into spec_clauses
tgamblin Dec 28, 2020
247e73e
concretizer: convert virtuals to facts; move all rules to `concretize…
tgamblin Dec 31, 2020
8f85ab8
concretizer: remove rule generation code from concretizer
tgamblin Dec 31, 2020
9393d97
concretizer: simplify handling of virtual version constraints
tgamblin Jan 3, 2021
8e442d6
concretizer: use consistent naming for compiler predicates (#20677)
tgamblin Jan 5, 2021
ddd9c86
concretizer: make rules on virtual packages more linear
alalazo Jan 5, 2021
d0594ba
Remove hard-coded standard C++ library selection and add more release…
ye-luo Jan 6, 2021
41e7293
fix mpi lib paths, add virtual provides (#20693)
rscohn2 Jan 6, 2021
7e5f728
intel-oneapi-compilers package: correct module file (#20686)
frankwillmore Jan 6, 2021
1df8e1d
intel-oneapi-mpi: virtual provider support (#20732)
rscohn2 Jan 8, 2021
c99850d
restore ability of dev-build to skip patches (#20351)
robertu94 Jan 12, 2021
ffa8479
libyogrt: remove conflicts triggered by an invalid value (#20794)
alalazo Jan 12, 2021
7162e15
concretizer: dependency conditions cannot hold if package is external
alalazo Jan 12, 2021
488a08b
concretizer: require at least a dependency type to say the dependency…
alalazo Jan 12, 2021
58d167b
py-hovorod: fix typo on variant name in conflicts directive (#20906)
henrique Jan 14, 2021
cdd86bd
[WIP] relocate.py: parallelize test replacement logic (#19690)
nhanford Jan 20, 2021
1802205
store sbang_install_path in buildinfo, use for subsequent relocation …
eugeneswalker Jan 20, 2021
40d3289
Print groups properly for spack find -d (#20028)
lrtfm Jan 29, 2021
e1dc4ba
llvm: "master" branch is now "main" branch (#21411)
eugeneswalker Feb 1, 2021
240726a
add intel oneapi to compiler/pkg translations (#21448)
becker33 Feb 2, 2021
805b412
adding environment to OneMKL packages so that examples will build (#2…
frankwillmore Feb 3, 2021
863f455
intel-oneapi-compilers: add to LD_LIBRARY_PATH so that it finds libi…
frankwillmore Feb 3, 2021
2607bc5
intel-oneapi-compilers/mpi: add module support (#20808)
frankwillmore Feb 4, 2021
3256f01
apple-clang: add correct path to compiler wrappers (#21662)
adamjstewart Feb 17, 2021
d079816
Resolve (post-cherry-picking) flake8 errors
tldahlgren Feb 19, 2021
8dd2d74
Update CHANGELOG and release version
tldahlgren Feb 19, 2021
a3714b3
updates for new tutorial
becker33 Apr 15, 2021
393a105
update tutorial public key
becker33 Apr 15, 2021
8c05387
respect -k/verify-ssl-false in _existing_url method (#21864)
becker33 Feb 22, 2021
566becb
use package supplied autogen.sh (#20319)
ptooley Feb 23, 2021
a59fcd6
Python 3.10 support: collections.abc (#20441)
adamjstewart Feb 1, 2021
94bb37c
concretizer: simplify "fact" method (#21148)
alalazo Feb 3, 2021
8d13193
Improve error message for inconsistencies in package.py (#21811)
alalazo Feb 23, 2021
14e1793
Updates to support clingo-cffi (#20657)
joshessman-llnl Feb 23, 2021
2a4d2f9
Run clingo-cffi tests in a container (#21913)
alalazo Feb 24, 2021
0678d5d
repo: generalize "swap" context manager to also accept paths
alalazo Jan 31, 2021
4e5e1e8
Move context manager to swap the current store into spack.store
alalazo Feb 1, 2021
f30fc6c
Move context manager to swap the current configuration into spack.config
alalazo Feb 1, 2021
095ace9
bugfix for target adjustments on target ranges (#20537)
becker33 Jan 5, 2021
2a5f46d
Added a context manager to swap architectures
alalazo Feb 2, 2021
bd9929f
make `spack fetch` work with environments (#19166)
healther Feb 26, 2021
316c292
clingo: prefer master branch
tgamblin Dec 21, 2020
add339c
Clingo: fix missing import (#21364)
adamjstewart Jan 28, 2021
0b5c5b8
clingo: added a package with option for bootstrapping clingo (#20652)
alalazo Jan 29, 2021
68ef6fc
clingo: fix typo (#22444)
maxim-belkin Mar 21, 2021
6c1b348
clingo-bootstrap: account for cray platform (#22460)
alalazo Mar 22, 2021
16f7a02
Bootstrap clingo from sources (#21446)
alalazo Mar 3, 2021
f1c7402
bootstrap: account for platform specific configuration scopes (#22489)
alalazo Mar 23, 2021
a823cff
concretizer: unify logic for spec conditionals
tgamblin Jan 3, 2021
9717e02
bugfix: do not generate dep conditions when no dependency
tgamblin Feb 10, 2021
4d148a4
bugfix: allow imposed constraints to be overridden in special cases
tgamblin Mar 14, 2021
61e619b
spack location: bugfix for out of source build dirs (#22348)
haampie Mar 17, 2021
31a07f9
Channelflow: Fix the package. (#22483)
RemiLacroix-IDRIS Mar 23, 2021
b11dd04
Make SingleFileScope able to repopulate the cache after clearing it (…
alalazo Mar 26, 2021
e7494b6
ASP-based solver: model disjoint sets for multivalued variants (#22534)
alalazo Mar 26, 2021
18880a6
clingo: modify recipe for bootstrapping (#22354)
alalazo Mar 26, 2021
9f99e8a
Externals are preferred even when they have non-default variant values
alalazo Mar 27, 2021
6e71480
Enforce uniqueness of the version_weight atom per node
alalazo Mar 26, 2021
a5213da
bugfix for active when pkg is already active error (#22587)
cyrush Mar 30, 2021
c8a10e4
Fix clearing cache of InternalConfigScope (#22609)
haampie Mar 30, 2021
cbd5533
Bootstrap: add _builtin config scope (#22610)
haampie Mar 30, 2021
43cea1b
Bootstrapping: swap store before configuration (#22631)
alalazo Mar 30, 2021
2496c7b
Remove erroneous warnings about quotes for from_source_file (#22767)
adamjstewart Apr 6, 2021
5546b22
"spack build-env" searches env for relevant spec (#21642)
scheibelp Feb 23, 2021
2655e21
ASP-based solver: assign OS correctly with inheritance from parent (#…
alalazo Apr 11, 2021
f1f94ad
Externals with merged prefixes (#22653)
scheibelp Apr 12, 2021
8a7bfe9
ASP-based solver: suppress warnings when constructing facts (#23090)
alalazo Apr 21, 2021
0d173bb
Use Python's built-in machinery to import compilers (#23290)
alalazo May 4, 2021
4a7581e
Add "spack [cd|location] --source-dir" (#22321)
haampie Mar 29, 2021
fb27c7a
spack location: fix usage without args (#22755)
haampie Apr 6, 2021
13fed37
Import hooks using Python's built-in machinery (#23288)
alalazo Apr 27, 2021
30dd612
ASP-based solver: no intermediate package for concretizing together (…
alalazo May 6, 2021
76c5a02
ASP-based solve: minimize compiler mismatches (#23016)
alalazo Apr 21, 2021
818664d
performance: speed up existence checks in packages (#23661)
tgamblin May 17, 2021
80f0c78
Style fixes for v0.16.2 release
alalazo May 21, 2021
f1fe03c
Update CHANGELOG and release version for v0.16.2
tgamblin May 22, 2021
c699e90
Update command to setup tutorial (#24488)
alalazo Jun 24, 2021
9120856
Fix fetching for Python 3.9.6 (#24686)
adamjstewart Jul 3, 2021
6b0c775
clang/llvm: fix version detection (#19978)
michaelkuhn Nov 19, 2020
0f48608
Fix use of quotes in Python build system (#22279)
adamjstewart Mar 15, 2021
7f29dd2
Cray: fix extracting paths from module files (#23472)
haampie May 20, 2021
2ae92eb
Use AWS CloudFront for source mirror (#23978)
tgamblin May 28, 2021
77e633e
locks: only open lockfiles once instead of for every lock held (#24794)
tgamblin Aug 24, 2021
0e85d70
Ensure all roots of an installed environment are marked explicit in d…
becker33 Jun 12, 2021
073c92d
docker: Fix CentOS 6 build on Docker Hub (#24804)
alalazo Jul 9, 2021
aebc8f6
docker: remove boto3 from CentOS 6 since it requires and updated pip…
alalazo Jul 10, 2021
4cd6381
Remove centos:6 image references
haampie Sep 21, 2021
7caa844
Fix style tests
haampie Sep 17, 2021
3b55c2e
Bump version and update changelog
haampie Sep 17, 2021
5961b61
Merge remote-tracking branch 'origin/releases/v0.16' into merge-da-up…
matz-e Sep 23, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@
#
[flake8]
ignore = E129,E221,E241,E272,E731,W503,W504,F999,N801,N813,N814
max-line-length = 79
max-line-length = 88

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 🌔

💎 🙌

1 change: 0 additions & 1 deletion .github/workflows/linux_unit_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ jobs:
- uses: codecov/codecov-action@v1
with:
flags: unittests,linux,${{ matrix.concretizer }}

shell:
runs-on: ubuntu-latest
steps:
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# v0.16.3 (2021-09-21)

* clang/llvm: fix version detection (#19978)
* Fix use of quotes in Python build system (#22279)
* Cray: fix extracting paths from module files (#23472)
* Use AWS CloudFront for source mirror (#23978)
* Ensure all roots of an installed environment are marked explicit in db (#24277)
* Fix fetching for Python 3.8 and 3.9 (#24686)
* locks: only open lockfiles once instead of for every lock held (#24794)
* Remove the EOL centos:6 docker image


# v0.16.2 (2021-05-22)

* Major performance improvement for `spack load` and other commands. (#23661)
Expand Down
2 changes: 1 addition & 1 deletion etc/spack/defaults/mirrors.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
mirrors:
spack-public: https://spack-llnl-mirror.s3-us-west-2.amazonaws.com/
spack-public: https://mirror.spack.io
3 changes: 0 additions & 3 deletions lib/spack/docs/containers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,6 @@ are currently supported are summarized in the table below:
* - Ubuntu 18.04
- ``ubuntu:18.04``
- ``spack/ubuntu-bionic``
* - CentOS 6

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

- ``centos:6``
- ``spack/centos6``
* - CentOS 7
- ``centos:7``
- ``spack/centos7``
Expand Down
147 changes: 127 additions & 20 deletions lib/spack/llnl/util/lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,126 @@
true_fn = lambda: True


class OpenFile(object):
"""Record for keeping track of open lockfiles (with reference counting).

There's really only one ``OpenFile`` per inode, per process, but we record the
filehandle here as it's the thing we end up using in python code. You can get
the file descriptor from the file handle if needed -- or we could make this track
file descriptors as well in the future.
"""
def __init__(self, fh):
self.fh = fh
self.refs = 0


class OpenFileTracker(object):
"""Track open lockfiles, to minimize number of open file descriptors.

The ``fcntl`` locks that Spack uses are associated with an inode and a process.
This is convenient, because if a process exits, it releases its locks.
Unfortunately, this also means that if you close a file, *all* locks associated
with that file's inode are released, regardless of whether the process has any
other open file descriptors on it.

Because of this, we need to track open lock files so that we only close them when
a process no longer needs them. We do this by tracking each lockfile by its
inode and process id. This has several nice properties:

1. Tracking by pid ensures that, if we fork, we don't inadvertently track the parent
process's lockfiles. ``fcntl`` locks are not inherited across forks, so we'll
just track new lockfiles in the child.
2. Tracking by inode ensures that referencs are counted per inode, and that we don't
inadvertently close a file whose inode still has open locks.
3. Tracking by both pid and inode ensures that we only open lockfiles the minimum
number of times necessary for the locks we have.

Note: as mentioned elsewhere, these locks aren't thread safe -- they're designed to
work in Python and assume the GIL.
"""

def __init__(self):
"""Create a new ``OpenFileTracker``."""
self._descriptors = {}

def get_fh(self, path):
"""Get a filehandle for a lockfile.

This routine will open writable files for read/write even if you're asking
for a shared (read-only) lock. This is so that we can upgrade to an exclusive
(write) lock later if requested.

Arguments:
path (str): path to lock file we want a filehandle for
"""
# Open writable files as 'r+' so we can upgrade to write later
os_mode, fh_mode = (os.O_RDWR | os.O_CREAT), 'r+'

pid = os.getpid()
open_file = None # OpenFile object, if there is one
stat = None # stat result for the lockfile, if it exists

try:
# see whether we've seen this inode/pid before
stat = os.stat(path)
key = (stat.st_ino, pid)
open_file = self._descriptors.get(key)

except OSError as e:
if e.errno != errno.ENOENT: # only handle file not found
raise

# path does not exist -- fail if we won't be able to create it
parent = os.path.dirname(path) or '.'
if not os.access(parent, os.W_OK):
raise CantCreateLockError(path)

# if there was no already open file, we'll need to open one
if not open_file:
if stat and not os.access(path, os.W_OK):
# we know path exists but not if it's writable. If it's read-only,
# only open the file for reading (and fail if we're trying to get
# an exclusive (write) lock on it)
os_mode, fh_mode = os.O_RDONLY, 'r'

fd = os.open(path, os_mode)
fh = os.fdopen(fd, fh_mode)
open_file = OpenFile(fh)

# if we just created the file, we'll need to get its inode here
if not stat:
inode = os.fstat(fd).st_ino
key = (inode, pid)

self._descriptors[key] = open_file

open_file.refs += 1
return open_file.fh

def release_fh(self, path):
"""Release a filehandle, only closing it if there are no more references."""
try:
inode = os.stat(path).st_ino
except OSError as e:
if e.errno != errno.ENOENT: # only handle file not found
raise
inode = None # this will not be in self._descriptors

key = (inode, os.getpid())
open_file = self._descriptors.get(key)
assert open_file, "Attempted to close non-existing lock path: %s" % path

open_file.refs -= 1
if not open_file.refs:
del self._descriptors[key]
open_file.fh.close()


#: Open file descriptors for locks in this process. Used to prevent one process
#: from opening the sam file many times for different byte range locks
file_tracker = OpenFileTracker()


def _attempts_str(wait_time, nattempts):
# Don't print anything if we succeeded on the first try
if nattempts <= 1:
Expand All @@ -46,7 +166,8 @@ class Lock(object):
Note that this is for managing contention over resources *between*
processes and not for managing contention between threads in a process: the
functions of this object are not thread-safe. A process also must not
maintain multiple locks on the same file.
maintain multiple locks on the same file (or, more specifically, on
overlapping byte ranges in the same file).
"""

def __init__(self, path, start=0, length=0, default_timeout=None,
Expand Down Expand Up @@ -151,25 +272,10 @@ def _lock(self, op, timeout=None):

# Create file and parent directories if they don't exist.
if self._file is None:
parent = self._ensure_parent_directory()
self._ensure_parent_directory()
self._file = file_tracker.get_fh(self.path)

# Open writable files as 'r+' so we can upgrade to write later
os_mode, fd_mode = (os.O_RDWR | os.O_CREAT), 'r+'
if os.path.exists(self.path):
if not os.access(self.path, os.W_OK):
if op == fcntl.LOCK_SH:
# can still lock read-only files if we open 'r'
os_mode, fd_mode = os.O_RDONLY, 'r'
else:
raise LockROFileError(self.path)

elif not os.access(parent, os.W_OK):
raise CantCreateLockError(self.path)

fd = os.open(self.path, os_mode)
self._file = os.fdopen(fd, fd_mode)

elif op == fcntl.LOCK_EX and self._file.mode == 'r':
if op == fcntl.LOCK_EX and self._file.mode == 'r':
# Attempt to upgrade to write lock w/a read-only file.
# If the file were writable, we'd have opened it 'r+'
raise LockROFileError(self.path)
Expand Down Expand Up @@ -282,7 +388,8 @@ def _unlock(self):
"""
fcntl.lockf(self._file, fcntl.LOCK_UN,
self._length, self._start, os.SEEK_SET)
self._file.close()

file_tracker.release_fh(self.path)
self._file = None
self._reads = 0
self._writes = 0
Expand Down
2 changes: 1 addition & 1 deletion lib/spack/spack/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


#: major, minor, patch version for Spack, in a tuple
spack_version_info = (0, 16, 2)
spack_version_info = (0, 16, 3)

#: String containing Spack version joined with .'s
spack_version = '.'.join(str(v) for v in spack_version_info)
Expand Down
6 changes: 3 additions & 3 deletions lib/spack/spack/compilers/clang.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,11 @@ def extract_version_from_output(cls, output):

match = re.search(
# Normal clang compiler versions are left as-is
r'clang version ([^ )]+)-svn[~.\w\d-]*|'
r'clang version ([^ )\n]+)-svn[~.\w\d-]*|'
# Don't include hyphenated patch numbers in the version
# (see https://github.com/spack/spack/pull/14365 for details)
r'clang version ([^ )]+?)-[~.\w\d-]*|'
r'clang version ([^ )]+)',
r'clang version ([^ )\n]+?)-[~.\w\d-]*|'
r'clang version ([^ )\n]+)',
output
)
if match:
Expand Down
7 changes: 0 additions & 7 deletions lib/spack/spack/container/images.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@
"build_tags": {
"develop": "latest"
}
},
"centos:6": {
"os_package_manager": "yum",
"build": "spack/centos6",
"build_tags": {
"develop": "latest"
}
}
},
"os_package_managers": {
Expand Down
7 changes: 7 additions & 0 deletions lib/spack/spack/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -1421,6 +1421,13 @@ def install_all(self, args=None, **install_args):
# DB read transaction to reduce time spent in this case.
specs_to_install = self.uninstalled_specs()

# ensure specs already installed are marked explicit
all_specs = [cs for _, cs in self.concretized_specs()]
specs_installed = [s for s in all_specs if s.package.installed]
with spack.store.db.write_transaction(): # do all in one transaction
for spec in specs_installed:
spack.store.db.update_explicit(spec, True)

if not specs_to_install:
tty.msg('All of the packages are already installed')
return
Expand Down
3 changes: 1 addition & 2 deletions lib/spack/spack/schema/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
'type': 'string',
'enum': ['ubuntu:18.04',
'ubuntu:16.04',
'centos:7',
'centos:6']
'centos:7']
},
'spack': {
'type': 'string',
Expand Down
21 changes: 21 additions & 0 deletions lib/spack/spack/test/cmd/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,27 @@ def test_env_install_single_spec(install_mockery, mock_fetch):
assert e.specs_by_hash[e.concretized_order[0]].name == 'cmake-client'


def test_env_roots_marked_explicit(install_mockery, mock_fetch):
install = SpackCommand('install')
install('dependent-install')

# Check one explicit, one implicit install
dependent = spack.store.db.query(explicit=True)
dependency = spack.store.db.query(explicit=False)
assert len(dependent) == 1
assert len(dependency) == 1

env('create', 'test')
with ev.read('test') as e:
# make implicit install a root of the env
e.add(dependency[0].name)
e.concretize()
e.install_all()

explicit = spack.store.db.query(explicit=True)
assert len(explicit) == 2


def test_env_modifications_error_on_activate(
install_mockery, mock_fetch, monkeypatch, capfd):
env('create', 'test')
Expand Down
6 changes: 5 additions & 1 deletion lib/spack/spack/test/compilers/detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,11 @@ def test_apple_clang_version_detection(
('clang version 8.0.0-3 (tags/RELEASE_800/final)\n'
'Target: aarch64-unknown-linux-gnu\n'
'Thread model: posix\n'
'InstalledDir: /usr/bin\n', '8.0.0')
'InstalledDir: /usr/bin\n', '8.0.0'),
('clang version 11.0.0\n'
'Target: aarch64-unknown-linux-gnu\n'
'Thread model: posix\n'
'InstalledDir: /usr/bin\n', '11.0.0')
])
def test_clang_version_detection(version_str, expected_version):
version = spack.compilers.clang.Clang.extract_version_from_output(
Expand Down
6 changes: 6 additions & 0 deletions lib/spack/spack/test/module_parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,9 @@ def test_get_argument_from_module_line():
for bl in bad_lines:
with pytest.raises(ValueError):
get_path_args_from_module_line(bl)


def test_lmod_quote_parsing():
lines = ['setenv("SOME_PARTICULAR_DIR","-L/opt/cray/pe/mpich/8.1.4/gtl/lib")']
result = get_path_from_module_contents(lines, 'some-module')
assert '/opt/cray/pe/mpich/8.1.4/gtl' == result
10 changes: 7 additions & 3 deletions lib/spack/spack/util/module_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,13 @@ def match_pattern_and_strip(line, pattern, strip=[]):
def match_flag_and_strip(line, flag, strip=[]):
flag_idx = line.find(flag)
if flag_idx >= 0:
end = line.find(' ', flag_idx)
if end >= 0:
path = line[flag_idx + len(flag):end]
# Search for the first occurence of any separator marking the end of
# the path.
separators = (' ', '"', "'")
occurrences = [line.find(s, flag_idx) for s in separators]
indices = [idx for idx in occurrences if idx >= 0]
if indices:
path = line[flag_idx + len(flag):min(indices)]
else:
path = line[flag_idx + len(flag):]
path = strip_path(path, strip)
Expand Down
Loading