Skip to content

netcdf-c: depends on curl#871

Merged
johnwparent merged 3 commits intospack:developfrom
Chrismarsh:package-fix/netcdf-c_curl
Sep 22, 2025
Merged

netcdf-c: depends on curl#871
johnwparent merged 3 commits intospack:developfrom
Chrismarsh:package-fix/netcdf-c_curl

Conversation

@Chrismarsh
Copy link
Copy Markdown
Contributor

@Chrismarsh Chrismarsh commented Jul 30, 2025

Even though netcdf-c is only supposed to depend on curl when +dap, it doesn't correctly do this until 4.9.3

Unidata/netcdf-c#3016

Unidata/netcdf-c#2907
Unidata/netcdf-c#3018

This looks to impact both autotools and cmake builds.

@skosukhin @WardF

@skosukhin
Copy link
Copy Markdown
Member

I don't know about Cmake but we don't need this for Autotools.

@Chrismarsh
Copy link
Copy Markdown
Contributor Author

Given the PR Unidata/netcdf-c#3018 specifically notes fixing the autotools build, I'm unclear why you say the spack autotools build doesn't need this fix.

@skosukhin
Copy link
Copy Markdown
Member

config_args.append("ac_cv_lib_curl_curl_easy_setopt=no")

@skosukhin
Copy link
Copy Markdown
Member

And no, they didn't fix it.

@Chrismarsh
Copy link
Copy Markdown
Contributor Author

I haven't had a chance to try 4.9.3 via #69 yet, but are you saying that 4.9.3's inclusion of Unidata/netcdf-c#2907 and Unidata/netcdf-c#3018 is insufficient to solve the problem?

I've narrowed the depends to only be applicable to the cmake side of things

Comment thread repos/spack_repo/builtin/packages/netcdf_c/package.py Outdated
@Chrismarsh Chrismarsh requested a review from alalazo July 30, 2025 18:42
@alalazo alalazo dismissed their stale review July 30, 2025 18:43

Waiting for a final review by @skosukhin

@skosukhin
Copy link
Copy Markdown
Member

In many cases, the configure script of the package doesn't care what options the user specified on the command line: it just overrides them and continues, which makes it very hard to catch the edge cases. This also applies to the newly introduced --disable-curl. Even if we disable the "option", it gets enabled when --enable-nczarr, although the latter doesn't need curl.

@Chrismarsh
Copy link
Copy Markdown
Contributor Author

Is the zarr w/ S3 support not handled in the autotools like it is in cmake?

If you're pretty convinced the edge cases aren't sufficiently captured by the CMakeLists, would you prefer that this fix removes the 4.9.3 version bound? Or are you ok with how it is now?

@skosukhin
Copy link
Copy Markdown
Member

skosukhin commented Jul 30, 2025

  1. I'm sorry, I don't feel responsible for the CMake builder of the package. As long as the Autotools part is unaffected, I don't have any opinion.
  2. We don't deliver the S3 part of the package. We would need a variant for that, I guess.

@Chrismarsh
Copy link
Copy Markdown
Contributor Author

I will test the CMake side again with 4.9.3 when #69 is merged. For now, I will keep the version bound with the expectation that it was fixed.

@bernhardkaindl
Copy link
Copy Markdown
Contributor

I will test the CMake side again with 4.9.3 when #69 is merged. For now, I will keep the version bound with the expectation that it was fixed.
@Chrismarsh, #69 is merged now.

@Chrismarsh Chrismarsh force-pushed the package-fix/netcdf-c_curl branch from 761e72a to 6c5b502 Compare August 11, 2025 16:54
Copy link
Copy Markdown
Contributor

@johnwparent johnwparent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it feasible to patch this in the NetCDF-C CMake system? I'd rather correct their CMake usage than require an extra dependency that doesn't align with the expectations the variants provide.

@Chrismarsh
Copy link
Copy Markdown
Contributor Author

