From fbbd71d3d747feeae0199f85f3213a3bb4f5fdc7 Mon Sep 17 00:00:00 2001 From: Scott Wittenburg Date: Thu, 12 Nov 2020 11:46:15 -0700 Subject: [PATCH] Pipelines: Compare target family instead of architecture (#19884) In compiler bootstrapping pipelines, we add an artificial dependency between jobs for packages to be built with a bootstrapped compiler and the job building the compiler. To find the right bootstrapped compiler for each spec, we compared not only the compiler spec to that required by the package spec, but also the architectures of the compiler and package spec. But this prevented us from finding the bootstrapped compiler for a spec in cases where the architecture of the compiler wasn't exactly the same as the spec. For example, a gcc@4.8.5 might have bootstrapped a compiler with haswell as the architecture, while the spec had broadwell. By comparing the families instead of the architecture itself, we know that we can build the zlib for broadwell with the gcc for haswell. --- lib/spack/spack/ci.py | 18 +++++++++++++++++- lib/spack/spack/test/cmd/ci.py | 1 + 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/lib/spack/spack/ci.py b/lib/spack/spack/ci.py index 6c7a54a26a..c9054052e6 100644 --- a/lib/spack/spack/ci.py +++ b/lib/spack/spack/ci.py @@ -691,12 +691,19 @@ def generate_gitlab_ci_yaml(env, print_summary, output_file, # bootstrap spec lists, then we will add more dependencies to # the job (that compiler and maybe it's dependencies as well). if is_main_phase(phase_name): + spec_arch_family = (release_spec.architecture + .target + .microarchitecture + .family) compiler_pkg_spec = compilers.pkg_spec_for_compiler( release_spec.compiler) for bs in bootstrap_specs: bs_arch = bs['spec'].architecture + bs_arch_family = (bs_arch.target + .microarchitecture + .family) if (bs['spec'].satisfies(compiler_pkg_spec) and - bs_arch == release_spec.architecture): + bs_arch_family == spec_arch_family): # We found the bootstrap compiler this release spec # should be built with, so for DAG scheduling # purposes, we will at least add the compiler spec @@ -716,6 +723,15 @@ def generate_gitlab_ci_yaml(env, print_summary, output_file, str(bs_arch), build_group, enable_artifacts_buildcache)) + else: + debug_msg = ''.join([ + 'Considered compiler {0} for spec ', + '{1}, but rejected it either because it was ', + 'not the compiler required by the spec, or ', + 'because the target arch families of the ', + 'spec and the compiler did not match' + ]).format(bs['spec'], release_spec) + tty.debug(debug_msg) if enable_cdash_reporting: cdash_build_name = get_cdash_build_name( diff --git a/lib/spack/spack/test/cmd/ci.py b/lib/spack/spack/test/cmd/ci.py index 6de4b764ca..4e19cf384d 100644 --- a/lib/spack/spack/test/cmd/ci.py +++ b/lib/spack/spack/test/cmd/ci.py @@ -195,6 +195,7 @@ def test_ci_generate_bootstrap_gcc(tmpdir, mutable_mock_env_path, definitions: - bootstrap: - gcc@3.0 + - gcc@2.0 specs: - dyninst%gcc@3.0 mirrors: