Skip to content

Add bundled filter plugin directory to HDF5 plugin search path#478

Merged
mattjala merged 1 commit into
HDFGroup:masterfrom
mattjala:filter_path
Jul 9, 2026
Merged

Add bundled filter plugin directory to HDF5 plugin search path#478
mattjala merged 1 commit into
HDFGroup:masterfrom
mattjala:filter_path

Conversation

@mattjala

@mattjala mattjala commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Datasets written with the HDF5 filter plugins bundled in an HDFView installation could not be read unless the user manually added the plugin directory under User Options. Trying to open such a dataset failed because the library had no registered plugin path pointing at the bundled filters (#477).

This happened because HDFView never established a plugin-path policy of its own. At startup it read back whatever paths the HDF5 native library already had, via ViewProperties.loadPluginPaths() -> H5Plugins.getPluginPaths() -> H5PLget(). Those paths were just the defaults compiled into the native jarhdf5 library at compile time, persisting github-runner specific paths into the published builds.

HDFView takes a prefix-built HDF5 library and relocates it into a jpackage bundle at $APPDIR. HDF5 has no $ORIGIN-relative plugin discovery, so the prefix-relative default points at a path that does not exist on the end user's machine. Installers copy the bundled filters into /plugin (e.g. /lib/app/plugin on Linux, where jpackage sets hdfview.root to $APPDIR; see hdfview/pom.xml), a location the library's compiled-in defaults can never name. Because only the running app knows its actual install location, the correct path can only be supplied at runtime, by the application.

This PR gives HDFView an explicit plugin-path policy in initPluginPaths(), called once at startup. It loads the library's existing paths, then resolves <hdfview.root>/plugin and, if that directory exists and is not already registered, prepends it via ViewProperties.prependPluginPath() -> H5PLprepend() so the bundled filters take precedence over stale/system defaults.

The path is recomputed from hdfview.root on every launch, so it should be accurate across multiple installs and reinstalls. It should also do no harm when no such directory exists. The prefix-relative default remains in the library-reported list but is harmless, since the correct location is present and searched first.

Fixes #477

Datasets written with the HDF5 filter plugins bundled in an HDFView
installation could not be read unless the user manually added the plugin
directory under User Options. Trying to open such a dataset failed
because the library had no registered plugin path pointing at the bundled
filters (HDFGroup#477).

This happened because HDFView never established a plugin-path policy of
its own. At startup it read back whatever paths the HDF5 native
library already had, via ViewProperties.loadPluginPaths() ->
H5Plugins.getPluginPaths() -> H5PLget(). Those paths were just the
defaults compiled into the native jarhdf5 library at compile time,
persisting github-runner specific paths into the published builds.

HDFView takes a prefix-built HDF5 library and relocates it into a jpackage
bundle at $APPDIR. HDF5 has no $ORIGIN-relative plugin discovery, so the prefix-relative default points
at a path that does not exist on the end user's machine. Installers copy
the bundled filters into <root>/plugin (e.g. <install>/lib/app/plugin on
Linux, where jpackage sets hdfview.root to $APPDIR; see hdfview/pom.xml),
a location the library's compiled-in defaults can never name. Because
only the running app knows its actual install location, the correct path
can only be supplied at runtime, by the application.

This PR gives HDFView an explicit plugin-path policy in initPluginPaths(), called
once at startup. It loads the library's existing paths, then resolves
<hdfview.root>/plugin and, if that directory exists and is not already
registered, prepends it via ViewProperties.prependPluginPath() ->
H5PLprepend() so the bundled filters take precedence over stale/system
defaults.

The path is recomputed from hdfview.root on every launch, so it should
be accurate across multiple installs and reinstalls. It should also do no harm
when no such directory exists. The prefix-relative default
remains in the library-reported list but is harmless, since the
correct location is present and searched first.

Fixes HDFGroup#477
@mattjala mattjala added the Component - Build Build system improvement label Jul 8, 2026
@mattjala mattjala merged commit fd4ba76 into HDFGroup:master Jul 9, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component - Build Build system improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Installed filter plugins directory is not added to plugin paths by default

2 participants