In theory this is fixed in 9.3. I just need to test it still

@Chrismarsh
Copy link
Copy Markdown
Contributor Author

@bernhardkaindl @johnwparent I did

 spack install netcdf-c@4.9.3

and there is no curl dependency, so I believe netcdf@4.9.3 resolves this as expected. I will keep the curl dep restricted as is.

$ ~/bin/libtree_x86_64 libnetcdf.so
libnetcdf.so.22
├── libmpi.so.40 [rpath]
│   ├── libopen-pal.so.80 [rpath]
│   │   ├── libpmix.so.2 [rpath]
│   │   │   ├── libz.so.1 [rpath]
│   │   │   ├── libevent_pthreads-2.1.so.7 [rpath]
│   │   │   ├── libevent_core-2.1.so.7 [rpath]
│   │   │   └── libhwloc.so.15 [rpath]
│   │   │       ├── libxml2.so.2 [rpath]
│   │   │       │   ├── liblzma.so.5 [rpath]
│   │   │       │   └── libz.so.1 [rpath]
│   │   │       └── libpciaccess.so.0 [rpath]
│   │   ├── libevent_core-2.1.so.7 [rpath]
│   │   ├── libevent_pthreads-2.1.so.7 [rpath]
│   │   ├── libhwloc.so.15 [rpath]
│   │   ├── libucp.so.0 [rpath]
│   │   │   ├── libuct.so.0 [rpath]
│   │   │   │   ├── libucs.so.0 [rpath]
│   │   │   │   │   └── libucm.so.0 [rpath]
│   │   │   │   └── libucm.so.0 [rpath]
│   │   │   ├── libucm.so.0 [rpath]
│   │   │   └── libucs.so.0 [rpath]
│   │   ├── libuct.so.0 [rpath]
│   │   ├── libucm.so.0 [rpath]
│   │   └── libucs.so.0 [rpath]
│   ├── libpmix.so.2 [rpath]
│   ├── libevent_pthreads-2.1.so.7 [rpath]
│   ├── libevent_core-2.1.so.7 [rpath]
│   ├── libhwloc.so.15 [rpath]
│   ├── libuct.so.0 [rpath]
│   ├── libucm.so.0 [rpath]
│   ├── libucs.so.0 [rpath]
│   └── libucp.so.0 [rpath]
├── libhdf5_hl.so.310 [rpath]
│   ├── libmpi.so.40 [rpath]
│   └── libhdf5.so.310 [rpath]
│       ├── libmpi.so.40 [rpath]
│       └── libz.so.1 [rpath]
├── libhdf5.so.310 [rpath]
├── libz.so.1 [rpath]
├── libblosc.so.1 [rpath]
│   ├── liblz4.so.1 [rpath]
│   ├── libz.so.1 [rpath]
│   └── libzstd.so.1 [rpath]
├── libbz2.so.1.0 [rpath]
├── libsz.so.2 [rpath]
└── libxml2.so.2 [default path]
    ├── libz.so.1 [rpath of 1]
    └── liblzma.so.5 [default path]

@Chrismarsh Chrismarsh force-pushed the package-fix/netcdf-c_curl branch from 124ca43 to b7916f4 Compare August 22, 2025 15:07
@alecbcs alecbcs requested review from WardF and skosukhin September 2, 2025 01:22
@johnwparent
Copy link
Copy Markdown
Contributor

@becker33 are we good to merge this? Been a couple weeks and users are requesting this land to unbreak some builds.

@Chrismarsh
Copy link
Copy Markdown
Contributor Author

It would be great to have this merged. It shows up in some weird situations when a built-against-system curl netcdf is pulled in with python dependencies, e.g., gdal and friends. The python stack then falls apart in totally bizarre ways

@johnwparent johnwparent merged commit d023cb4 into spack:develop Sep 22, 2025
17 checks passed
@Chrismarsh Chrismarsh deleted the package-fix/netcdf-c_curl branch September 22, 2025 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants