From 65a15c61458a9700940ff25210cfe2192856e4ac Mon Sep 17 00:00:00 2001 From: Chris Marsh Date: Tue, 30 Jul 2024 11:38:07 -0600 Subject: [PATCH] Mac OS UUID virtual: platform-specific virtuals not correctly prioritized (#43002) `apple-libuuid` includes types that aren't available in other `uuid` providers; this cause issues in consuming packages (e.g., py-matplotlib) that use SDKs like CarbonCore.framework when they attempt to use `util-linux-uuid` as a `uuid` provider on Mac OS. Tweak `util-linux-uuid` to indicate that it does not provide `uuid` on Mac OS. --- var/spack/repos/builtin/packages/libuuid/package.py | 5 ++++- var/spack/repos/builtin/packages/ossp-uuid/package.py | 5 ++++- var/spack/repos/builtin/packages/util-linux-uuid/package.py | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/var/spack/repos/builtin/packages/libuuid/package.py b/var/spack/repos/builtin/packages/libuuid/package.py index 0cc3f48ff604a7..1a0a2ebfcdc2ae 100644 --- a/var/spack/repos/builtin/packages/libuuid/package.py +++ b/var/spack/repos/builtin/packages/libuuid/package.py @@ -3,6 +3,8 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +import sys + from spack.package import * @@ -20,6 +22,7 @@ class Libuuid(AutotoolsPackage, SourceforgePackage): depends_on("c", type="build") # generated - provides("uuid") + if sys.platform not in ["darwin", "win32"]: + provides("uuid") conflicts("%gcc@14:") diff --git a/var/spack/repos/builtin/packages/ossp-uuid/package.py b/var/spack/repos/builtin/packages/ossp-uuid/package.py index 24029387f52186..1db80850dd70db 100644 --- a/var/spack/repos/builtin/packages/ossp-uuid/package.py +++ b/var/spack/repos/builtin/packages/ossp-uuid/package.py @@ -3,6 +3,8 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +import sys + from spack.package import * @@ -22,7 +24,8 @@ class OsspUuid(AutotoolsPackage): depends_on("c", type="build") # generated depends_on("cxx", type="build") # generated - provides("uuid") + if sys.platform not in ["darwin", "win32"]: + provides("uuid") @property def libs(self): diff --git a/var/spack/repos/builtin/packages/util-linux-uuid/package.py b/var/spack/repos/builtin/packages/util-linux-uuid/package.py index 4b8171e5ba4fab..554158491b030c 100644 --- a/var/spack/repos/builtin/packages/util-linux-uuid/package.py +++ b/var/spack/repos/builtin/packages/util-linux-uuid/package.py @@ -3,6 +3,8 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +import sys + from spack.package import * @@ -29,7 +31,8 @@ class UtilLinuxUuid(AutotoolsPackage): depends_on("pkgconfig", type="build") - provides("uuid") + if sys.platform not in ["darwin", "win32"]: + provides("uuid") def url_for_version(self, version): url = "https://www.kernel.org/pub/linux/utils/util-linux/v{0}/util-linux-{1}.tar.gz"