From ec23e4ffe5af7f59c1cb7ad3c5485e83379f5a23 Mon Sep 17 00:00:00 2001 From: Greg Becker Date: Wed, 22 Apr 2020 14:26:29 -0700 Subject: update compiler config with bootstrapped compiler when already installed (#16221) Update compiler config with bootstrapped compiler when it was already installed and added config defaults to code so mutable_config test fixture works. --- .../repos/builtin.mock/packages/gcc/package.py | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 var/spack/repos/builtin.mock/packages/gcc/package.py (limited to 'var') diff --git a/var/spack/repos/builtin.mock/packages/gcc/package.py b/var/spack/repos/builtin.mock/packages/gcc/package.py new file mode 100644 index 0000000000..03b45a6e12 --- /dev/null +++ b/var/spack/repos/builtin.mock/packages/gcc/package.py @@ -0,0 +1,23 @@ +# 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) + +from spack import * + + +class Gcc(Package): + """Simple compiler package.""" + + homepage = "http://www.example.com" + url = "http://www.example.com/gcc-1.0.tar.gz" + + version('1.0', '0123456789abcdef0123456789abcdef') + version('2.0', '2.0_a_hash') + + def install(self, spec, prefix): + # Create the minimal compiler that will fool `spack compiler find` + mkdirp(prefix.bin) + with open(prefix.bin.gcc, 'w') as f: + f.write('#!/bin/bash\necho "%s"' % str(spec.version)) + set_executable(prefix.bin.gcc) -- cgit v1.2.3-70-g09d2