Skip to content

toward HDF5 2.2.0 - #50

Draft
bogovicj wants to merge 1 commit into
masterfrom
janelia-jhdf5
Draft

bogovicj wants to merge 1 commit into
masterfrom
janelia-jhdf5

Conversation

@bogovicj

@bogovicj bogovicj commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator

* still SNAPSHOT versions for now

@mkitti mkitti left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Downstream check of this PR against the HDF5 2.2.0 work in janelia-jhdf5, on macOS arm64.

It works once janelia-jhdf5 loads its own native library. Built against janelia-jhdf5 with JaneliaSciComp/janelia-jhdf5#13 and #14 (installed locally as 22.03.01-SNAPSHOT) and org.bytedeco:hdf5:2.2.0-1.5.15-SNAPSHOT, mvn test passes 47 tests with 5 skipped. That's identical to master (cbabb1a) with cisd:jhdf5.

Depends on janelia-jhdf5 #13. Against the janelia-jhdf5 stack without #13, 40 of 47 tests error with UnsatisfiedLinkError: 'int hdf.hdf5lib.H5.H5dont_atexit()', because nothing in janelia-jhdf5's main code loaded hdf5_java. #13 fixes that, and #14 fixes the case where an enum such as CharacterEncoding or HDF5DataClass is touched before a factory.

Before this can merge:

  • Snapshot dependencies. pom-scijava's RequireReproducibleBuilds enforcer rule fails on org.scijava:janelia-jhdf5:22.03.01-SNAPSHOT. The local check used -Denforcer.skip=true. This needs releases of janelia-jhdf5 and of the bytedeco presets.
  • CI can't resolve the snapshots. The janelia-jhdf5 snapshot isn't published anywhere, and the org.bytedeco snapshots live at https://central.sonatype.com/repository/maven-snapshots/, which isn't among this project's repositories. Fine for a draft.
  • Natives on other platforms. janelia-jhdf5's published pom currently brings only macosx-arm64 natives. JaneliaSciComp/janelia-jhdf5#11 switches it to hdf5-platform; until then, this would fail on Linux, Windows and Intel Macs.
  • Windows additionally needs bytedeco/javacpp-presets#1814: without it, the two HDF5 Java bindings load separate HDF5 libraries on Windows.

Small suggestions:

  • slf4j: slf4j-api is only needed because org.bytedeco:hdf5 leaves it optional while hdf.hdf5lib.H5 requires it. That's better declared once in janelia-jhdf5 as a regular dependency, so each consumer doesn't have to. Keeping it here meanwhile is fine.
  • Version overrides: the javacpp.version/hdf5.version overrides must stay in step with whatever janelia-jhdf5 is built against. They can be dropped once pom-scijava manages those versions.

🤖 Generated with Claude Code

bogovicj pushed a commit to bogovicj/janelia-jhdf5 that referenced this pull request Oct 15, 2026
n5-hdf5 is the first consumer of janelia-jhdf5 and exercises its public
API from a separate project, including loading the native library from
library code (JaneliaSciComp#13/JaneliaSciComp#14), which this project's own tests can't check. The
new job installs the build, checks out n5-hdf5's janelia-jhdf5 branch
(saalfeldlab/n5-hdf5#50) and runs its tests against that version, on the
same OS/Java matrix as the main tests.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@mkitti

mkitti commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Suggestions to make this draft build in CI while it waits on the releases. These mirror what we did for the other repos in the migration to janelia-jhdf5 (e.g. fiji/HDF5_Vibez#22, bigdataviewer/bigdataviewer-core#228), so the temporary plumbing looks the same everywhere and is easy to find and remove later.

1. pom.xml: add the snapshot repository that org.bytedeco:hdf5:2.2.0-1.5.15-SNAPSHOT and javacpp come from, and mark the temporary parts:

<repositories>
	<!-- Temporary: org.bytedeco snapshots (javacpp, hdf5) needed by janelia-jhdf5 until they are released. -->
	<repository>
		<id>central-portal-snapshots</id>
		<url>https://central.sonatype.com/repository/maven-snapshots/</url>
		<releases><enabled>false</enabled></releases>
		<snapshots><enabled>true</enabled></snapshots>
	</repository>
</repositories>

(If the project already declares scijava.public, keep it alongside.) A "remove once janelia-jhdf5 is released" comment on janelia-jhdf5.version makes the cleanup list obvious.

2. .github/workflows/build-pr.yml and build-main.yml: build and install the janelia-jhdf5 snapshot first, and skip the SNAPSHOT-rejecting enforcer rule:

      # Temporary: janelia-jhdf5 22.03.01-SNAPSHOT is not published anywhere, so build and
      # install it into ~/.m2 first. Remove once janelia-jhdf5 is released.
      - name: Check out janelia-jhdf5
        uses: actions/checkout@v4
        with:
          repository: JaneliaSciComp/janelia-jhdf5
          ref: main
          path: janelia-jhdf5
      - name: Install janelia-jhdf5 snapshot
        working-directory: janelia-jhdf5
        run: mvn -B -U install -DskipTests -Djacoco.skip=true -Djavacpp.platform=linux-x86_64
        shell: bash

and on the build step:

        env:
          # pom-scijava's enforcer rejects SNAPSHOT dependencies.
          MAVEN_ARGS: -Denforcer.skip=true

platform-test.yml (plain mvn -B clean test) would need the same two additions, plus -Denforcer.skip=true; its other platforms also need the hdf5-platform natives from JaneliaSciComp/janelia-jhdf5#11 as noted above, so it can stay red until then.

3. Downstream note: since n5-hdf5 currently brings cisd:jhdf5:19.04.1 into consumers transitively, projects that depend on n5-hdf5 and already moved to janelia-jhdf5 (e.g. saalfeldlab/transform-helpers#8) have to exclude it, otherwise both jars (with duplicate ch.systemsx.cisd.* classes) are on the classpath. Once this PR merges and is released, those exclusions can be dropped.

If it helps, I can push these changes to a branch on mkitti/n5-hdf5 for you to cherry-pick, or open a PR against saalfeldlab:janelia-jhdf5.

🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants