Repository: Unidata/netcdf-c (c)

Issue:
Filename too long, causing 'make dist' issue on linux.
@DennisHeimbigner 

`make dist` is failing on Ubuntu 21.04 and Ubuntu 20.04 (ARM64).  When running make dist, the following is observed:

```
>netcdf-c-4.8.1.tar.gz
tar: netcdf-c-4.8.1/dap4_test/baselinethredds/GOES16_CONUS_20170821_020218_0.47_1km_33.3N_91.4W.nc4.thredds: file name is too long (max 99); not dumped
tar: Exiting with failure status due to previous errors
```

This causes an error in `make distcheck`.  `dap4_test/test_thredds.sh` fails due to the m issing `.thredds` file.  Is there a replacement we can use, perhaps, with a shorter file name?



Pull request:
v4.8.1 Wellspring changes to merge back upstream
* Fixes #2077 

This branch will eventually split into the `v4.8.1` release to one side, and a subset of those changes which will go back into the `main` development branch after the `v4.8.1` release.  

Patch:
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cfefc6982..88b8ea1b2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -26,7 +26,7 @@ set(PACKAGE "netCDF" CACHE STRING "")
 
 SET(NC_VERSION_MAJOR 4)
 SET(NC_VERSION_MINOR 8)
-SET(NC_VERSION_PATCH 1)
+SET(NC_VERSION_PATCH 2)
 SET(NC_VERSION_NOTE "-development")
 SET(netCDF_VERSION ${NC_VERSION_MAJOR}.${NC_VERSION_MINOR}.${NC_VERSION_PATCH}${NC_VERSION_NOTE})
 SET(VERSION ${netCDF_VERSION})
@@ -1867,7 +1867,7 @@ ENDIF(ENABLE_BASH_SCRIPT_TESTING)
 
 MACRO(add_sh_test prefix F)
   IF(HAVE_BASH)
