From 44681dbca51447142e28b8bf941ba74a7a08c3eb Mon Sep 17 00:00:00 2001 From: Michael Kuhn Date: Thu, 2 Jul 2020 09:45:41 +0200 Subject: autotools: Fix config.guess detection, take two (#17333) The previous fix from #17149 contained a thinko that produced errors for packages that overwrite configure_directory. --- lib/spack/spack/build_systems/autotools.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/spack/spack/build_systems/autotools.py b/lib/spack/spack/build_systems/autotools.py index 27a3ee7657..f07a2169ac 100644 --- a/lib/spack/spack/build_systems/autotools.py +++ b/lib/spack/spack/build_systems/autotools.py @@ -118,17 +118,15 @@ class AutotoolsPackage(PackageBase): config_file = 'config.{0}'.format(config_name) if os.path.exists(config_file): # First search the top-level source directory - my_config_files[config_name] = os.path.join( - self.configure_directory, config_file) + my_config_files[config_name] = os.path.abspath(config_file) else: # Then search in all sub directories recursively. # We would like to use AC_CONFIG_AUX_DIR, but not all packages # ship with their configure.in or configure.ac. config_path = next((os.path.join(r, f) - for r, ds, fs in os.walk( - self.configure_directory) for f in fs + for r, ds, fs in os.walk('.') for f in fs if f == config_file), None) - my_config_files[config_name] = config_path + my_config_files[config_name] = os.path.abspath(config_path) if my_config_files[config_name] is not None: try: -- cgit v1.2.3-70-g09d2 From 4e4de51f0d4ac7b08cb30e5d7de7ec726432fbca Mon Sep 17 00:00:00 2001 From: Michael Kuhn Date: Mon, 6 Jul 2020 19:53:02 +0200 Subject: autotools bugfix: handle missing config.guess (#17356) Spack was attempting to calculate abspath on the located config.guess path even when it was not found (None); this commit skips the abspath calculation when config.guess is not found. --- lib/spack/spack/build_systems/autotools.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/spack/spack/build_systems/autotools.py b/lib/spack/spack/build_systems/autotools.py index f07a2169ac..1ea238e2d1 100644 --- a/lib/spack/spack/build_systems/autotools.py +++ b/lib/spack/spack/build_systems/autotools.py @@ -123,10 +123,10 @@ class AutotoolsPackage(PackageBase): # Then search in all sub directories recursively. # We would like to use AC_CONFIG_AUX_DIR, but not all packages # ship with their configure.in or configure.ac. - config_path = next((os.path.join(r, f) + config_path = next((os.path.abspath(os.path.join(r, f)) for r, ds, fs in os.walk('.') for f in fs if f == config_file), None) - my_config_files[config_name] = os.path.abspath(config_path) + my_config_files[config_name] = config_path if my_config_files[config_name] is not None: try: -- cgit v1.2.3-70-g09d2 From afbb4a5cbade91d0b80e39ecbd98051bb8fd7628 Mon Sep 17 00:00:00 2001 From: Greg Becker Date: Thu, 9 Jul 2020 13:08:51 -0500 Subject: installation: skip repository metadata for externals (#16954) When Spack installs a package, it stores repository package.py files for it and all of its dependencies - any package with a Spack metadata directory in its installation prefix. It turns out this was too broad: this ends up including external packages installed by Spack (e.g. installed by another Spack instance). Currently Spack doesn't store the namespace properly for such packages, so even though the package file could be fetched from the external, Spack is unable to locate it. This commit avoids the issue by skipping any attempt to locate and copy from the package repository of externals, regardless of whether they have a Spack repo directory. --- lib/spack/spack/installer.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/spack/spack/installer.py b/lib/spack/spack/installer.py index a2b0220a8b..978296e051 100644 --- a/lib/spack/spack/installer.py +++ b/lib/spack/spack/installer.py @@ -405,9 +405,14 @@ def dump_packages(spec, path): source = spack.store.layout.build_packages_path(node) source_repo_root = os.path.join(source, node.namespace) - # There's no provenance installed for the source package. Skip it. - # User can always get something current from the builtin repo. - if not os.path.isdir(source_repo_root): + # If there's no provenance installed for the package, skip it. + # If it's external, skip it because it either: + # 1) it wasn't built with Spack, so it has no Spack metadata + # 2) it was built by another Spack instance, and we do not + # (currently) use Spack metadata to associate repos with externals + # built by other Spack instances. + # Spack can always get something current from the builtin repo. + if node.external or not os.path.isdir(source_repo_root): continue # Create a source repo and get the pkg directory out of it. -- cgit v1.2.3-70-g09d2 From c2393fe566ed5660fb11e297d14155916475bb84 Mon Sep 17 00:00:00 2001 From: Greg Becker Date: Fri, 10 Jul 2020 12:45:11 -0500 Subject: spack install: improve error message with no args (#17454) The error message was not updated when the behavior of Spack environments was changed to not automatically activate the local environment in #17258. The previous error message no longer makes sense. --- lib/spack/spack/cmd/install.py | 15 +++++++++++++-- lib/spack/spack/test/cmd/install.py | 24 ++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/spack/spack/cmd/install.py b/lib/spack/spack/cmd/install.py index 10eb3c327f..39bcc96ce5 100644 --- a/lib/spack/spack/cmd/install.py +++ b/lib/spack/spack/cmd/install.py @@ -268,7 +268,7 @@ environment variables: return if not args.spec and not args.specfiles: - # if there are no args but an active environment or spack.yaml file + # if there are no args but an active environment # then install the packages from it. env = ev.get_env(args, 'install') if env: @@ -289,7 +289,18 @@ environment variables: env.regenerate_views() return else: - tty.die("install requires a package argument or a spack.yaml file") + msg = "install requires a package argument or active environment" + if 'spack.yaml' in os.listdir(os.getcwd()): + # There's a spack.yaml file in the working dir, the user may + # have intended to use that + msg += "\n\n" + msg += "Did you mean to install using the `spack.yaml`" + msg += " in this directory? Try: \n" + msg += " spack env activate .\n" + msg += " spack install\n" + msg += " OR\n" + msg += " spack --env . install" + tty.die(msg) if args.no_checksum: spack.config.set('config:checksum', False, scope='command_line') diff --git a/lib/spack/spack/test/cmd/install.py b/lib/spack/spack/test/cmd/install.py index e4df22a6a5..9ffd166e37 100644 --- a/lib/spack/spack/test/cmd/install.py +++ b/lib/spack/spack/test/cmd/install.py @@ -746,3 +746,27 @@ def test_compiler_bootstrap_already_installed( # Test succeeds if it does not raise an error install('gcc@2.0') install('a%gcc@2.0') + + +def test_install_fails_no_args(tmpdir): + # ensure no spack.yaml in directory + with tmpdir.as_cwd(): + output = install(fail_on_error=False) + + # check we got the short version of the error message with no spack.yaml + assert 'requires a package argument or active environment' in output + assert 'spack env activate .' not in output + assert 'using the `spack.yaml` in this directory' not in output + + +def test_install_fails_no_args_suggests_env_activation(tmpdir): + # ensure spack.yaml in directory + tmpdir.ensure('spack.yaml') + + with tmpdir.as_cwd(): + output = install(fail_on_error=False) + + # check we got the long version of the error message with spack.yaml + assert 'requires a package argument or active environment' in output + assert 'spack env activate .' in output + assert 'using the `spack.yaml` in this directory' in output -- cgit v1.2.3-70-g09d2 From 1741279f16ffaae130142d08244c695c98e843a4 Mon Sep 17 00:00:00 2001 From: Peter Josef Scheibel Date: Thu, 9 Jul 2020 16:42:08 -0700 Subject: Bump version to 0.15.1; update CHANGELOG and version references --- CHANGELOG.md | 16 ++++++++++++++++ lib/spack/spack/__init__.py | 2 +- lib/spack/spack/container/images.json | 12 ++++++++---- lib/spack/spack/schema/container.py | 2 +- 4 files changed, 26 insertions(+), 6 deletions(-) (limited to 'lib') diff --git a/CHANGELOG.md b/CHANGELOG.md index e4050f3f9a..b7e4cc0ad3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,19 @@ +# v0.15.1 (2020-07-10) + +This minor release includes several important fixes: + +* Fix shell support on Cray (#17386) +* Fix use of externals installed with other Spack instances (#16954) +* Fix gcc+binutils build (#9024) +* Fixes for usage of intel-mpi (#17378 and #17382) +* Fixes to Autotools config.guess detection (#17333 and #17356) +* Update `spack install` message to prompt user when an environment is not + explicitly activated (#17454) + +This release also adds a mirror for all sources that are +fetched in Spack (#17077). It is expected to be useful when the +official website for a Spack package is unavailable. + # v0.15.0 (2020-06-28) `v0.15.0` is a major feature release. diff --git a/lib/spack/spack/__init__.py b/lib/spack/spack/__init__.py index 9bcf7c10bb..ceb1e256b1 100644 --- a/lib/spack/spack/__init__.py +++ b/lib/spack/spack/__init__.py @@ -5,7 +5,7 @@ #: major, minor, patch version for Spack, in a tuple -spack_version_info = (0, 15, 0) +spack_version_info = (0, 15, 1) #: String containing Spack version joined with .'s spack_version = '.'.join(str(v) for v in spack_version_info) diff --git a/lib/spack/spack/container/images.json b/lib/spack/spack/container/images.json index 84ae554339..e4761d4b40 100644 --- a/lib/spack/spack/container/images.json +++ b/lib/spack/spack/container/images.json @@ -12,7 +12,8 @@ "0.14.1": "0.14.1", "0.14.2": "0.14.2", "0.15": "0.15", - "0.15.0": "0.15.0" + "0.15.0": "0.15.0", + "0.15.1": "0.15.1" } }, "ubuntu:16.04": { @@ -28,7 +29,8 @@ "0.14.1": "0.14.1", "0.14.2": "0.14.2", "0.15": "0.15", - "0.15.0": "0.15.0" + "0.15.0": "0.15.0", + "0.15.1": "0.15.1" } }, "centos:7": { @@ -44,7 +46,8 @@ "0.14.1": "0.14.1", "0.14.2": "0.14.2", "0.15": "0.15", - "0.15.0": "0.15.0" + "0.15.0": "0.15.0", + "0.15.1": "0.15.1" } }, "centos:6": { @@ -60,7 +63,8 @@ "0.14.1": "0.14.1", "0.14.2": "0.14.2", "0.15": "0.15", - "0.15.0": "0.15.0" + "0.15.0": "0.15.0", + "0.15.1": "0.15.1" } } } diff --git a/lib/spack/spack/schema/container.py b/lib/spack/spack/schema/container.py index d204014dc6..36cb74a875 100644 --- a/lib/spack/spack/schema/container.py +++ b/lib/spack/spack/schema/container.py @@ -32,7 +32,7 @@ container_schema = { 'enum': [ 'develop', '0.14', '0.14.0', '0.14.1', '0.14.2', - '0.15', '0.15.0', + '0.15', '0.15.0', '0.15.1', ] } }, -- cgit v1.2.3-70-g09d2