Commit Graph

171 Commits

Author SHA1 Message Date
Dennis Heimbigner
8ee9453043 valg2 2023-04-26 13:20:54 -06:00
Dennis Heimbigner
5dd237246f fault1 2023-04-26 13:03:21 -06:00
Dennis Heimbigner
3eaa4bbb2c valgrind1 2023-04-26 12:38:11 -06:00
Dennis Heimbigner
49737888ca Improve S3 Documentation and Support
## Improvements to S3 Documentation
* Create a new document *quickstart_paths.md* that give a summary of the legal path formats used by netcdf-c. This includes both file paths and URL paths.
* Modify *nczarr.md* to remove most of the S3 related text.
* Move the S3 text from *nczarr.md* to a new document *cloud.md*.
* Add some S3-related text to the *byterange.md* document.

Hopefully, this will make it easier for users to find the information they want.

## Rebuild NCZarr Testing
In order to avoid problems with running make check in parallel, two changes were made:
1. The *nczarr_test* test system was rebuilt. Now, for each test.
any generated files are kept in a test-specific directory, isolated
from all other test executions.
2. Similarly, since the S3 test bucket is shared, any generated S3 objects
are isolated using a test-specific key path.

## Other S3 Related Changes
* Add code to ensure that files created on S3 are reclaimed at end of testing.
* Used the bash "trap" command to ensure S3 cleanup even if the test fails.
* Cleanup the S3 related configure.ac flag set since S3 is used in several places. So now one should use the option *--enable-s3* instead of *--enable-nczarr-s3*, although the latter is still kept as a deprecated alias for the former.
* Get some of the github actions yml to work with S3; required fixing various test scripts adding a secret to access the Unidata S3 bucket.
* Cleanup S3 portion of libnetcdf.settings.in and netcdf_meta.h.in and test_common.in.
* Merge partial S3 support into dhttp.c.
* Create an experimental s3 access library especially for use with Windows. It is enabled by using the options *--enable-s3-internal* (automake) or *-DENABLE_S3_INTERNAL=ON* (CMake). Also add a unit-test for it.
* Move some definitions from ncrc.h to ncs3sdk.h

## Other Changes
* Provide a default implementation of strlcpy and move this and similar defaults into *dmissing.c*.
2023-04-25 17:15:06 -06:00
Ward Fisher
dc6e392c9d
Merge branch 'main' into znotnc.dmh 2023-04-12 16:02:34 -06:00
Dennis Heimbigner
2aee428ee4 ubuntufix1 2023-04-04 14:28:32 -06:00
Dennis Heimbigner
0ca921f721 ub1" 2023-04-04 13:15:27 -06:00
Dennis Heimbigner
d738e03f5b Update 2023-03-14 14:14:44 -06:00
Ward Fisher
331ed2bdab Expand CI testing with HDF5 1.14.0 2023-03-14 11:47:57 -06:00
Ward Fisher
77738e546d Add hdf5 1.14.0 to GitHub CI. 2023-03-14 11:39:14 -06:00
Dennis Heimbigner
5c07ebfd11 Check at nc_open if file appears to be in NCZarr/Zarr format.
re: Issue https://github.com/Unidata/netcdf-c/issues/2656

Charlie Zender notes that *nc_open()* does not immediately detect that the given path refers to a file not in zarr format. Rather it fails later when trying to read the (meta-)data.

The reason is that the Zarr format is highly decentralized. There is no easily testable magic number or superblock to look for. In effect the only way to see if a directory is Zarr is to successfully read it.

It is possible to heuristically detect that a path refers to an NCZarr/Zarr file by doing a breadth-first search of the file tree starting at the given path. If the search encounters a file whose name starts with ".z", then assume it is a legitimate NCZarr/Zarr file. Of course, this test could be costly. One hopes that in practice that it is not.

In addition to this fix, a corresponding test case was added.

## Other Changes

re: PR https://github.com/Unidata/netcdf-c/pull/2529

