Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emit hdf5 version as a build constant #48

Merged
merged 4 commits into from
Jan 13, 2025

Conversation

magnusuMET
Copy link
Collaborator

Hopefully this works for you @philbucher. It is re-exported in hdf5 and the version is visible in the generated docs.

Fixes #47

@philbucher
Copy link

thanks for the fast response, this is awesome!
I will try asap this week!

Copy link

@philbucher philbucher left a comment

Choose a reason for hiding this comment

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

I tried to include your repo in my project with
hdf5 = {git = "https://github.com/magnusuMET/hdf5-rust.git", branch = 'const_hdf5_version'}

but I get the following error:

error: no matching package named `hdf5` found
location searched: Git repository https://github.com/magnusuMET/hdf5-rust.git?branch=const_hdf5_version

I have the feeling that this might be because the hdf package does not exist in the default branch, but unsure.
Maybe you could rebase your default branch to update to the latest version?

Or not if thats too much work, to me the code looks ok as is, I can also test once its merged

Thanks again!

@magnusuMET
Copy link
Collaborator Author

The package is named hdf5-metno. You should be able to do a simple patch by adding the following to your Cargo.toml (this is overriding the dependency):

[patch.crates-io]
hdf5 = { package="hdf5-metno", git = "https://github.com/magnusuMET/hdf5-rust.git", branch = "const_hdf5_version" }

@philbucher
Copy link

now I got it to work, thanks!
Works perfectly

@magnusuMET magnusuMET merged commit 2f03deb into metno:main Jan 13, 2025
38 checks passed
@magnusuMET magnusuMET deleted the const_hdf5_version branch January 13, 2025 17:13
@magnusuMET
Copy link
Collaborator Author

Thanks for suggesting this feature, it is released as 0.9.4 on crates.io

@philbucher
Copy link

Awesome

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.

Check hdf version at compile time
2 participants