Skip to content

Commit 5a4b95c

Browse files
authored
Merge pull request #3159 from DennisHeimbigner/s3forward.dmh
General Cleanup to provide a clean base for future PRs.
2 parents 9b9c170 + 0ebbabb commit 5a4b95c

86 files changed

Lines changed: 1244 additions & 840 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/run_tests_win_cygwin.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ jobs:
155155
-S . \
156156
-DCMAKE_INSTALL_PREFIX=/tmp \
157157
-DBUILD_SHARED_LIBS=ON \
158-
-DNETCDF_ENABLE_NETCDF_4=ON \
158+
-DNETCDF_ENABLE_HDF5=ON \
159159
-DNETCDF_BUILD_UTILITIES=ON \
160160
-DNETCDF_ENABLE_TESTS=ON \
161161
-DNETCDF_ENABLE_HDF5=ON \
@@ -185,5 +185,5 @@ jobs:
185185

186186
- name: (CMake) Verbose output of CTest failures
187187
run: >-
188-
PATH=$PWD/build:$PATH ctest --test-dir build --output-on-failure -j$(nproc) --rerun-failed -VV
188+
PATH=$PWD/build:$PATH ctest --test-dir build --output-on-failure -j$(nproc) --rerun-failed -VV
189189
if: ${{ failure() }}

.github/workflows/run_tests_win_mingw.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ jobs:
111111
-S . \
112112
-DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \
113113
-DBUILD_SHARED_LIBS=ON \
114-
-DNETCDF_ENABLE_NETCDF_4=ON \
114+
-DNETCDF_ENABLE_HDF5=ON \
115115
-DNETCDF_ENABLE_DAP=ON \
116116
-DNETCDF_BUILD_UTILITIES=ON \
117117
-DNETCDF_ENABLE_TESTS=ON \

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1760,6 +1760,10 @@ endif()
17601760
# WARNING: this must match the value in configure.ac
17611761
set(S3TESTBUCKET "unidata-zarr-test-data" CACHE STRING "S3 test bucket")
17621762

1763+
# Additional S3 Test Endpoing
1764+
set(S3ENDPOINT "s3.us-east-1.amazonaws.com" CACHE STRING "S3 endpoint")
1765+
1766+
17631767
# The working S3 path tree within the Unidata bucket.
17641768
# WARNING: this must match the value in configure.ac
17651769
set(S3TESTSUBTREE "netcdf-c" CACHE STRING "Working S3 path.")

RELEASE_NOTES.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ This file contains a high-level description of this package's evolution. Release
77

88
## 4.10.0 - TBD
99

