summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorGreg Becker <becker33@llnl.gov>2019-10-23 19:08:15 -0500
committerTodd Gamblin <tgamblin@llnl.gov>2019-10-23 17:08:15 -0700
commit8c7a3e55dda6a8f6a671805a76f2513f21f9d1cc (patch)
treebfc650efa7261b6347dd82937fb0e4fc1e926020 /var
parentf2ddffb8400934d6b2e975d359be22c1997d6863 (diff)
downloadspack-8c7a3e55dda6a8f6a671805a76f2513f21f9d1cc.tar.gz
spack-8c7a3e55dda6a8f6a671805a76f2513f21f9d1cc.tar.bz2
spack-8c7a3e55dda6a8f6a671805a76f2513f21f9d1cc.tar.xz
spack-8c7a3e55dda6a8f6a671805a76f2513f21f9d1cc.zip
add `spack dev-build` command; deprecate `spack diy` (#13374)
Rename the `spack diy` command to `spack dev-build` to make the use case clearer. The `spack diy` command has some useful functionality for developers using Spack to build their dependencies and configure/build/install the code they are developing. Developers do not notice it, partly because of the obscure name. The `spack dev-build` command has a `-u/--until PHASE` option to stop after a given phase of the build. This can be used to configure your project, run cmake on your project, or similarly stop after any stage of the build the user wants. These options are analogous to the existing `spack configure` and `spack build` commands, but for developer builds. To unify the syntax, we have deprecated the `spack configure` and `spack build` commands, and added a `-u/--until PHASE` option to the `spack install` command as well. The functionality in `spack dev-build` (specifically `spack dev-build -u cmake`) may be able to supersede the `spack setup` command, but this PR does not deprecate that command as that will require slightly more thought.
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin.mock/packages/dev-build-test-install/package.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/var/spack/repos/builtin.mock/packages/dev-build-test-install/package.py b/var/spack/repos/builtin.mock/packages/dev-build-test-install/package.py
new file mode 100644
index 0000000000..0eb9648941
--- /dev/null
+++ b/var/spack/repos/builtin.mock/packages/dev-build-test-install/package.py
@@ -0,0 +1,27 @@
+# Copyright 2013-2019 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 DevBuildTestInstall(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"
+
+ 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)