-
Notifications
You must be signed in to change notification settings - Fork 89
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
Fix building with MSYS2 distributed MinGW hdf5. #229
Conversation
Do you have a way of including this build in the CI? |
I will try to include it. And by the way, |
@mulimoen I've added a job to test this crate with MSYS2. |
The clippy lints should be fixed in a separate PR, I think clippy supports |
The package updated just now, and the dll name now changes with the soversion. Should we use |
The new test passed. |
I have not used a windows system in ages. I think you are a better judge of whether |
MSYS2 provides
|
I added pkg-config support for all windows target because the gnu and msvc targets all supports pkg-config, and (maybe a bug?) they cannot be dealt separately. (When targeting GNU, a MSVC target build script will also be built and executed.) And for Windows target, I choose to trust pkg-config result and not checking the dll, because at first we wanted to avoid hard-coding the dll names with pkg-config, which could not provide the dll name either. |
We know hdf5 localisation is difficult, especially on windows. Thanks a lot for doing this the proper way |
Pkg-config for Windows support added. Now it should work with pkg-config, and if pkg-config is not installed,
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some minor comments, otherwise this PR is in great shape. Would you mind adding to the changelog?
If there's still interest in moving this forward, it would have to be rebased on the latest master, now that 1.14 support is in and all the build failures etc have been hopefully resolved and fixed. |
I've merged master but need approval to run CI. |
@Berrysoft There's changelog conflicts so you might want to quickly rebase again. It looks like your build ran on CI and failed: https://github.com/aldanor/hdf5-rust/actions/runs/5227987760/jobs/9440874079?pr=229 Because the version is |
Signed-off-by: Yuyi Wang <Strawberry_Str@hotmail.com>
I solved the conflicts and updated the regex. Now it should parse both kind of versions. |
@mulimoen Looks good? Any comments from your side? Seems like mingw build now runs green again 1.14.1.2. // @Berrysoft not to be picky, minor nit: in PRs you'd normally rebase your branch against the main one as opposed to merging, otherwise you end up with all those merge commits in main. No big deal though, I'll just squash-merge it. |
Interestingly enough, this mingw run doesn't hit this problem HDFGroup/hdf5#3091 |
I cannot reproduce this problem on my device either. |
Weird with the 1.14.1-2 static build, can't see any obvious differences in the build flags. Looks good to go! |
Now merged, thanks @Berrysoft |
is_msvc
tobuild.rs
to determine target enviroment from env var instead ofcfg!
, to make cross-compile right. Here the term "cross-compile" also means targeting GNU with MSVC toolchain (which is very common).libhdf5-0.dll
orlibhdf5-310.dll
(see this commit: msys2/MINGW-packages@205f329). I'm afraid we need to update the dll name every time MSYS2 updates it. I suggest usingpkgconf
to detect it in the future.msvc_dll_indirection
to MSVC only.