10+
* Rebuild the S3-related code and other changes necessary to build cleanly on github actions. See [Github #3159](https://github.com/Unidata/netcdf-c/pull/3159) for more information.
1011
* Fix the problems around ncdap_test/test_manyurls.c. See [Github ????](https://github.com/Unidata/netcdf-c/issues/????) for more information.
1112
* Fix bug in ncdump when printing FQNs ([Issue 3184](https://github.com/Unidata/netcdf-c/issues/3184)). See [Github ????](https://github.com/Unidata/netcdf-c/issues/????) for more information.
13+
1214
* Update `macOS` github runners from macos-13 to macos-14, due to deprecation.
1315
* Fix an error compiling netCDF with AWS-S3-SDK support using cmake. See [Github 3155](https://github.com/Unidata/netcdf-c/issues/3155) for more information.
1416
* Add new environmental logging variable for `netCDF4` related logging subsystem, `NC4LOGGING`. If `libnetcdf` is compiled with logging enabled, logs can be enabled at runtime by setting this environmental variable to the desired log level.
15-
* Clean up the S3 API for all non-libnczarr code. This continues the splitting of PR [Github #3068](https://github.com/Unidata/netcdf-c/pull/3068).
16-
See [Github #3090](https://github.com/Unidata/netcdf-c/pull/3090) for more information.
17-
* Step 1 in splitting PR [Github #3068](https://github.com/Unidata/netcdf-c/pull/3068). Update ncjson.[ch] and ncproplist.[ch]. Also fix references to old API. Also fix include/netcdf_ncjson.h and include/netcdf_proplist.h builds. See [Github #3086](https://github.com/Unidata/netcdf-c/pull/3086) for more information.
17+
* Update ncjson.[ch] and ncproplist.[ch]. Also fix references to old API. Also fix include/netcdf_ncjson.h and include/netcdf_proplist.h builds. See [Github #3086](https://github.com/Unidata/netcdf-c/pull/3086) for more information.
1818
* Refactor drc.c to move many of its purely utility functions into dutil.c. Also change the NC_mktmp signature. Change other files to match. See [Github #3094](https://github.com/Unidata/netcdf-c/pull/3094) for more information.
1919
* Provide an auxilliary function, `ncaux_parse_provenance()`, that allows users to parse the _NCProperties attribute into a collection of character pointers. See [Github #3088](https://github.com/Unidata/netcdf-c/pull/3088) for more information.
20-
* Step 2 in splitting PR [Github #3068](https://github.com/Unidata/netcdf-c/pull/3068). Fix a namespace problem in tinyxml2.cpp. Note that this is a visual studio problem hence use of _MSC_VER. Also turn off DAP4 tests against Hyrax server until DAP4 spec problems are fixed. See [Github #3089](https://github.com/Unidata/netcdf-c/pull/3089) for more information.
20+
* Fix a namespace problem in tinyxml2.cpp. Note that this is a visual studio problem hence use of _MSC_VER. Also turn off DAP4 tests against Hyrax server until DAP4 spec problems are fixed. See [Github #3089](https://github.com/Unidata/netcdf-c/pull/3089) for more information.
2121

2222

2323
## 4.9.3 - February 7, 2025

cmake/dependencies.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ if(NETCDF_ENABLE_S3)
453453
if(NOT OpenSSL_FOUND)
454454
message(FATAL_ERROR "Can't find an ssl library, required by S3_INTERNAL")
455455
endif(NOT OpenSSL_FOUND)
456-
456+
457457
#find_package(Crypto REQUIRED)
458458
#if(NOT CRYPTO_LIB)
459459
# message(FATAL_ERROR "Can't find a crypto library, required by S3_INTERNAL")

cmake/netcdf_functions_macros.cmake

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,3 +337,21 @@ function(getlastdir s ret_val)
337337
set(${ret_val} "${last}" PARENT_SCOPE)
338338
endfunction()
339339

340+
function(buildnczarrtest src)
341+
foreach(_BT ${ARGN})
342+
SET(BTBSH "${CMAKE_CURRENT_BINARY_DIR}/run_${_BT}.sh")
343+
SET(BTBTMP "${CMAKE_CURRENT_BINARY_DIR}/run_${_BT}.tmp")
344+
SET(BTBSRCSH "${CMAKE_CURRENT_SOURCE_DIR}/../${src}/tst_${_BT}.sh")
345+
file(REMOVE "${BTBSH}")
346+
file(REMOVE "${BTBTMP}")
347+
file(APPEND "${BTBTMP}" "#!/bin/bash\n")
348+
file(APPEND "${BTBTMP}" "TESTNCZARR=1\n")
349+
file(READ "${BTBSRCSH}" _TSTFILE)
350+
string(REPLACE "\r" "" _TSTFILENOR "${_TSTFILE}")
351+
file(APPEND "${BTBTMP}" "${_TSTFILENOR}")
352+
# file(COPY "${BTBTMP}" DESTINATION "${BTBSH}" FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE)
353+
configure_file("${BTBTMP}" "${BTBSH}" @ONLY NEWLINE_STYLE LF)
354+
file(CHMOD "${BTBSH}" FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE)
355+
file(REMOVE "${BTBTMP}")
356+
endforeach()
357+
endfunction()

configure.ac

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2150,6 +2150,11 @@ AC_SUBST([S3TESTBUCKET],["unidata-zarr-test-data"])
21502150
AC_DEFINE([S3TESTSUBTREE], ["netcdf-c"], [S3 test path prefix])
21512151
AC_SUBST([S3TESTSUBTREE],[netcdf-c])
21522152

2153+
# Additional S3 Test Endpoint
2154+
# WARNING: this must match the value in CMakeLists.txt
2155+
AC_DEFINE([S3ENDPOINT], ["s3.us-east-1.amazonaws.com"], [S3 test endpoint])
2156+
AC_SUBST([S3ENDPOINT],["s3.us-east-1.amazonaws.com"])
2157+
21532158
# Build a small unique id to avoid interference on same platform
21542159
PLATFORMUID="$RANDOM"
21552160
# Make sure uid > 0

include/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ INSTALL(FILES ${netCDF_SOURCE_DIR}/include/netcdf_filter_build.h
3131
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
3232
COMPONENT headers)
3333

34+
INSTALL(FILES ${netCDF_SOURCE_DIR}/include/netcdf_vutils.h
35+
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
36+
COMPONENT headers)
37+
3438
INSTALL(FILES ${netCDF_BINARY_DIR}/include/netcdf_dispatch.h
3539
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
3640
COMPONENT headers)

include/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ include_HEADERS = netcdf.h netcdf_meta.h netcdf_mem.h netcdf_aux.h \
1212
netcdf_filter.h netcdf_filter_build.h netcdf_filter_hdf5_build.h \
1313
netcdf_dispatch.h netcdf_vutils.h
1414

15+
# Built headers
1516
include_HEADERS += netcdf_json.h netcdf_proplist.h
1617

1718
if BUILD_PARALLEL

include/ncbytes.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
#define NCBYTES_H 1
66

77
typedef struct NCbytes {
8-
int nonextendible; /* 1 => fail if an attempt is made to extend this buffer*/
8+
char* content;
99
unsigned long alloc;
1010
unsigned long length;
11-
char* content;
11+
int extendible; /* 0 => fail if an attempt is made to extend this buffer*/
1212
} NCbytes;
1313

1414
#include "ncexternl.h"
@@ -47,8 +47,8 @@ EXTERNL int ncbytesremove(NCbytes*,unsigned long);
4747
/* Concatenate a null-terminated string to the end of the buffer */
4848
EXTERNL int ncbytescat(NCbytes*,const char*);
4949

50-
/* Set the contents of the buffer; mark the buffer as non-extendible */
51-
EXTERNL int ncbytessetcontents(NCbytes*, void*, unsigned long);
50+
/* Set the contents of the buffer; mark the buffer extendible = false */
51+
EXTERNL int ncbytessetcontents(NCbytes*, void*, unsigned long, unsigned long length);
5252

5353
/* Following are always "in-lined"*/
5454
#define ncbyteslength(bb) ((bb)!=NULL?(bb)->length:0)

0 commit comments

Comments
 (0)