There was an error under Cygwin for this PR that is fixed in this PR. The fix was to convert all *noinst_* references to *check_*.
2023-03-13 13:24:14 -06:00
Ward Fisher
34f64d4322 Update github action configuration scripts. 2023-01-27 12:06:39 -07:00
DWesl
fe67ea4224 CI: Change autotools CI build to out-of-tree build.
This is a reference to an issue with how most distribution packagers
run autotools (source in one directory, compile in another, install
to a third.
There was a PR to catch errors in that kind of build by running
make distcheck; this should do the relevant bits of that PR,
taking into account the preference for separate build and compile
steps.
2023-01-12 10:58:03 -05:00
Ward Fisher
341a43b5aa Correct lingering merge issue. 2023-01-09 20:27:12 -08:00
Ward Fisher
4c27c59fea Update whitespace. 2023-01-09 20:26:05 -08:00
Ward Fisher
bd0341256b Add libiconv-devel to cygwin CI 2023-01-09 14:55:30 -08:00
Ward Fisher
e02f678168 Correct libcurl development package. 2023-01-09 14:45:02 -08:00
Ward Fisher
19a1f9ec29 Add libcurl-dev to cygwin github actions 2023-01-09 14:43:50 -08:00
Ward Fisher
435f16bcb9 Merge branch 'loop.dmh' of https://github.com/DennisHeimbigner/netcdf-c into v4.9.1-wellspring.wif 2023-01-04 14:07:34 -08:00
Dennis Heimbigner
a03bb5e601 Fix infinite loop in file inferencing
re: Issue https://github.com/Unidata/netcdf-c/issues/2573

The file type inferencer in libdispatch/dinference.c has a simple
forward inference mechanism so that the occurrence of certain mode
values in a URL fragment implies inclusion of additional mode values.
This kind of inference is notorious for leading to cycles if not
careful. Unfortunately, this occurred in the one in dinference.c.

This was fixed by providing a more complicated, but more reliable inference
mechanism.

## Misc. Other Changes
* Found and fixed a couple of memory leaks.
* There is a recent problem in building HDF4 support on github actions. Fixed by using the internal HDF4 xdr capability.
* Some filter-related code was not being properly ifdef'd with ENABLE_NCZARRA_FILTERS.
2022-12-18 13:18:00 -07:00
Ward Fisher
087d3b6c37 Supported headers for hdf4 are not installed in actions, and there does not appear (currently) to be an easy way to reinstall these. 2022-11-18 11:34:09 -07:00
DWesl
a0aa2b3e11 CI: Revert Windows CI run on push.
I requested this when working on a branch,
rather than a pull request.
This is a PR now, so I should go back to how
things were before.
2022-10-13 19:31:42 -04:00
DWesl
18b76baed0 CI: Disable CMake tests on Cygwin and MinGW.
Cygwin tests don't pass for no reason I can discern; MinGW tests don't
build, again for no reason I can discern.
2022-10-12 13:36:52 -04:00
DWesl
b85c929a97 CI: Prep Cygwin CI run for adding CMake build. 2022-10-12 12:58:04 -04:00
DWesl
d33e3155d8 CI: Try to skip failing NCZarr Plugin tests on MinGW 2022-10-12 12:58:01 -04:00
DWesl
1ef000cae1 CI, DBG: Upload MinGW test logs on failure. 2022-10-12 12:55:37 -04:00
DWesl
f000e15cb5 BLD: Try fixing the export-symbols problem on MinGW
It's not exporting symbols at the moment, and I'd prefer to avoid -Wl,--export-all-symbols.
2022-10-12 12:55:35 -04:00
DWesl
086eed0e39 CI, TST: Check that test plugins don't get installed with DESTDIR
This caused problems for packagers (unidata/netcdf-c#2431)
2022-10-12 10:54:40 -04:00
DWesl
a69308e5b7 CI: Add Cygwin CI run. 2022-10-12 10:54:38 -04:00
Ward Fisher
9b9fcfb6ba Update hdf5 version in github actions. 2022-09-09 16:15:42 -06:00
Dennis Heimbigner
6abaab967b Fix some problems with PR https://github.com/Unidata/netcdf-c/pull/2492
re: PR https://github.com/Unidata/netcdf-c/pull/2492
re: Issue https://github.com/Unidata/netcdf-c/issues/2494

This PR fixes some problems with the pull request https://github.com/Unidata/netcdf-c/pull/2492 in response to Issue https://github.com/Unidata/netcdf-c/issues/2494.

* Found and fixed more scalar handling problems and add a test case for scalars.
* Cleanup nczarr_test/run_string.sh test
* Document *_nczarr_default_maxstrlen* and *_nczarr_maxstrlen*.

* Support both "Nan" and *Nan* as being floating point constants
  for attributes. It is unclear from the Zarr V2 spec if
  unquoted *Nan* is legal or not, but support for reading.
  Write the quoted versions when writing an attribute.  Similar
  for Infinity constants.
  So NCZarr supports the following constants for use in Attributes
    * *Nan*, "Nan", *-Nan*, "-Nan"
    * *Nanf*, "Nanf", *-Nanf*, "-Nanf"
    * *Infinity*, "Infinity", *-Infinity*, "-Infinity"
    * *Infinityf*, "Infinityf", *-Infinityf*, "-Infinityf"
2022-09-03 14:21:48 -06:00
Dennis Heimbigner
231ae96c4b Add support for Zarr string type to NCZarr
* re: https://github.com/Unidata/netcdf-c/pull/2278
* re: https://github.com/Unidata/netcdf-c/issues/2485
* re: https://github.com/Unidata/netcdf-c/issues/2474

This PR subsumes PR https://github.com/Unidata/netcdf-c/pull/2278.
Actually is a bit an omnibus covering several issues.

## PR https://github.com/Unidata/netcdf-c/pull/2278
Add support for the Zarr string type.
Zarr strings are restricted currently to be of fixed size.
The primary issue to be addressed is to provide a way for user to
specify the size of the fixed length strings. This is handled by providing
the following new attributes special:
1. **_nczarr_default_maxstrlen** —
This is an attribute of the root group. It specifies the default
maximum string length for string types. If not specified, then
it has the value of 64 characters.
2. **_nczarr_maxstrlen** —
This is a per-variable attribute. It specifies the maximum
string length for the string type associated with the variable.
If not specified, then it is assigned the value of
**_nczarr_default_maxstrlen**.

This PR also requires some hacking to handle the existing netcdf-c NC_CHAR
type, which does not exist in zarr. The goal was to choose numpy types for
both the netcdf-c NC_STRING type and the netcdf-c NC_CHAR type such that
if a pure zarr implementation read them, it would still work and an
NC_CHAR type would be handled by zarr as a string of length 1.

For writing variables and NCZarr attributes, the type mapping is as follows:
* "|S1" for NC_CHAR.
* ">S1" for NC_STRING && MAXSTRLEN==1
* ">Sn" for NC_STRING && MAXSTRLEN==n

Note that it is a bit of a hack to use endianness, but it should be ok since for
string/char, the endianness has no meaning.

For reading attributes with pure zarr (i.e. with no nczarr
atribute types defined), they will always be interpreted as of
type NC_CHAR.

## Issue: https://github.com/Unidata/netcdf-c/issues/2474
This PR partly fixes this issue because it provided more
comprehensive support for Zarr attributes that are JSON valued expressions.
This PR still does not address the problem in that issue where the
_ARRAY_DIMENSION attribute is incorrectly set. Than can only be
fixed by the creator of the datasets.

## Issue: https://github.com/Unidata/netcdf-c/issues/2485
This PR also fixes the scalar failure shown in this issue.
It generally cleans up scalar handling.
It also adds a note to the documentation describing that
NCZarr supports scalars while Zarr does not and also how
scalar interoperability is achieved.

## Misc. Other Changes
1. Convert the nczarr special attributes and keys to be all lower case. So "_NCZARR_ATTR" now used "_nczarr_attr. Support back compatibility for the upper case names.
2. Cleanup my too-clever-by-half handling of scalars in libnczarr.
2022-08-27 20:21:13 -06:00
Ward Fisher
7d6d4b9b40 Fix a typo. 2022-06-28 16:31:15 -06:00
Ward Fisher
73a0d92f9d Fix a typo. 2022-06-28 16:30:26 -06:00
Ward Fisher
e34f8d5dc0 Run one-off tests first. 2022-06-28 16:29:35 -06:00
Ward Fisher
ff34b66182 Fix cache check. 2022-06-28 16:27:23 -06:00
Ward Fisher
bfca030037 Fixing cmake-based run_pnetcdf_tests.sh 2022-06-28 15:04:58 -06:00
Ward Fisher
545ce88476
Merge pull request #2377 from edwardhartnett/ejh_update_doxyfile
Updating Doxyfile.in with doxygen-1.8.17, turned on WARN_AS_ERROR, added doxygen build to CI run
2022-06-22 13:31:25 -06:00
Ward Fisher
d6dee0c8ca Add libxml2 install to mingw GitHub actions. 2022-06-21 17:05:47 -06:00
Ward Fisher
5f1e18b83d Add manual GitHub actions triggers for the tests. 2022-06-13 16:56:22 -06:00
Ward Fisher
c3ed070fe5 Testing manual workflow_dispatch for github actions. 2022-06-09 15:04:10 -06:00
Edward Hartnett
ce767aec23 change to trigger CI 2022-06-08 07:08:21 +03:00
Edward Hartnett
1e8b98bd06 installing doxygen in CI when needed 2022-06-07 18:04:15 +03:00
Edward Hartnett
e3ccb4a22c installing doxygen in CI when needed 2022-06-07 16:01:07 +03:00
Edward Hartnett
981f452952 installing doxygen in CI when needed 2022-06-07 15:55:18 +03:00
Edward Hartnett
aa7e07007c installing doxygen in CI when needed 2022-06-07 15:40:24 +03:00
Edward Hartnett
c051209f8b turned on WARN_AS_ERROR and added documentation build to CI 2022-06-07 15:24:21 +03:00
Edward Hartnett
581b1c1c4d updated Doxyfile.in 2022-06-07 15:10:20 +03:00
Edward Hartnett
a76a6795e7 checking doxygen version 2022-06-07 14:57:23 +03:00
Dennis Heimbigner
d34a222141 Turn off debug 2022-04-30 21:43:08 -06:00