Skip to content

Commit

Permalink
Fix conflicts with main
Browse files Browse the repository at this point in the history
  • Loading branch information
DennisHeimbigner committed Jan 28, 2022
2 parents 89cc20a + 58199ee commit 610d8eb
Show file tree
Hide file tree
Showing 21 changed files with 220 additions and 156 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/run_tests_win_mingw.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
###
# Build hdf4, hdf5 dependencies and cache them in a combined directory.
# See https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
# for information related to github runners.
###

name: Run MSYS2, MinGW64-based Tests


on: [ pull_request ]

jobs:

build-and-test:

runs-on: windows-latest
defaults:
run:
shell: msys2 {0}

steps:

- uses: actions/checkout@v2
- uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: git mingw-w64-x86_64-toolchain automake libtool autoconf make cmake mingw-w64-x86_64-hdf5 unzip

###
# Configure and build
###

- name: (Autotools) Run autoconf
run: autoreconf -if

- name: (Autotools) Configure Build
run: ./configure --enable-hdf5 --enable-dap --disable-dap-remote-tests --disable-static --disable-plugins --disable-byterange --disable-dap-remote-tests --disable-logging
if: ${{ success() }}

- name: (Autotools) Look at config.log if error
run: cat config.log
if: ${{ failure() }}

- name: (Autotools) Print Summary
run: cat libnetcdf.settings

- name: (Autotools) Build Library and Utilities
run: make -j 8 LDFLAGS="-no-undefined -Wl,--export-all-symbols"
if: ${{ success() }}

