Environments: specify packages for developer builds (#15256)
* allow environments to specify dev-build packages * spack develop and spack undevelop commands * never pull dev-build packges from bincache * reinstall dev_specs when code has changed; reinstall dependents too * preserve dev info paths and versions in concretization as special variant * move install overwrite transaction into installer * move dev-build argument handling to package.do_install now that specs are dev-aware, package.do_install can add necessary args (keep_stage=True, use_cache=False) to dev builds. This simplifies driving logic in cmd and env._install * allow 'any' as wildcard for variants * spec: allow anonymous dependencies raise an error when constraining by or normalizing an anonymous dep refactor concretize_develop to remove dev_build variant refactor tests to check for ^dev_path=any instead of +dev_build * fix variant class hierarchy
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
||||
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
#
|
||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
|
||||
class DependentOfDevBuild(Package):
|
||||
homepage = "example.com"
|
||||
url = "fake.com"
|
||||
|
||||
version('0.0.0', sha256='0123456789abcdefgh')
|
||||
|
||||
depends_on('dev-build-test-install')
|
||||
|
||||
def install(self, spec, prefix):
|
||||
with open(prefix.filename, 'w') as f:
|
||||
f.write("This file is installed")
|
@@ -0,0 +1,29 @@
|
||||
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
||||
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
#
|
||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
|
||||
class DevBuildTestDependent(Package):
|
||||
homepage = "example.com"
|
||||
url = "fake.com"
|
||||
|
||||
version('0.0.0', sha256='0123456789abcdefgh')
|
||||
|
||||
phases = ['edit', 'install']
|
||||
|
||||
filename = 'dev-build-test-file.txt'
|
||||
original_string = "This file should be edited"
|
||||
replacement_string = "This file has been edited"
|
||||
|
||||
depends_on('dev-build-test-install')
|
||||
|
||||
def edit(self, spec, prefix):
|
||||
with open(self.filename, 'r+') as f:
|
||||
assert f.read() == self.original_string
|
||||
f.seek(0)
|
||||
f.truncate()
|
||||
f.write(self.replacement_string)
|
||||
|
||||
def install(self, spec, prefix):
|
||||
install(self.filename, prefix)
|
Reference in New Issue
Block a user