From 295c1327895f55424649422181429759d37c22b8 Mon Sep 17 00:00:00 2001 From: Dennis Heimbigner Date: Fri, 17 Feb 2023 13:01:11 -0700 Subject: [PATCH 1/2] Fix a distcheck failure with nczarr_test/run_interop.sh The problem was that files were being copied into the ${srcdir} rather than ${builddir} directory. --- RELEASE_NOTES.md | 6 ++-- libhdf5/H5FDhttp.h | 2 +- nczarr_test/Makefile.am | 3 +- nczarr_test/run_interop.sh | 72 +++++++++++++++++++++----------------- nczarr_test/s3util.c | 5 ++- 5 files changed, 50 insertions(+), 38 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index e5864b2f22..6bac6e56a9 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,4 +1,4 @@ -Release Notes {#RELEASE_NOTES} +1Release Notes {#RELEASE_NOTES} ============= \brief Release notes file for the netcdf-c package. @@ -7,9 +7,9 @@ This file contains a high-level description of this package's evolution. Release ## 4.9.2 - TBD - +* Fix 'make distcheck' error in run_interop.sh. See [Github #????](https://github.com/Unidata/netcdf-c/pull/????). * Update `nc-config` to remove inclusion from automatically-detected `nf-config` and `ncxx-config` files, as the wrong files could be included in the output. This is in support of [GitHub #2274](https://github.com/Unidata/netcdf-c/issues/2274). -* [Bug Fix] Update H5FDhttp.[ch] to work with HDF5 version 1.14.0. See [Github #2615](https://github.com/Unidata/netcdf-c/pull/2615). +* Update H5FDhttp.[ch] to work with HDF5 version 1.14.0. See [Github #2615](https://github.com/Unidata/netcdf-c/pull/2615). ## 4.9.1 - February 2, 2023 diff --git a/libhdf5/H5FDhttp.h b/libhdf5/H5FDhttp.h index 6d4553998d..2e0e11db82 100644 --- a/libhdf5/H5FDhttp.h +++ b/libhdf5/H5FDhttp.h @@ -30,7 +30,7 @@ #include "H5Ipublic.h" #if H5_VERSION_GE(1,14,0) -#define H5_VFD_HTTP ((H5FD_class_value_t)(H5_VFD_MAX - 2)) +#define H5_VFD_HTTP ((H5FD_class_value_t)(514)) #define H5FD_HTTP (H5FDperform_init(H5FD_http_init)) #else #define H5FD_HTTP (H5FD_http_init()) diff --git a/nczarr_test/Makefile.am b/nczarr_test/Makefile.am index 3e04bb7c79..5e12376997 100644 --- a/nczarr_test/Makefile.am +++ b/nczarr_test/Makefile.am @@ -164,7 +164,8 @@ ref_string.cdl ref_string_nczarr.baseline ref_string_zarr.baseline ref_scalar.cd ref_nulls_nczarr.baseline ref_nulls_zarr.baseline ref_nulls.cdl # Interoperability files -EXTRA_DIST += ref_power_901_constants_orig.zip ref_power_901_constants.cdl ref_quotes_orig.zip ref_quotes.cdl +EXTRA_DIST += ref_power_901_constants_orig.zip ref_power_901_constants.cdl ref_quotes_orig.zip ref_quotes.cdl \ +ref_zarr_test_data.cdl.gz CLEANFILES = ut_*.txt ut*.cdl tmp*.nc tmp*.cdl tmp*.txt tmp*.dmp tmp*.zip tmp*.nc tmp*.dump tmp*.tmp tmp_ngc.c ref_zarr_test_data.cdl tst_*.nc.zip ref_quotes.zip ref_power_901_constants.zip diff --git a/nczarr_test/run_interop.sh b/nczarr_test/run_interop.sh index f3b9ea232c..f3d7812d84 100755 --- a/nczarr_test/run_interop.sh +++ b/nczarr_test/run_interop.sh @@ -17,35 +17,35 @@ UB="${NCZARR_S3_TEST_BUCKET}" testcasefile() { zext=file - ref=$1 + base=$1 mode=$2 metaonly=$3 if test "x$metaonly" = xmetaonly ; then flags="-h"; fi - fileargs ${execdir}/$ref "mode=$mode,$zext" - rm -f tmp_${ref}_${zext}.cdl - ${NCDUMP} $flags $fileurl > tmp_${ref}_${zext}.cdl - diff -b ${srcdir}/${ref}.cdl tmp_${ref}_${zext}.cdl + fileargs ${builddir}/ref_$base "mode=$mode,$zext" + rm -f tmp_${base}_${zext}.cdl + ${NCDUMP} $flags $fileurl > tmp_${base}_${zext}.cdl + diff -b ${srcdir}/ref_${base}.cdl tmp_${base}_${zext}.cdl } testcasezip() { zext=zip - ref=$1 + base=$1 mode=$2 - fileargs $ref "mode=$mode,$zext" - rm -f tmp_${ref}_${zext}.cdl - ${NCDUMP} -h $flags $fileurl > tmp_${ref}_${zext}.cdl - diff -b ${srcdir}/${ref}.cdl tmp_${ref}_${zext}.cdl + fileargs ${builddir}/ref_$base "mode=$mode,$zext" + rm -f tmp_${base}_${zext}.cdl + ${NCDUMP} -h $flags $fileurl > tmp_${base}_${zext}.cdl + diff -b ${srcdir}/ref_${base}.cdl tmp_${base}_${zext}.cdl } testcases3() { zext=s3 - zarr=$1 - ref=$2 - mode=$3 - rm -f tmp_${zarr}_${zext}.cdl - url="https://${UH}/${UB}/${zarr}#mode=${mode},s3" - ${NCDUMP} $url > tmp_${zarr}_${zext}.cdl - diff -b ${srcdir}/${ref}.cdl tmp_${zarr}_${zext}.cdl + base=$1 + mode=$2 + rm -f tmp_${base}_${zext}.cdl + url="https://${UH}/${UB}/${base}.zarr#mode=${mode},s3" + ${NCDUMP} $url > tmp_${base}_${zext}.cdl + # Find the proper ref file + diff -b ${builddir}/ref_${base}.cdl tmp_${base}_${zext}.cdl } testallcases() { @@ -54,27 +54,35 @@ case "$zext" in file) # need to unpack rm -fr ref_power_901_constants ref_power_901_constants.file - unzip ${srcdir}/ref_power_901_constants_orig.zip > /dev/null - mv ref_power_901_constants ref_power_901_constants.file - testcasefile ref_power_901_constants zarr metaonly; # test xarray as default + if ! test -f ${builddir}/ref_power_901_constants_orig.zip ; then + cp -f ${srcdir}/ref_power_901_constants_orig.zip ${builddir}/ref_power_901_constants_orig.zip + fi + unzip ${builddir}/ref_power_901_constants_orig.zip > /dev/null + mv ${builddir}/ref_power_901_constants ${builddir}/ref_power_901_constants.file + testcasefile power_901_constants zarr metaonly; # test xarray as default ;; zip) # Move into position - cp ${srcdir}/ref_power_901_constants_orig.zip ${execdir}/ref_power_901_constants.zip - cp ${srcdir}/ref_quotes_orig.zip ${execdir}/ref_quotes.zip - testcasezip ref_power_901_constants xarray metaonly + if ! test -f ${builddir}/ref_power_901_constants.zip ; then + cp -f ${srcdir}/ref_power_901_constants_orig.zip ${builddir}/ref_power_901_constants.zip + fi + if ! test -f ${builddir}/ref_quotes.zip ; then + cp -f ${srcdir}/ref_quotes_orig.zip ${builddir}/ref_quotes.zip + fi + testcasezip power_901_constants xarray metaonly # Test large constant interoperability - testcasezip ref_quotes zarr metaonly + testcasezip quotes zarr metaonly ;; s3) # Read a test case created by netcdf-java zarr. # Move into position - rm -f ${execdir}/ref_zarr_test_data.cdl - # Use gunzip because it always appears to be available - if ! test -f ${srcdir}/ref_zarr_test_data.cdl ; then - gunzip -c ${srcdir}/ref_zarr_test_data.cdl.gz > ${srcdir}/ref_zarr_test_data.cdl + rm -f ${builddir}/ref_zarr_test_data.cdl + if ! test -f ${builddir}/ref_zarr_test_data.cdl.gz ; then + cp -f ${srcdir}/ref_zarr_test_data.cdl.gz ${builddir}/ref_zarr_test_data.cdl.gz fi - testcases3 zarr_test_data.zarr ref_zarr_test_data xarray + # Use gunzip because it always appears to be available + gunzip -c ${builddir}/ref_zarr_test_data.cdl.gz > ${builddir}/ref_zarr_test_data.cdl + testcases3 zarr_test_data xarray ;; *) echo "unimplemented kind: $1" ; exit 1;; esac @@ -83,9 +91,9 @@ esac testallcases file if test "x$FEATURE_NCZARR_ZIP" = xyes ; then testallcases zip; fi if test "x$FEATURE_S3TESTS" = xyes ; then testallcases s3; fi -exit + # Cleanup -rm -fr ${execdir}/ref_power_901_constants.file -rm -f ${execdir}/ref_zarr_test_data.cdl +rm -fr ${builddir}/ref_power_901_constants_orig.zip +rm -fr ${builddir}/ref_zarr_test_data.cdl.gz exit 0 diff --git a/nczarr_test/s3util.c b/nczarr_test/s3util.c index 07e03ef1c9..0852a45a0c 100644 --- a/nczarr_test/s3util.c +++ b/nczarr_test/s3util.c @@ -128,7 +128,7 @@ main(int argc, char** argv) dumpoptions.nctype = NC_UBYTE; /* default */ - while ((c = getopt(argc, argv, "df:k:p:t:T:u:v")) != EOF) { + while ((c = getopt(argc, argv, "df:hk:p:t:T:u:v")) != EOF) { switch(c) { case 'd': dumpoptions.debug = 1; @@ -136,6 +136,9 @@ main(int argc, char** argv) case 'f': dumpoptions.filename = strdup(optarg); break; + case 'h': + usage(); + return 0; case 'k': { size_t len = strlen(optarg); dumpoptions.key = (char*)malloc(len+1+1); From 6a8d5b931403af8d70a8872aaaa02d217146cc0a Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Fri, 17 Feb 2023 15:58:44 -0700 Subject: [PATCH 2/2] Remove a stray character at the head file. --- RELEASE_NOTES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 6bac6e56a9..511e4f9138 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,4 +1,4 @@ -1Release Notes {#RELEASE_NOTES} +Release Notes {#RELEASE_NOTES} ============= \brief Release notes file for the netcdf-c package.