Skip to content

Fix Windows CI failure and update msys2 env - #419

Merged
prj- merged 7 commits into
FreeFem:developfrom
simonlegrand:update_msys2_env
Nov 28, 2026
Merged

prj- merged 7 commits into
FreeFem:developfrom
simonlegrand:update_msys2_env

Conversation

@simonlegrand

Copy link
Copy Markdown
Contributor

Summary

I fixed the make check failure of full-msmpi.yml. MUMPS.dll plugin couldn't be loaded because the plugin was not compiled due to no mpifc being detected (a dependency of MUMPS.cpp). I couldn't reproduce the problem on a local VM, but it appeared that the MPI detection was not fully fonctionnal. I also don't know why we didn't encounter the problem before...

Main changes

  • Strip the quotes of mpi* -show commands in etc/config/m4/acmpi.m4. It prevented ff_MPI_INCLUDE_DIR from being filled and messed up the Fortran MPI detection l.267-272.
  • Fix the MPI compilers wrappers search on Windows. It searched in the same directory as mpiexec.exe, i.e. MS-MPI installation directory, not in the MSYS2 PATH. The reason why it worked before was that it relied on PETSc's MPI detection, at reconfigure time.
  • Update the MSYS2 environment to UCRT64, MinGW64 being deprecated.

Secondary changes

  • Remove the MacOS 14 workflows. The distribution is EOL since September, Github has deprecated them.
  • Fix the .dll copies in src/bin-win32. I don't understand why, but ldd src/win-bin32/*.{dll,exe} misses libmsmpifec.dll, while ldd src-bin32/MUMPS.dll doesn't... AI told me that a better tool to use is ntldd`, suited for Windows binaries, and all .dlls are now copied.

Suggestions

I think we should stop the compilation somewhere between ff-get-dep.in and load.link.in when a plugin's dependency is missing. Or maybe make a missing plugin in LIST_COMPILE fatal. It would ease the debugging of such situations. I can open another PR for this if you want.

@simonlegrand

Copy link
Copy Markdown
Contributor Author

@prj-, have you had time to take a look?

@prj-

prj- commented Nov 26, 2026

Copy link
Copy Markdown
Member

The latest pipeline has a couple of failures. Is it still ready for review?

@prj-

prj- commented Nov 26, 2026

Copy link
Copy Markdown
Member

You are prefixing some commits by [CI] but not others. Remove all such prefixes, please (this is nonstandard and not used in FreeFEM repository).

@prj-

prj- commented Nov 26, 2026

Copy link
Copy Markdown
Member

Still failing.

@simonlegrand
simonlegrand force-pushed the update_msys2_env branch 2 times, most recently from c87974b to 7cc0073 Compare November 26, 2026 16:34
@simonlegrand

simonlegrand commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor Author

My bad, I forgot to adapt the new prefix of packages introduced by b079fb7. It should be better.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The unchanged PETSc cache key risks restoring incompatible MINGW64 artifacts, while hardcoded UCRT64 dependency paths and missing ntldd can leave Windows packages without the correct runtime DLLs.

3 open issues
What changed in this PR

This PR addresses FreeFEM’s Windows MPI detection failures and updates its CI and installer packaging for MSYS2 UCRT64.

Changes:

  • Fix Windows MPI wrapper discovery and normalize quoted compiler output.
  • Migrate Windows CI dependencies to UCRT64 and remove macOS 14 matrix entries.
  • Update runtime DLL collection and PETSc installer path handling.
File Description
Makefile.am Use ntldd for DLL collection and a configurable PETSc path.
etc/​config/​m4/​WindowsPackage.m4 Remove the hardcoded legacy PETSc packaging fallback.
etc/​config/​m4/​acmpi.m4 Adjust MPI wrapper lookup, executable handling, and output parsing.
configure.ac Correct Windows PETSc path conversion and substitution.
.github/​workflows/​sequential.yml Switch Windows dependencies to UCRT64 and remove macOS 14.
.github/​workflows/​minimal.yml Switch Windows dependencies to UCRT64 and remove macOS 14.
.github/​workflows/​full-msmpi.yml Migrate MS-MPI dependencies and Python cleanup to UCRT64.
.github/​workflows/​full-mpich.yml Remove macOS 14 from the build matrix.

Review effort: Balanced

Comment thread .github/workflows/full-msmpi.yml Resolved
Comment thread .github/workflows/full-msmpi.yml Outdated
mingw-w64-x86_64-cmake
mingw-w64-x86_64-msmpi
mingw-w64-ucrt-x86_64-cmake
mingw-w64-ucrt-x86_64-msmpi
Comment thread Makefile.am Outdated
# Also copy MSYS2 .dlls
win32: WindowsPackage.iss FreeFEM-documentation.pdf
ldd src/bin-win32/*.{dll,exe} | grep -vi /windows | grep -v /bin-win32 | grep -v libff.dll | grep '=>' | awk '{print "cp",$$3,"./src/bin-win32/"}' | sort -u | grep -v '[?]' | sh
ntldd -R src/bin-win32/*.{dll,exe} | grep -oiE '[A-Za-z0-9_.+-]+\.dll' | sort -u | while read d; do [ -f /ucrt64/bin/"$$d" ] && echo "cp -p /ucrt64/bin/$$d ./src/bin-win32/"; done | sh

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Seems partially relevant to me since MinGW64 is not expected to be used anymore. But adding an MSYS2_PREFIX could be useful in case we want to also support clang64 environment. Is it something we want?
I'll modify readme/README_WINDOWS.md so that it doesn't mention mingw64 anymore.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If things were already properly prefixed by ${MINGW_PREFIX}, then we wouldn't be in this situation.

@prj-

prj- commented Nov 26, 2026

Copy link
Copy Markdown
Member

There is a couple of credible comments by Copilot, please have a look. It's good to go on my end otherwise once these are addressed.

- MinGW64 is deprecated.
- Fix the Windows PETSc prefix.
$MPIRUN (where mpiexec.exe is) should not be searched on Windows. Instead search
wrappers in MSYS2's path (like /ucrt64/bin).
If no .exe is added, CMake configured dependencies (like PARMETIS) fail to
detect the compilers.
For I don't know what reason, globbing ldd src/bin-win32/*.{dll,exe} didn't
output libmsmpifec.dll, while ldd src/bin-win32/MUMPS.dll did.
ntldd seems a better tool for windows binaries, and does the job.
@simonlegrand

Copy link
Copy Markdown
Contributor Author

I added the mods. It's ok for me.

@prj-

prj- commented Nov 27, 2026

Copy link
Copy Markdown
Member

Will merge later today, thanks.

@prj-
prj- merged commit ada8efb into FreeFem:develop Nov 28, 2026
31 of 42 checks passed
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.

3 participants