From 6c9556ac19ab6475868da28c1a04de76e07427cb Mon Sep 17 00:00:00 2001 From: "Victor A. P. Magri" Date: Tue, 24 Feb 2026 12:06:21 -0500 Subject: [PATCH] Fix zlib issue --- scripts/spack_packages/packages/geosx/package.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/scripts/spack_packages/packages/geosx/package.py b/scripts/spack_packages/packages/geosx/package.py index 3bcac0cb..498f6b55 100644 --- a/scripts/spack_packages/packages/geosx/package.py +++ b/scripts/spack_packages/packages/geosx/package.py @@ -532,7 +532,20 @@ def geos_hostconfig(self, spec, prefix, py_site_pkgs_dir=None): for tpl, cmake_name, enable in io_tpls: if enable: - cfg.write(cmake_cache_entry('{}_DIR'.format(cmake_name), spec[tpl].prefix)) + dep_spec = None + if tpl == 'zlib': + # Spack may concretize zlib-api to zlib-ng instead of zlib. + for candidate in ('zlib', 'zlib-ng', 'zlib-api'): + try: + dep_spec = spec[candidate] + break + except KeyError: + pass + if dep_spec is None: + raise KeyError("No zlib provider (zlib/zlib-ng/zlib-api) found in {0}".format(spec)) + else: + dep_spec = spec[tpl] + cfg.write(cmake_cache_entry('{}_DIR'.format(cmake_name), dep_spec.prefix)) else: cfg.write(cmake_cache_option('ENABLE_{}'.format(cmake_name), False))