- name: (Autotools) Build and Run Tests
run: make check -j 8
if: ${{ success() }}
21 changes: 11 additions & 10 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ This file contains a high-level description of this package's evolution. Release
* [Bug Fix] Make sure that netcdf.h accurately defines the flags in the open/create mode flags. See [Github #2183](https://github.com/Unidata/netcdf-c/pull/2183).
* [Enhancement] Improve support for msys2+mingw platform. See [Github #2171](https://github.com/Unidata/netcdf-c/pull/2171).
* [Bug Fix] Clean up the various inter-test dependencies in ncdump for CMake. See [Github #2168](https://github.com/Unidata/netcdf-c/pull/2168).
* [Enhancement] Added options to suppress the new behavior from [Github #2135](https://github.com/Unidata/netcdf-c/pull/2135). The options for `cmake` and `configure` are, respectively `-DENABLE_LIBXML2` and `--(enable/disable)-libxml2`. Both of these options defaul to 'on/enabled'. When disabled, the bundled `ezxml` XML interpreter is used regardless of whether `libxml2` is present on the system.
* [Bug Fix] Fix use of non-aws appliances. See [Github #2152](https://github.com/Unidata/netcdf-c/pull/2152).
* [Enhancement] Added options to suppress the new behavior from [Github #2135](https://github.com/Unidata/netcdf-c/pull/2135). The options for `cmake` and `configure` are, respectively `-DENABLE_LIBXML2` and `--(enable/disable)-libxml2`. Both of these options defaul to 'on/enabled'. When disabled, the bundled `ezxml` XML interpreter is used regardless of whether `libxml2` is present on the system.
* [Enhancement] Support optional use of libxml2, otherwise default to ezxml. See [Github #2135](https://github.com/Unidata/netcdf-c/pull/2135) -- H/T to [Egbert Eich](https://github.com/e4t).
* [Bug Fix] Fix several os related errors. See [Github #2138](https://github.com/Unidata/netcdf-c/pull/2138).
* [Enhancement] Support byte-range reading of netcdf-3 files stored in private buckets in S3. See [Github #2134](https://github.com/Unidata/netcdf-c/pull/2134)
Expand All @@ -30,24 +31,24 @@ This file contains a high-level description of this package's evolution. Release
* [Enhancement] Convert to a new representation of the NCZarr meta-data extensions: version 2. Read-only backward compatibility is provided. See [Github #2032](https://github.com/Unidata/netcdf-c/pull/2032).
* [Bug Fix] Fix dimension_separator bug in libnczarr. See [Github #2035](https://github.com/Unidata/netcdf-c/pull/2035).
* [Bug Fix] Fix bugs in libdap4. See [Github #2005](https://github.com/Unidata/netcdf-c/pull/2005).
* [Bug Fix] Store NCZarr fillvalue as a singleton instead of a 1-element array. See [Github #2017](https://github.com/Unidata/netcdf-c/pull/2017).
* [Bug Fix] Store NCZarr fillvalue as a singleton instead of a 1-element array. See [Github #2017](https://github.com/Unidata/netcdf-c/pull/2017).
* [Bug Fixes] The netcdf-c library was incorrectly determining the scope of dimension; similar to the type scope problem. See [Github #2012](https://github.com/Unidata/netcdf-c/pull/2012) for more information.
* [Bug Fix] Re-enable DAP2 authorization testing. See [Github #2011](https://github.com/Unidata/netcdf-c/issues/2011).
* [Bug Fix] Fix bug with windows version of mkstemp that causes failure to create more than 26 temp files. See [Github #1998](https://github.com/Unidata/netcdf-c/pull/1998).
* [Bug Fix] Fix ncdump bug when printing VLENs with basetype char. See [Github #1986](https://github.com/Unidata/netcdf-c/issues/1986).
* [Bug Fix] Re-enable DAP2 authorization testing. See [Github #2011](https://github.com/Unidata/netcdf-c/issues/2011).
* [Bug Fix] Fix bug with windows version of mkstemp that causes failure to create more than 26 temp files. See [Github #1998](https://github.com/Unidata/netcdf-c/pull/1998).
* [Bug Fix] Fix ncdump bug when printing VLENs with basetype char. See [Github #1986](https://github.com/Unidata/netcdf-c/issues/1986).
* [Bug Fixes] The netcdf-c library was incorrectly determining the scope of types referred to by nc_inq_type_equal. See [Github #1959](https://github.com/Unidata/netcdf-c/pull/1959) for more information.
* [Bug Fix] Fix bug in use of XGetopt when building under Mingw. See [Github #2009](https://github.com/Unidata/netcdf-c/issues/2009).
* [Enhancement] Improve the error reporting when attempting to use a filter for which no implementation can be found in HDF5_PLUGIN_PATH. See [Github #2000](https://github.com/Unidata/netcdf-c/pull/2000) for more information.
* [Bug Fix] Fix `make distcheck` issue in `nczarr_test/` directory. See [Github #2007](https://github.com/Unidata/netcdf-c/issues/2007).
* [Bug Fix] Fix bug in NCclosedir in dpathmgr.c. See [Github #2003](https://github.com/Unidata/netcdf-c/issues/2003).
* [Bug Fix] Fix bug in ncdump that assumes that there is a relationship between the total number of dimensions and the max dimension id. See [Github #2004](https://github.com/Unidata/netcdf-c/issues/2004).
* [Bug Fix] Fix bug in JSON processing of strings with embedded quotes. See [Github #1993](https://github.com/Unidata/netcdf-c/issues/1993).
* [Bug Fix] Fix bug in ncdump that assumes that there is a relationship between the total number of dimensions and the max dimension id. See [Github #2004](https://github.com/Unidata/netcdf-c/issues/2004).
* [Bug Fix] Fix bug in JSON processing of strings with embedded quotes. See [Github #1993](https://github.com/Unidata/netcdf-c/issues/1993).
* [Enhancement] Add support for the new "dimension_separator" enhancement to Zarr v2. See [Github #1990](https://github.com/Unidata/netcdf-c/pull/1990) for more information.
* [Bug Fix] Fix hack for handling failure of shell programs to properly handle escape characters. See [Github #1989](https://github.com/Unidata/netcdf-c/issues/1989).
* [Bug Fix] Allow some primitive type names to be used as identifiers depending on the file format. See [Github #1984](https://github.com/Unidata/netcdf-c/issues/1984).
* [Bug Fix] Fix hack for handling failure of shell programs to properly handle escape characters. See [Github #1989](https://github.com/Unidata/netcdf-c/issues/1989).
* [Bug Fix] Allow some primitive type names to be used as identifiers depending on the file format. See [Github #1984](https://github.com/Unidata/netcdf-c/issues/1984).
* [Enhancement] Add support for reading/writing pure Zarr storage format that supports the XArray _ARRAY_DIMENSIONS attribute. See [Github #1952](https://github.com/Unidata/netcdf-c/pull/1952) for more information.
* [Update] Updated version of bzip2 used in filter testing/functionality, in support of [Github #1969](https://github.com/Unidata/netcdf-c/issues/1969).
* [Bug Fix] Corrected HDF5 version detection logic as described in [Github #1962](https://github.com/Unidata/netcdf-c/issues/1962).
* [Bug Fix] Corrected HDF5 version detection logic as described in [Github #1962](https://github.com/Unidata/netcdf-c/issues/1962).

## 4.8.0 - March 30, 2021

Expand Down
4 changes: 2 additions & 2 deletions include/ncs3sdk.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
extern "C" {
#endif

EXTERNL void NC_s3sdkinitialize(void);
EXTERNL void NC_s3sdkfinalize(void);
EXTERNL int NC_s3sdkinitialize(void);
EXTERNL int NC_s3sdkfinalize(void);
EXTERNL void* NC_s3sdkcreateclient(NCS3INFO* context);
EXTERNL int NC_s3sdkbucketexists(void* s3client, const char* bucket, int* existsp, char** errmsgp);
EXTERNL int NC_s3sdkbucketcreate(void* s3client, const char* region, const char* bucket, char** errmsgp);
Expand Down
5 changes: 5 additions & 0 deletions libdispatch/dfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@

#undef DEBUG

#ifndef nulldup
#define nulldup(s) ((s)?strdup(s):NULL)
#endif


extern int NC_initialized; /**< True when dispatch table is initialized. */

/* User-defined formats. */
Expand Down
31 changes: 18 additions & 13 deletions libdispatch/dinfermodel.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
#endif
#endif

#ifndef nulldup
#define nulldup(x) ((x)?strdup(x):(x))
#endif

#undef DEBUG

/* If Defined, then use only stdio for all magic number io;
Expand Down Expand Up @@ -251,7 +255,7 @@ processuri(const char* path, NCURI** urip, NClist* fraglenv)
if(!found)
{stat = NC_EINVAL; goto done;} /* unrecognized URL form */

/* process the corresponding fragments for that protocol */
/* process the corresponding fragments for that protocol */
if(protolist->fragments != NULL) {
int i;
tmp = nclistnew();
Expand All @@ -266,7 +270,7 @@ processuri(const char* path, NCURI** urip, NClist* fraglenv)
}
nclistfreeall(tmp); tmp = NULL;
}

/* Substitute the protocol in any case */
if(protolist->substitute) ncurisetprotocol(uri,protolist->substitute);

Expand Down Expand Up @@ -461,7 +465,7 @@ processmacros(NClist** fraglenvp)

if(fraglenvp == NULL || nclistlength(*fraglenvp) == 0) goto done;
fraglenv = *fraglenvp;
expanded = nclistnew();
expanded = nclistnew();
while(nclistlength(fraglenv) > 0) {
int found = 0;
char* key = NULL;
Expand Down Expand Up @@ -606,7 +610,7 @@ mergekey(NClist** valuesp)
if(strcasecmp(candidate,value)==0)
{nullfree(value); value = NULL; break;}
}
}
}
if(value != NULL) {nclistpush(newvalues,value); value = NULL;}
}
/* Make sure to have at least 1 value */
Expand Down Expand Up @@ -679,11 +683,11 @@ cleanfragments(NClist** fraglenvp)
newlist = nclistnew();
buf = ncbytesnew();
allkeys = nclistnew();
tmp = nclistnew();
tmp = nclistnew();

/* collect all unique keys */
collectallkeys(fraglenv,allkeys);
/* Collect all values for same key across all fragments */
/* Collect all values for same key across all fragments */
for(i=0;i<nclistlength(allkeys);i++) {
key = nclistget(allkeys,i);
collectvaluesbykey(fraglenv,key,tmp);
Expand All @@ -710,7 +714,7 @@ cleanfragments(NClist** fraglenvp)
static int
processfragmentkeys(const char* key, const char* value, NCmodel* model)
{
return NC_NOERR;
return NC_NOERR;
}

/*
Expand Down Expand Up @@ -794,7 +798,7 @@ set_default_mode(int* modep)
case NC_FORMAT_NETCDF4_CLASSIC: mode |= (NC_NETCDF4|NC_CLASSIC_MODEL); break;
case NC_FORMAT_CLASSIC: /* fall thru */
default: break; /* default to classic */
}
}
*modep = mode; /* final result */
}

Expand Down Expand Up @@ -858,7 +862,7 @@ NC_infermodel(const char* path, int* omodep, int iscreate, int useparallel, void
#endif

/* Phase 4: Rebuild the url fragment and rebuilt the url */
sfrag = envvlist2string(fraglenv,"&");
sfrag = envvlist2string(fraglenv,"&");
nclistfreeall(fraglenv); fraglenv = NULL;
#ifdef DEBUG
fprintf(stderr,"frag final: %s\n",sfrag);
Expand Down Expand Up @@ -889,8 +893,9 @@ NC_infermodel(const char* path, int* omodep, int iscreate, int useparallel, void
fprintf(stderr,"newpath=|%s|\n",*newpathp); fflush(stderr);
#endif
}

/* Phase 5: Process the mode key to see if we can tell the formatx */
modeval = ncurifragmentlookup(uri,"mode");
modeval = ncurifragmentlookup(uri,"mode");
if(modeval != NULL) {
if((stat = parseonchar(modeval,',',modeargs))) goto done;
for(i=0;i<nclistlength(modeargs);i++) {
Expand Down Expand Up @@ -920,7 +925,7 @@ NC_infermodel(const char* path, int* omodep, int iscreate, int useparallel, void

} else {/* Not URL */
if(*newpathp) *newpathp = NULL;
}
}

/* Phase 8: mode inference from mode flags */
/* The modeargs did not give us a model (probably not a URL).
Expand Down Expand Up @@ -1031,7 +1036,7 @@ nc__testurl(const char* path0, char** basenamep)
NCURI* uri = NULL;
int ok = 0;
char* path = NULL;

if(!ncuriparse(path0,&uri)) {
char* p;
char* q;
Expand Down Expand Up @@ -1139,7 +1144,7 @@ check_file_type(const char *path, int omode, int use_parallel,
model->format = format;
goto done;
}
#endif
#endif

magicinfo.path = path; /* do not free */
magicinfo.uri = uri; /* do not free */
Expand Down
36 changes: 20 additions & 16 deletions libdispatch/drc.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ See COPYRIGHT for license information.
#include "ncauth.h"
#include "ncpathmgr.h"

#ifndef nulldup
#define nulldup(x) ((x)?strdup(x):(x))
#endif

#undef NOREAD

#undef DRCDEBUG
Expand Down Expand Up @@ -76,7 +80,7 @@ ncrc_createglobalstate(void)
{
int stat = NC_NOERR;
const char* tmp = NULL;

if(ncrc_globalstate == NULL) {
ncrc_globalstate = calloc(1,sizeof(NCRCglobalstate));
}
Expand All @@ -99,18 +103,18 @@ Initialize defaults and load:
For debugging support, it is possible
to change where the code looks for the .aws directory.
This is set by the environment variable NC_TEST_AWS_DIR.
This is set by the environment variable NC_TEST_AWS_DIR.
*/

void
ncrc_initialize(void)
{
int stat = NC_NOERR;

if(NCRCinitialized) return;
NCRCinitialized = 1; /* prevent recursion */

#ifndef NOREAD
/* Load entrys */
if((stat = NC_rcload())) {
Expand Down Expand Up @@ -192,7 +196,7 @@ NC_rcload(void)

if(!NCRCinitialized) ncrc_initialize();
globalstate = ncrc_getglobalstate();


if(globalstate->rcinfo.ignore) {
nclog(NCLOGDBG,".rc file loading suppressed");
Expand All @@ -217,21 +221,21 @@ NC_rcload(void)
const char** rcname;
const char* dirnames[3];
const char** dir;


/* Make sure rcinfo.rchome is defined */
ncrc_setrchome();

dirnames[0] = globalstate->rcinfo.rchome;
dirnames[1] = globalstate->cwd;
dirnames[2] = NULL;

for(dir=dirnames;*dir;dir++) {
for(dir=dirnames;*dir;dir++) {
for(rcname=rcfilenames;*rcname;rcname++) {
ret = rcsearch(*dir,*rcname,&path);
if(ret == NC_NOERR && path != NULL)
nclistpush(rcfileorder,path);
path = NULL;
path = NULL;
}
}
}
Expand Down Expand Up @@ -612,7 +616,7 @@ NC_rcfile_insert(const char* key, const char* value, const char* hostport, const
if(!NCRCinitialized) ncrc_initialize();
globalstate = ncrc_getglobalstate();
rc = globalstate->rcinfo.entries;

if(rc == NULL) {
rc = nclistnew();
if(rc == NULL) {ret = NC_ENOMEM; goto done;}
Expand Down Expand Up @@ -727,7 +731,7 @@ NC_getdefaults3region(NCURI* uri, const char** regionp)
region = NC_rclookupx(uri,"AWS.REGION");
if(region == NULL) {/* See if we can find a profile */
if((stat = NC_getactives3profile(uri,&profile))==NC_NOERR) {
if(profile)
if(profile)
(void)NC_s3profilelookup(profile,"aws_region",&region);
}
}
Expand Down Expand Up @@ -835,7 +839,7 @@ awslex(AWSparser* parser)
} else if(c == ';') {
char* p = parser->pos - 1;
if(*p == '\n') {
/* Skip comment */
/* Skip comment */
do {p++;} while(*p != '\n' && *p != '\0');
parser->pos = p;
token = (*p == '\n'?AWS_EOL:AWS_EOF);
Expand Down Expand Up @@ -952,12 +956,12 @@ fprintf(stderr,">>> parse: profile=%s\n",profile->name);
if((entry = (struct AWSentry*)calloc(1,sizeof(struct AWSentry)))==NULL)
{stat = NC_ENOMEM; goto done;}
entry->key = key; key = NULL;
entry->value = value; value = NULL;
entry->value = value; value = NULL;
#ifdef PARSEDEBUG
fprintf(stderr,">>> parse: entry=(%s,%s)\n",entry->key,entry->value);
#endif
nclistpush(profile->entries,entry); entry = NULL;
if(token == AWS_WORD) token = awslex(parser); /* finish the line */
if(token == AWS_WORD) token = awslex(parser); /* finish the line */
} else
{stat = NCTHROW(NC_EINVAL); goto done;}
}
Expand Down Expand Up @@ -1099,7 +1103,7 @@ NC_authgets3profile(const char* profilename, struct AWSprofile** profilep)
int stat = NC_NOERR;
int i = -1;
NCRCglobalstate* gstate = ncrc_getglobalstate();

for(i=0;i<nclistlength(gstate->s3creds.profiles);i++) {
struct AWSprofile* profile = (struct AWSprofile*)nclistget(gstate->s3creds.profiles,i);
if(strcmp(profilename,profile->name)==0)
Expand Down
11 changes: 6 additions & 5 deletions libdispatch/ds3util.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,12 @@ NC_s3urlrebuild(NCURI* url, NCURI** newurlp, char** bucketp, char** outregionp)
if((stat = NC_getdefaults3region(url,&region0))) goto done;
region = strdup(region0);
}
/* Construct the revised host */
ncbytescat(buf,"s3.");
ncbytescat(buf,region);
ncbytescat(buf,AWSHOST);
host = ncbytesextract(buf);
if(host == NULL) { /* Construct the revised host */
ncbytescat(buf,"s3.");
ncbytescat(buf,region);
ncbytescat(buf,AWSHOST);
host = ncbytesextract(buf);
}

/* Construct the revised path */
ncbytesclear(buf);
Expand Down
Loading

0 comments on commit 610d8eb

Please sign in to comment.