Repository: Unidata/netcdf-c
Pull request #2356 (2022-05-24 17:03:59)

#2343 with updated Github Actions
#2343 with additional fix, plus updated Github Actions to fix MacOS CI test. 


Patch:
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md
index 07e02a014..35280d5cd 100644
--- a/RELEASE_NOTES.md
+++ b/RELEASE_NOTES.md
@@ -8,6 +8,7 @@ This file contains a high-level description of this package's evolution. Release
 ## 4.8.2 - TBD
 
 
+* [Bug Fix] Get "make distcheck" to work See [Github #/2343](https://github.com/Unidata/netcdf-c/pull/2343).
 * [Enhancement] Allow the read/write of JSON-valued Zarr attributes to allow
 for domain specific info such as used by GDAL/Zarr. See [Github #????](https://github.com/Unidata/netcdf-c/pull/????).
 * [Enhancement] Turn on the XArray convention for NCZarr files by default. WARNING, this means that the mode should explicitly specify nczarr" or "zarr" even if "xarray" or "noxarray" is specified. See [Github #2257](https://github.com/Unidata/netcdf-c/pull/2257).
diff --git a/configure.ac b/configure.ac
index c825135dc..c33665e33 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1991,12 +1991,13 @@ AC_CONFIG_FILES(test_common.sh:test_common.in)
 AC_CONFIG_FILES(nc_test4/findplugin.sh:nc_test4/findplugin.in)
 AC_CONFIG_FILES(nczarr_test/findplugin.sh:nc_test4/findplugin.in)
 AC_CONFIG_FILES(plugins/findplugin.sh:nc_test4/findplugin.in)
+AC_CONFIG_FILES(plugins/stdinstall.sh:plugins/stdinstall.in)
 AC_CONFIG_FILES(examples/C/findplugin.sh:nc_test4/findplugin.in)
 AC_CONFIG_FILES(ncdap_test/findtestserver.c:ncdap_test/findtestserver.c.in)
+AC_CONFIG_FILES([nc_test/run_pnetcdf_tests.sh:nc_test/run_pnetcdf_tests.sh.in],[chmod ugo+x nc_test/run_pnetcdf_tests.sh])
 AC_CONFIG_FILES(dap4_test/findtestserver4.c:ncdap_test/findtestserver.c.in)
 AC_CONFIG_FILES(dap4_test/pingurl4.c:ncdap_test/pingurl.c)
 AC_CONFIG_FILES([h5_test/run_par_tests.sh], [chmod ugo+x h5_test/run_par_tests.sh])
-AC_CONFIG_FILES([nc_test/run_pnetcdf_tests.sh], [chmod ugo+x nc_test/run_pnetcdf_tests.sh])
 AC_CONFIG_FILES([nc_test4/run_par_test.sh], [chmod ugo+x nc_test4/run_par_test.sh])
 AC_CONFIG_FILES([nc_perf/run_par_bm_test.sh], [chmod ugo+x nc_perf/run_par_bm_test.sh])
 AC_CONFIG_FILES([nc_perf/run_gfs_test.sh], [chmod ugo+x nc_perf/run_gfs_test.sh])
diff --git a/ncdump/Makefile.am b/ncdump/Makefile.am
index c381f30d9..bcce244b5 100644
--- a/ncdump/Makefile.am
+++ b/ncdump/Makefile.am
@@ -245,7 +245,7 @@ tst_roman_szip_unlim.cdl tst_perdimpspecs.nc tmppds.*                   \
 keyword1.nc keyword2.nc keyword3.nc keyword4.nc                         \
 tmp_keyword1.cdl tmp_keyword2.cdl tmp_keyword3.cdl tmp_keyword4.cdl     \
 type_*.nc copy_type_*.cdl                                               \
-scope_*.nc copy_scope_*.cdl
+scope_*.nc copy_scope_*.cdl keyword5.nc
 
 # Remove directories
 clean-local:
diff --git a/ncdump/tst_output.sh b/ncdump/tst_output.sh
index 40c7e7cd4..a3fd20a6c 100755
--- a/ncdump/tst_output.sh
+++ b/ncdump/tst_output.sh
@@ -4,6 +4,7 @@ if test "x$srcdir" = x ; then srcdir=`pwd`; fi
 . ../test_common.sh
 
 # This shell script tests the output from several previous tests.
+
 set -e
 
 echo ""


Test patch:
diff --git a/dap4_test/Makefile.am b/dap4_test/Makefile.am
index ec5623094..158a1fcbb 100644
--- a/dap4_test/Makefile.am
+++ b/dap4_test/Makefile.am
@@ -19,7 +19,7 @@ LDADD = ${top_builddir}/liblib/libnetcdf.la
 AM_CPPFLAGS += -I$(top_srcdir)/liblib
 AM_CPPFLAGS += -I$(top_srcdir)/libdap4
 AM_CPPFLAGS += -DTOPSRCDIR=${abs_top_srcdir}
-AM_CPPFLAGS += -DTOPBINDIR=${abs_top_bindir}
+AM_CPPFLAGS += -DTOPBINDIR=${abs_top_builddir}
 
 # Set up the tests; do the .sh first, then .c
 check_PROGRAMS =
diff --git a/nc_test/Makefile.am b/nc_test/Makefile.am
index b33c341e2..e102346c6 100644
--- a/nc_test/Makefile.am
+++ b/nc_test/Makefile.am
@@ -7,16 +7,16 @@
 # Ed Hartnett, Dennis Heimbigner, Ward Fisher
 
 # Un comment to use a more verbose test driver
-#SH_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver-verbose
-#sh_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver-verbose
-#LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver-verbose
-#TESTS_ENVIRONMENT = export SETX=1;
+SH_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver-verbose
+sh_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver-verbose
+LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver-verbose
+TESTS_ENVIRONMENT = export SETX=1;
 
 # Put together AM_CPPFLAGS and AM_LDFLAGS.
 include $(top_srcdir)/lib_flags.am
 AM_CPPFLAGS += -I$(top_srcdir)/libsrc
 AM_CPPFLAGS += -DTOPSRCDIR=${abs_top_srcdir}
-AM_CPPFLAGS += -DTOPBINDIR=${abs_top_bindir}
+AM_CPPFLAGS += -DTOPBINDIR=${abs_top_builddir}
 LDADD = ${top_builddir}/liblib/libnetcdf.la
 AM_CPPFLAGS += -I$(top_builddir)/liblib -I$(top_builddir)/include -I$(top_srcdir)/libsrc
 
@@ -107,7 +107,7 @@ endif
 # The .c files that are generated with m4 are already distributed, but
 # we also include the original m4 files, plus test scripts data.
 EXTRA_DIST = test_get.m4 test_put.m4 run_diskless.sh run_diskless2.sh	\
-run_diskless5.sh run_mmap.sh run_pnetcdf_test.sh test_read.m4		\
+run_diskless5.sh run_mmap.sh test_read.m4		\
 test_write.m4 ref_tst_diskless2.cdl tst_diskless5.cdl			\
 ref_tst_diskless3_create.cdl ref_tst_diskless3_open.cdl			\
 run_inmemory.sh run_mmap.sh f03tst_open_mem.nc test_byterange.sh	\
diff --git a/nc_test/run_pnetcdf_tests.sh.in b/nc_test/run_pnetcdf_tests.sh.in
index b76a6cf0d..2908f8d3f 100755
--- a/nc_test/run_pnetcdf_tests.sh.in
+++ b/nc_test/run_pnetcdf_tests.sh.in
@@ -2,7 +2,9 @@
 
 # This script runs some PnetCDF I/O tests
 
+set -x
 set -e
+
 echo
 echo "Testing file created with PnetCDF is modifiable with netCDF..."
 ./tst_pnetcdf
diff --git a/nc_test4/Makefile.am b/nc_test4/Makefile.am
index 9524339f3..7ce3b4c60 100644
--- a/nc_test4/Makefile.am
+++ b/nc_test4/Makefile.am
@@ -110,7 +110,7 @@ ref_ncgenF.cdl ref_nccopyF.cdl                                          \
 ref_filter_repeat.txt ref_fillonly.cdl test_fillonly.sh                 \
 ref_filter_order_create.txt ref_filter_order_read.txt			\
 ref_any.cdl tst_specific_filters.sh                                     \
-tst_virtual_datasets.c
+tst_virtual_datasets.c noop1.cdl
 
 # The tst_filterinstall test can only be run after an install
 # occurred with --with-plugin-dir enabled. So there is no point
@@ -128,7 +128,8 @@ perftest.txt bigmeta.nc bigvars.nc *.gz MSGCPP_*.nc	                \
 floats*.nc floats*.cdl shorts*.nc shorts*.cdl ints*.nc ints*.cdl        \
 testfilter_reg.nc filterrepeat.txt tmp_fillonly.nc                      \
 testfilter_order.nc crfilterorder.txt rdfilterorder.txt 1               \
-tmp_*.txt tmp_*.nc tmp*.dump tmp*.cdl tmp*.txt tmp*.tmp tmp_bzip2.c bzip2.nc
+tmp_*.txt tmp_*.nc tmp*.dump tmp*.cdl tmp*.txt tmp*.tmp                 \
+tmp_bzip2.c bzip2.nc noop.nc
 
 DISTCLEANFILES = findplugin.sh run_par_test.sh
 
diff --git a/nc_test4/noop1.cdl b/nc_test4/noop1.cdl
new file mode 100644
index 000000000..b36b94651
--- /dev/null
+++ b/nc_test4/noop1.cdl
@@ -0,0 +1,83 @@
+netcdf bzip2 {
+dimensions:
+	dim0 = 4 ;
+	dim1 = 4 ;
+	dim2 = 4 ;
+	dim3 = 4 ;
+variables:
+	float var(dim0, dim1, dim2, dim3) ;
+		var:_Storage = "chunked" ;
+		var:_ChunkSizes = 4, 4, 4, 4 ;
+		var:_Filter = "40001,17" ;
+ 		var:_NoFill = "true" ;
+
+// global attributes:
+		:_Format = "netCDF-4" ;
+data:
+
+ var =
+  0, 1, 2, 3,
+  4, 5, 6, 7,
+  8, 9, 10, 11,
+  12, 13, 14, 15,
+  16, 17, 18, 19,
+  20, 21, 22, 23,
+  24, 25, 26, 27,
+  28, 29, 30, 31,
+  32, 33, 34, 35,
+  36, 37, 38, 39,
+  40, 41, 42, 43,
+  44, 45, 46, 47,
+  48, 49, 50, 51,
+  52, 53, 54, 55,
+  56, 57, 58, 59,
+  60, 61, 62, 63,
+  64, 65, 66, 67,
+  68, 69, 70, 71,
+  72, 73, 74, 75,
+  76, 77, 78, 79,
+  80, 81, 82, 83,
+  84, 85, 86, 87,
+  88, 89, 90, 91,
+  92, 93, 94, 95,
+  96, 97, 98, 99,
+  100, 101, 102, 103,
+  104, 105, 106, 107,
+  108, 109, 110, 111,
+  112, 113, 114, 115,
+  116, 117, 118, 119,
+  120, 121, 122, 123,
+  124, 125, 126, 127,
+  128, 129, 130, 131,
+  132, 133, 134, 135,
+  136, 137, 138, 139,
+  140, 141, 142, 143,
+  144, 145, 146, 147,
+  148, 149, 150, 151,
+  152, 153, 154, 155,
+  156, 157, 158, 159,
+  160, 161, 162, 163,
+  164, 165, 166, 167,
+  168, 169, 170, 171,
+  172, 173, 174, 175,
+  176, 177, 178, 179,
+  180, 181, 182, 183,
+  184, 185, 186, 187,
+  188, 189, 190, 191,
+  192, 193, 194, 195,
+  196, 197, 198, 199,
+  200, 201, 202, 203,
+  204, 205, 206, 207,
+  208, 209, 210, 211,
+  212, 213, 214, 215,
+  216, 217, 218, 219,
+  220, 221, 222, 223,
+  224, 225, 226, 227,
+  228, 229, 230, 231,
+  232, 233, 234, 235,
+  236, 237, 238, 239,
+  240, 241, 242, 243,
+  244, 245, 246, 247,
+  248, 249, 250, 251,
+  252, 253, 254, 255 ;
+}
diff --git a/ncdap_test/Makefile.am b/ncdap_test/Makefile.am
index 25b19cde2..8cd39e51a 100644
--- a/ncdap_test/Makefile.am
+++ b/ncdap_test/Makefile.am
@@ -18,7 +18,7 @@ TEST_EXTENSIONS = .sh
 LDADD = ${top_builddir}/liblib/libnetcdf.la
 AM_CPPFLAGS += -I$(top_srcdir)/liblib
 AM_CPPFLAGS += -DTOPSRCDIR=${abs_top_srcdir}
-AM_CPPFLAGS += -DTOPBINDIR=${abs_top_bindir}
+AM_CPPFLAGS += -DTOPBINDIR=${abs_top_builddir}
 
 # Set up the tests; do the .sh first, then .c
 check_PROGRAMS =
@@ -52,6 +52,7 @@ TESTS += test_partvar
 if ENABLE_DAP_LONG_TESTS
  TESTS += tst_longremote3.sh
  tst_longremote3.log: tst_remote3.log
+ test_manyurls_SOURCES = test_manyurls.c manyurls.h
  check_PROGRAMS += test_manyurls
  TESTS += test_manyurls
  test_manyurls.log: tst_longremote3.log
diff --git a/ncdump/test_scope.sh b/ncdump/test_scope.sh
index 0025eeee8..94468af4a 100755
--- a/ncdump/test_scope.sh
+++ b/ncdump/test_scope.sh
@@ -31,7 +31,6 @@ diff -wB ${srcdir}/$1.cdl ${execdir}/copy_$1.cdl
 }
 
 typescope() {
-echo ">>>"
 ls -l ${execdir}/printfqn* ${execdir}/$1.nc ${execdir}/$1_copy.nc
 REFT=`${execdir}/printfqn -f ${execdir}/$1.nc -v test_variable -t`
 COPYT=`${execdir}/printfqn -f ${execdir}/$1_copy.nc -v test_variable -t`
diff --git a/nczarr_test/Makefile.am b/nczarr_test/Makefile.am
index 863eb263a..c413fcf91 100644
--- a/nczarr_test/Makefile.am
+++ b/nczarr_test/Makefile.am
@@ -10,10 +10,10 @@ TESTS_ENVIRONMENT =
 
 #TEST_EXTENSIONS = .sh
 
-#SH_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver-verbose
-#sh_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver-verbose
-#LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver-verbose
-#TESTS_ENVIRONMENT += export SETX=1;
+SH_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver-verbose
+sh_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver-verbose
+LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver-verbose
+TESTS_ENVIRONMENT += export SETX=1;
 
 AM_CPPFLAGS += -I${top_srcdir} -I${top_srcdir}/libnczarr
 AM_LDFLAGS += ${top_builddir}/liblib/libnetcdf.la
@@ -94,7 +94,7 @@ TESTS += run_nczfilter.sh
 
 # Echo filter tests from nc_test4
 check_PROGRAMS += testfilter testfilter_misc testfilter_order testfilter_repeat testfilter_multi test_filter_avail
-TESTS += run_filter.sh
+TESTS += run_filter.sh 
 TESTS += run_specific_filters.sh
 
 endif #ENABLE_FILTER_TESTING
@@ -128,7 +128,9 @@ run_ut_map.sh run_ut_mapapi.sh run_ut_misc.sh run_ut_chunk.sh run_ncgen4.sh \
 run_nccopyz.sh run_fillonlyz.sh run_chunkcases.sh test_nczarr.sh run_perf_chunks1.sh run_s3_cleanup.sh \
 run_purezarr.sh run_interop.sh run_misc.sh \
 run_filter.sh run_specific_filters.sh \
-run_newformat.sh run_nczarr_fill.sh run_quantize.sh run_jsonconvention.sh
+run_newformat.sh run_nczarr_fill.sh run_quantize.sh run_jsonconvention.sh \
+run_nczfilter.sh
+
 
 EXTRA_DIST += \
 ref_ut_map_create.cdl ref_ut_map_writedata.cdl ref_ut_map_writemeta2.cdl ref_ut_map_writemeta.cdl \
@@ -146,14 +148,13 @@ ref_avail1.cdl ref_avail1.dmp ref_avail1.txt \
 ref_xarray.cdl ref_purezarr.cdl ref_purezarr_base.cdl ref_nczarr2zarr.cdl \
 ref_bzip2.cdl ref_filtered.cdl ref_multi.cdl \
 ref_any.cdl ref_oldformat.cdl ref_oldformat.zip ref_newformatpure.cdl \
-ref_quotes.zip ref_quotes.cdl \
 ref_groups.h5 ref_byte.zarr.zip ref_byte_fill_value_null.zarr.zip \
 ref_groups_regular.cdl ref_byte.cdl ref_byte_fill_value_null.cdl ref_jsonconvention.cdl
 
 # Interoperability files
-EXTRA_DIST += ref_power_901_constants.zip ref_power_901_constants.cdl ref_quotes.zip ref_quotes.cdl 
+EXTRA_DIST += ref_power_901_constants_orig.zip ref_power_901_constants.cdl ref_quotes_orig.zip ref_quotes.cdl 
 
-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
+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
 
 BUILT_SOURCES = test_quantize.c test_filter_avail.c run_specific_filters.sh run_filterinstall.sh
 test_quantize.c: $(top_srcdir)/nc_test4/tst_quantize.c
@@ -186,10 +187,11 @@ run_filterinstall.sh: $(top_srcdir)/nc_test4/tst_filterinstall.sh
 
 # Remove directories
 clean-local:
-	rm -fr tmp*.file results.file results.s3 results.zip
-	rm -fr rcmiscdir
+	rm -fr tmp_*.nc tmp_*.zarr tst_quantize*.zarr tmp*.file results.file results.s3 results.zip
+	rm -fr rcmiscdir ref_power_901_constants.file 
+
 
-DISTCLEANFILES = findplugin.sh test_quantize.c run_specific_filters.sh
+DISTCLEANFILES = findplugin.sh test_quantize.c run_specific_filters.sh run_filterinstall.sh
 
 # If valgrind is present, add valgrind targets.
 @VALGRIND_CHECK_RULES@
diff --git a/nczarr_test/ref_power_901_constants.zip b/nczarr_test/ref_power_901_constants_orig.zip
similarity index 100%
rename from nczarr_test/ref_power_901_constants.zip
rename to nczarr_test/ref_power_901_constants_orig.zip
diff --git a/nczarr_test/ref_quotes.zip b/nczarr_test/ref_quotes_orig.zip
similarity index 100%
rename from nczarr_test/ref_quotes.zip
rename to nczarr_test/ref_quotes_orig.zip
diff --git a/nczarr_test/run_filter.sh b/nczarr_test/run_filter.sh
index da653a985..04c429140 100755
--- a/nczarr_test/run_filter.sh
+++ b/nczarr_test/run_filter.sh
@@ -12,7 +12,6 @@ testset() {
 testapi $1
 testng $1
 testncp $1
-testunk $1
 testngc $1
 testmisc $1
 testmulti $1
@@ -53,11 +52,6 @@ sed -e 's/[ 	]*\([^ 	].*\)/\1/' <$1 >$2
 findplugin h5misc
 MISCDIR="${HDF5_PLUGIN_DIR}/${HDF5_PLUGIN_LIB}"
 
-# Find noop and capture
-findplugin h5noop
-NOOPLIB="${HDF5_PLUGIN_LIB}"
-NOOPDIR="${HDF5_PLUGIN_DIR}/${NOOPLIB}"
-
 # Find bzip2 and capture
 findplugin h5bzip2
 BZIP2LIB="${HDF5_PLUGIN_LIB}"
@@ -132,29 +126,6 @@ diff -b -w ${srcdir}/ref_filtered.cdl ./tmp_ncp_$zext.dump
 echo "	*** Pass: nccopy simple filter for map $zext"
 }
 
-testunk() {
-zext=$1	
-echo "*** Testing access to filter info when filter implementation is not available for map $zext"
-fileargs tmp_known
-deletemap $zext $file
-# build noop.nc
-${NCGEN} -lb -4 -o $fileurl ${srcdir}/../nc_test4/noop.cdl
-# dump and clean noop.nc header when filter is avail
-${NCDUMP} -hs $fileurl > ./tmp_known_$zext.txt
-# Remove irrelevant -s output
-sclean ./tmp_known_$zext.txt tmp_known_$zext.dump
-# Now hide the filter code
-mv ${NOOPDIR} ./${NOOPLIB}.save
-# dump and clean noop.nc header when filter is not avail
-${NCDUMP} -hs $fileurl > ./tmp_unk_$zext.txt
-# Restore the filter code
-mv ./${NOOPLIB}.save ${NOOPDIR}
-# Verify that the filter is no longer defined
-UNK=`sed -e '/var:_Filter/p' -e d ./tmp_unk_$zext.txt`
-test "x$UNK" = x
-echo "*** Pass: ncgen dynamic filter for map $zext"
-}
-
 testngc() {
 zext=$1	
 echo "*** Testing dynamic filters using ncgen with -lc for map $zext"
diff --git a/nczarr_test/run_interop.sh b/nczarr_test/run_interop.sh
index a2ee6f3fc..f3b9ea232 100755
--- a/nczarr_test/run_interop.sh
+++ b/nczarr_test/run_interop.sh
@@ -54,16 +54,14 @@ case "$zext" in
     file)
 	# need to unpack
 	rm -fr ref_power_901_constants ref_power_901_constants.file
-	unzip ${srcdir}/ref_power_901_constants.zip > /dev/null
+	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
 	;;
     zip)
 	# Move into position
-	if test "x$srcdir" != "x$execdir" ; then
-              cp ${srcdir}/ref_power_901_constants.zip ${execdir}
-              cp ${srcdir}/ref_quotes.zip ${execdir}
-	fi
+        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
 	# Test large constant interoperability 
 	testcasezip ref_quotes zarr metaonly