From cd75e52ba2709e439a51cdad6970e49be99ea5ae Mon Sep 17 00:00:00 2001 From: Harmen Stoppels Date: Thu, 8 May 2025 18:52:35 +0200 Subject: [PATCH] yaml_cpp: do not import spack.spec (#50382) --- .../builtin/packages/yaml_cpp/package.py | 21 ++++++------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/var/spack/repos/spack_repo/builtin/packages/yaml_cpp/package.py b/var/spack/repos/spack_repo/builtin/packages/yaml_cpp/package.py index 930240bf931..cd8b3f2de89 100644 --- a/var/spack/repos/spack_repo/builtin/packages/yaml_cpp/package.py +++ b/var/spack/repos/spack_repo/builtin/packages/yaml_cpp/package.py @@ -3,7 +3,6 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack.package import * -from spack.spec import ConflictsInSpecError from ..boost.package import Boost @@ -57,20 +56,12 @@ def flag_handler(self, name, flags): # the user can add arbitrary strings to the flags. Here we can at least # fail early. # We'll include cppflags in case users mistakenly put c++ flags there. - spec = self.spec - if name in ("cxxflags", "cppflags") and spec.satisfies("+tests"): - if "-stdlib=libc++" in flags: - raise ConflictsInSpecError( - spec, - [ - ( - spec, - spec.compiler_flags[name], - spec.variants["tests"], - yaml_cpp_tests_libcxx_error_msg, - ) - ], - ) + if ( + name in ("cxxflags", "cppflags") + and self.spec.satisfies("+tests") + and "-stdlib=libc++" in flags + ): + raise InstallError(yaml_cpp_tests_libcxx_error_msg) return (flags, None, None) def cmake_args(self):