From 8c4117367803fac989582550fc546323e3586862 Mon Sep 17 00:00:00 2001 From: Patrick Gartung Date: Wed, 8 Jul 2020 15:05:58 -0500 Subject: Buildcache: bindist test without invoking spack compiler wrappers. (#15687) * Buildcache: * Try mocking an install of quux, corge and garply using prebuilt binaries * Put patchelf install after ccache restore * Add script to install patchelf from source so it can be used on Ubuntu:Trusty which does not have a patchelf pat package. The script will skip building on macOS * Remove mirror at end of bindist test * Add patchelf to Ubuntu build env * Revert mock patchelf package to allow other tests to run. * Remove depends_on('patchelf', type='build') relying instead on * Test fixture to ensure patchelf is available. * Call g++ command to build libraries directly during test build * Flake8 * Install patchelf in before_install stage using apt unless on Trusty where a build is done. * Add some symbolic links between packages * Flake8 * Flake8: * Update mock packages to write their own source files * Create the stage because spec search does not create it any longer * updates after change of list command arguments * cleanup after merge * flake8 --- .../repos/builtin.mock/packages/corge/package.py | 155 +++++++++++++++++++++ 1 file changed, 155 insertions(+) create mode 100644 var/spack/repos/builtin.mock/packages/corge/package.py (limited to 'var/spack/repos/builtin.mock/packages/corge/package.py') diff --git a/var/spack/repos/builtin.mock/packages/corge/package.py b/var/spack/repos/builtin.mock/packages/corge/package.py new file mode 100644 index 0000000000..48f9ac8e6e --- /dev/null +++ b/var/spack/repos/builtin.mock/packages/corge/package.py @@ -0,0 +1,155 @@ +# 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 * +import os + + +class Corge(Package): + """A toy package to test dependencies""" + + homepage = "https://www.example.com" + url = "https://github.com/gartung/corge/archive/v3.0.0.tar.gz" + + version('3.0.0', + sha256='5058861c3b887511387c725971984cec665a8307d660158915a04d7786fed6bc') + + depends_on('quux') + + def install(self, spec, prefix): + corge_cc = '''#include +#include +#include "corge.h" +#include "corge_version.h" +#include "quux/quux.h" + +const int Corge::version_major = corge_version_major; +const int Corge::version_minor = corge_version_minor; + +Corge::Corge() +{ +} + +int +Corge::get_version() const +{ + return 10 * version_major + version_minor; +} + +int +Corge::corgegate() const +{ + int corge_version = get_version(); + std::cout << "Corge::corgegate version " << corge_version + << " invoked" << std::endl; + std::cout << "Corge config directory = %s" < +#include "corge.h" + +int +main(int argc, char* argv[]) +{ + std::cout << "corgerator called with "; + if (argc == 0) { + std::cout << "no command-line arguments" << std::endl; + } else { + std::cout << "command-line arguments:"; + for (int i = 0; i < argc; ++i) { + std::cout << " \"" << argv[i] << "\""; + } + std::cout << std::endl; + } + std::cout << "corgegating.."<