-    ADD_TEST(${prefix}_${F} bash "-c" "export srcdir=${CMAKE_CURRENT_SOURCE_DIR};export TOPSRCDIR=${CMAKE_SOURCE_DIR};${CMAKE_CURRENT_BINARY_DIR}/${F}.sh ${F}.sh ${ARGN}")
+    ADD_TEST(${prefix}_${F} bash "-c" "export srcdir=${CMAKE_CURRENT_SOURCE_DIR};export TOPSRCDIR=${CMAKE_SOURCE_DIR};${CMAKE_CURRENT_BINARY_DIR}/${F}.sh ${ARGN}")
   ENDIF()
 ENDMACRO()
 
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md
index f8a5f8d94..6d41fa15d 100644
--- a/RELEASE_NOTES.md
+++ b/RELEASE_NOTES.md
@@ -5,7 +5,9 @@ Release Notes       {#RELEASE_NOTES}
 
 This file contains a high-level description of this package's evolution. Releases are in reverse chronological order (most recent first). Note that, as of netcdf 4.2, the `netcdf-c++` and `netcdf-fortran` libraries have been separated into their own libraries.
 
-## 4.8.1 - TBD
+## 4.8.2 - TBD
+
+## 4.8.1 - August 18, 2021
 
 * [Bug Fix] Fix multiple bugs in libnczarr. See [Github #2066](https://github.com/Unidata/netcdf-c/pull/2066).
 * [Enhancement] Support windows network paths (e.g. \\svc\...). See [Github #2065](https://github.com/Unidata/netcdf-c/pull/2065).
diff --git a/configure.ac b/configure.ac
index a3e88630e..ed0dd1f11 100644
--- a/configure.ac
+++ b/configure.ac
@@ -10,7 +10,7 @@
 AC_PREREQ([2.59])
 
 # Initialize with name, version, and support email address.
-AC_INIT([netCDF], [4.8.1-development], [support-netcdf@unidata.ucar.edu], [netcdf-c])
+AC_INIT([netCDF], [4.8.2-development], [support-netcdf@unidata.ucar.edu], [netcdf-c])
 
 ##
 # Prefer an empty CFLAGS variable instead of the default -g -O2.
@@ -21,7 +21,7 @@ AC_INIT([netCDF], [4.8.1-development], [support-netcdf@unidata.ucar.edu], [netcd
 
 AC_SUBST([NC_VERSION_MAJOR]) NC_VERSION_MAJOR=4
 AC_SUBST([NC_VERSION_MINOR]) NC_VERSION_MINOR=8
-AC_SUBST([NC_VERSION_PATCH]) NC_VERSION_PATCH=1
+AC_SUBST([NC_VERSION_PATCH]) NC_VERSION_PATCH=2
 AC_SUBST([NC_VERSION_NOTE]) NC_VERSION_NOTE="-development"
 
 #####
@@ -87,7 +87,7 @@ AC_CONFIG_LINKS([nc_test4/ref_hdf5_compat3.nc:nc_test4/ref_hdf5_compat3.nc])
 
 AC_CONFIG_LINKS([hdf4_test/ref_chunked.hdf4:hdf4_test/ref_chunked.hdf4])
 AC_CONFIG_LINKS([hdf4_test/ref_contiguous.hdf4:hdf4_test/ref_contiguous.hdf4])
-
+AC_CONFIG_LINKS([dap4_test/baselinethredds/GOES16_CONUS_20170821_020218_0.47_1km_33.3N_91.4W.nc4.thredds:dap4_test/baselinethredds/GOES16_TEST1.nc4.thredds])
 AM_INIT_AUTOMAKE([foreign dist-zip subdir-objects])
 
 # Check for the existence of this file before proceeding.
@@ -522,10 +522,10 @@ CFLAGS="$SAVECFLAGS"
 # --enable-dap => enable-dap4
 enable_dap4=$enable_dap
 # Default is to do the short remote tests.
-AC_MSG_CHECKING([whether dap remote testing should be enabled (default off)])
+AC_MSG_CHECKING([whether dap remote testing should be enabled])
 AC_ARG_ENABLE([dap-remote-tests],
-              [AS_HELP_STRING([--enable-dap-remote-tests],
-                                 [enable dap remote tests])])
+              [AS_HELP_STRING([--disable-dap-remote-tests],
+                                 [disable dap remote tests])])
 test "x$enable_dap_remote_tests" = xno || enable_dap_remote_tests=yes
 if test "x$enable_dap" = "xno" ; then
   enable_dap_remote_tests=no
diff --git a/docs/Doxyfile.developer b/docs/Doxyfile.developer
index 5cc154762..bc71cc216 100644
--- a/docs/Doxyfile.developer
+++ b/docs/Doxyfile.developer
@@ -38,7 +38,7 @@ PROJECT_NAME           = netCDF-C
 # could be handy for archiving the generated documentation or if some version
 # control system is used.
 
-PROJECT_NUMBER         = 4.8.1-development
+PROJECT_NUMBER         = 4.8.2-development
 
 # Using the PROJECT_BRIEF tag one can provide an optional one line description
 # for a project that appears at the top of each page and should give viewer a
diff --git a/docs/Makefile.am b/docs/Makefile.am
index 7e6ef3419..c1a8b342e 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -17,7 +17,7 @@ inmemory.md attribute_conventions.md FAQ.md	                \
 file_format_specifications.md known_problems.md COPYRIGHT.md		\
 inmeminternal.dox              \
 testserver.dox byterange.dox   \
-nczarr.md filters.md
+nczarr.md
 
 # Turn off parallel builds in this directory.
 .NOTPARALLEL:
diff --git a/docs/windows-binaries.md b/docs/windows-binaries.md
index e0c34f68c..fea6de96f 100644
--- a/docs/windows-binaries.md
+++ b/docs/windows-binaries.md
@@ -60,11 +60,11 @@ When installed, the netCDF libraries are placed in the specified locations, alon
 1. When building the netCDF-C libraries with netCDF4 support, using the `Debug` libraries may cause extraneous warnings. These warnings are related to cross-dll memory management, and appear to be harmless. You can safely ignore them by using the `Release` libraries. [NCF-220]
 
 
-[r1]: http://www.unidata.ucar.edu/downloads/netcdf/ftp/netCDFmajor.minor.point-NC3-32.exe
-[r2]: http://www.unidata.ucar.edu/downloads/netcdf/ftp/netCDFmajor.minor.point-NC3-DAP-32.exe
-[r3]: http://www.unidata.ucar.edu/downloads/netcdf/ftp/netCDFmajor.minor.point-NC4-32.exe
-[r4]: http://www.unidata.ucar.edu/downloads/netcdf/ftp/netCDFmajor.minor.point-NC4-DAP-32.exe
-[r5]: http://www.unidata.ucar.edu/downloads/netcdf/ftp/netCDFmajor.minor.point-NC3-64.exe
-[r6]: http://www.unidata.ucar.edu/downloads/netcdf/ftp/netCDFmajor.minor.point-NC3-DAP-64.exe
-[r7]: http://www.unidata.ucar.edu/downloads/netcdf/ftp/netCDFmajor.minor.point-NC4-64.exe
-[r8]: http://www.unidata.ucar.edu/downloads/netcdf/ftp/netCDFmajor.minor.point-NC4-DAP-64.exe
+[r1]: https://artifacts.unidata.ucar.edu/service/rest/repository/browse/downloads-netcdf-c/major.minor.point/windows_installers/netCDFmajor.minor.point-NC3-32.exe
+[r2]: https://artifacts.unidata.ucar.edu/service/rest/repository/browse/downloads-netcdf-c/major.minor.point/windows_installers/netCDFmajor.minor.point-NC3-DAP-32.exe
+[r3]: https://artifacts.unidata.ucar.edu/service/rest/repository/browse/downloads-netcdf-c/major.minor.point/windows_installers/netCDFmajor.minor.point-NC4-32.exe
+[r4]: https://artifacts.unidata.ucar.edu/service/rest/repository/browse/downloads-netcdf-c/major.minor.point/windows_installers/netCDFmajor.minor.point-NC4-DAP-32.exe
+[r5]: https://artifacts.unidata.ucar.edu/service/rest/repository/browse/downloads-netcdf-c/major.minor.point/windows_installers/netCDFmajor.minor.point-NC3-64.exe
+[r6]: https://artifacts.unidata.ucar.edu/service/rest/repository/browse/downloads-netcdf-c/major.minor.point/windows_installers/netCDFmajor.minor.point-NC3-DAP-64.exe
+[r7]: https://artifacts.unidata.ucar.edu/service/rest/repository/browse/downloads-netcdf-c/major.minor.point/windows_installers/netCDFmajor.minor.point-NC4-64.exe
+[r8]: https://artifacts.unidata.ucar.edu/service/rest/repository/browse/downloads-netcdf-c/major.minor.point/windows_installers/netCDFmajor.minor.point-NC4-DAP-64.exe
diff --git a/libhdf5/nc4hdf.c b/libhdf5/nc4hdf.c
index 7096023dc..1a97d8994 100644
--- a/libhdf5/nc4hdf.c
+++ b/libhdf5/nc4hdf.c
@@ -992,9 +992,9 @@ var_create_dataset(NC_GRP_INFO_T *grp, NC_VAR_INFO_T *var, nc_bool_t write_dimid
     /* Always write the hidden coordinates attribute, which lists the
      * dimids of this var. When present, this speeds opens. When no
      * present, dimscale matching is used. */
-    if (var->ndims > 1)
+    if (var->ndims)
         if ((retval = write_coord_dimids(var)))
-            BAIL(retval);
+           BAIL(retval);
 
     /* If this is a dimscale, mark it as such in the HDF5 file. Also
      * find the dimension info and store the dataset id of the dimscale
diff --git a/liblib/Makefile.am b/liblib/Makefile.am
index 8415756a6..4e693dbb0 100644
--- a/liblib/Makefile.am
+++ b/liblib/Makefile.am
@@ -18,7 +18,7 @@ lib_LTLIBRARIES = libnetcdf.la
 # for information regarding incrementing `-version-info`.
 ##
 
-libnetcdf_la_LDFLAGS = -version-info 19:0:0
+libnetcdf_la_LDFLAGS = -version-info 19:1:0
 
 libnetcdf_la_CPPFLAGS = ${AM_CPPFLAGS}
 libnetcdf_la_LIBADD =
diff --git a/nc_perf/Makefile.am b/nc_perf/Makefile.am
index cfa34202a..ef492f18d 100644
--- a/nc_perf/Makefile.am
+++ b/nc_perf/Makefile.am
@@ -42,9 +42,12 @@ tst_wrf_reads_SOURCES = tst_wrf_reads.c tst_utils.c
 tst_bm_rando_SOURCES = tst_bm_rando.c tst_utils.c
 
 # Removing tst_mem1 because it sometimes fails on very busy system.
-TESTS = tst_ar4_3d tst_create_files tst_files3 tst_mem run_knmi_bm.sh	\
-tst_wrf_reads tst_attsperf perftest.sh run_tst_chunks.sh		\
-run_bm_elena.sh tst_bm_rando
+# Removing run_knmi_bm.sh because it fetches files from a server and
+# not all HPC systems have easy internet access, plus it's very slow
+# in CI.
+TESTS = tst_ar4_3d tst_create_files tst_files3 tst_mem tst_wrf_reads	\
+tst_attsperf perftest.sh run_tst_chunks.sh run_bm_elena.sh		\
+tst_bm_rando
 
 run_bm_elena.log: tst_create_files.log
 
diff --git a/ncdump/tst_compress.c b/ncdump/tst_compress.c
index e226e84a3..963acb6dd 100644
--- a/ncdump/tst_compress.c
+++ b/ncdump/tst_compress.c
@@ -36,7 +36,7 @@ main(int argc, char **argv) { /* create a compressible file, for testing */
     if (nc_def_var(ncid, "var1", NC_INT, VAR1_RANK, var1_dims, &varid)) ERR;
     if (nc_enddef (ncid)) ERR;
     for(i=0; i < DIM1_LEN; i++) {
-	var1_data[i] = i;
+	var1_data[i] = i / 3;  /* Want integer division / truncation */
     }
     if (nc_put_var(ncid, varid, var1_data)) ERR;
     if (nc_close(ncid)) ERR;
@@ -47,7 +47,7 @@ main(int argc, char **argv) { /* create a compressible file, for testing */
     if (nc_def_var(ncid, "var1", NC_INT, VAR1_RANK, var1_dims, &varid)) ERR;
     if (nc_enddef (ncid)) ERR;
     for(i=0; i < DIM1_LEN; i++) {
-	var1_data[i] = i;
+	var1_data[i] = i / 3; /* Want integer division / truncation */
     }
     if (nc_put_var(ncid, varid, var1_data)) ERR;
     if (nc_close(ncid)) ERR;


Test patch:
diff --git a/dap4_test/baselinethredds/CMakeLists.txt b/dap4_test/baselinethredds/CMakeLists.txt
index 85d40c3a9..4420c0e54 100644
--- a/dap4_test/baselinethredds/CMakeLists.txt
+++ b/dap4_test/baselinethredds/CMakeLists.txt
@@ -5,9 +5,15 @@
 
 # See netcdf-c/COPYRIGHT file for more info.
 
+
 FILE(GLOB COPY_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*)
 FILE(COPY ${COPY_FILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/ FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE)
 
+##
+# Rename file in support of https://github.com/Unidata/netcdf-c/issues/2077
+##
+FILE(RENAME ${CMAKE_CURRENT_BINARY_DIR}/GOES16_TEST1.nc4.thredds ${CMAKE_CURRENT_BINARY_DIR}/GOES16_CONUS_20170821_020218_0.47_1km_33.3N_91.4W.nc4.thredds)
+
 FILE(GLOB CUR_EXTRA_DIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*)
 SET(CUR_EXTRA_DIST ${CUR_EXTRA_DIST} CMakeLists.txt)
 ADD_EXTRA_DIST("${CUR_EXTRA_DIST}")
diff --git a/dap4_test/baselinethredds/GOES16_CONUS_20170821_020218_0.47_1km_33.3N_91.4W.nc4.thredds b/dap4_test/baselinethredds/GOES16_TEST1.nc4.thredds
similarity index 100%
rename from dap4_test/baselinethredds/GOES16_CONUS_20170821_020218_0.47_1km_33.3N_91.4W.nc4.thredds
rename to dap4_test/baselinethredds/GOES16_TEST1.nc4.thredds
diff --git a/dap4_test/d4test_common.sh b/dap4_test/d4test_common.sh
index 1955e99c6..a682c48c4 100755
--- a/dap4_test/d4test_common.sh
+++ b/dap4_test/d4test_common.sh
@@ -24,7 +24,7 @@ cd ${srcdir}/baseline; BASELINE=`pwd` ; cd ${WD}
 cd ${srcdir}/baselineraw; BASELINERAW=`pwd` ; cd ${WD}
 cd ${srcdir}/baselineremote; BASELINEREM=`pwd` ; cd ${WD}
 cd ${srcdir}/baselinehyrax; BASELINEH=`pwd` ; cd ${WD}
-cd ${srcdir}/baselinethredds; BASELINETH=`pwd` ; cd ${WD}
+cd ${builddir}/baselinethredds; BASELINETH=`pwd` ; cd ${WD}
 
 setresultdir() {
 rm -fr ${builddir}/$1
diff --git a/nc_test4/tst_vars2.c b/nc_test4/tst_vars2.c
index d00caab15..0d1a1c3a0 100644
--- a/nc_test4/tst_vars2.c
+++ b/nc_test4/tst_vars2.c
@@ -550,13 +550,15 @@ main(int argc, char **argv)
         if (nc_rename_var(ncid, wind_id, "windy") != NC_ENOTINDEFINE) ERR;
         if (nc_rename_var(ncid, wind_id, NULL) != NC_EINVAL) ERR;
 
+#if 0
+	/* Test disabled until netCDF-4 variable renaming is fixed... */
         /* rename variable */
         if (nc_rename_var(ncid, wind_id, "wind")) ERR;
-
         /* Enter define mode and rename it to something longer. */
         if (nc_redef(ncid)) ERR;
         if (nc_rename_var(ncid, wind_id, "windy")) ERR;
         if (nc_inq_varid(ncid, "windy", &wind_id)) ERR;
+#endif
         if (nc_close(ncid)) ERR;
 
         /* Try again without classic. */