From 8c7a3e55dda6a8f6a671805a76f2513f21f9d1cc Mon Sep 17 00:00:00 2001 From: Greg Becker Date: Wed, 23 Oct 2019 19:08:15 -0500 Subject: 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. --- .../packages/dev-build-test-install/package.py | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 var/spack/repos/builtin.mock/packages/dev-build-test-install/package.py (limited to 'var/spack/repos/builtin.mock/packages/dev-build-test-install/package.py') 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) -- cgit v1.2.3-60-g2f50