From 18370c56ce8fa99131cd204be9578dc81c95f3a0 Mon Sep 17 00:00:00 2001 From: Oscar Dowson Date: Fri, 8 Mar 2024 10:22:06 +1300 Subject: [PATCH 1/2] [SDPA] fix Windows build --- S/SDPA/build_tarballs.jl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/S/SDPA/build_tarballs.jl b/S/SDPA/build_tarballs.jl index 0917101dc79..97b27010e0c 100755 --- a/S/SDPA/build_tarballs.jl +++ b/S/SDPA/build_tarballs.jl @@ -53,6 +53,11 @@ cd $WORKSPACE/srcdir/sdpa-* rm -f ${prefix}/lib/*.la update_configure_scripts +if [[ "${target}" == *-mingw* ]]; then + # Needed for https://github.com/JuliaPackaging/Yggdrasil/issues/7904 + rm $prefix/lib/libgcc* $prefix/lib/libmsvcrt* +fi + # Apply patches atomic_patch -p1 $WORKSPACE/srcdir/patches/shared.diff atomic_patch -p1 $WORKSPACE/srcdir/patches/lt_init.diff From 9c2fcfab1f4a157c34a94a0a20800f5b0b3e2560 Mon Sep 17 00:00:00 2001 From: Oscar Dowson Date: Fri, 8 Mar 2024 11:15:36 +1300 Subject: [PATCH 2/2] Update build_tarballs.jl --- S/SDPA/build_tarballs.jl | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/S/SDPA/build_tarballs.jl b/S/SDPA/build_tarballs.jl index 97b27010e0c..2cb8d2bb597 100755 --- a/S/SDPA/build_tarballs.jl +++ b/S/SDPA/build_tarballs.jl @@ -49,15 +49,32 @@ METIS_packagespec = PackageSpec(; name = "METIS4_jll", script = raw""" cd $WORKSPACE/srcdir/sdpa-* +if [[ "${target}" == *-mingw* ]]; then + # This is needed because otherwise we get unusable binaries (error "The specified + # executable is not a valid application for this OS platform"). These come from + # CompilerSupportLibraries_jll. + # xref: https://github.com/JuliaPackaging/Yggdrasil/issues/7904 + # + # The remove path pattern matches `lib/gcc///`, where `` is the + # platform triplet and `` is the GCC major version with which CSL was built + # xref: https://github.com/JuliaPackaging/Yggdrasil/pull/7535 + # + # However, before CSL v1.1, these files were located in just `lib/`, thus we clean this + # directory as well. + if test -n "$(find $prefix/lib/gcc/*mingw*/*/libgcc*)"; then + rm $prefix/lib/gcc/*mingw*/*/libgcc* $prefix/lib/gcc/*mingw*/*/libmsvcrt* + elif test -n "$(find $prefix/lib/libgcc*)"; then + rm $prefix/lib/libgcc* $prefix/lib/libmsvcrt* + else + echo "Could not find any libraries to remove :-/" + find $prefix/lib + fi +fi + # Remove misleading libtool files rm -f ${prefix}/lib/*.la update_configure_scripts -if [[ "${target}" == *-mingw* ]]; then - # Needed for https://github.com/JuliaPackaging/Yggdrasil/issues/7904 - rm $prefix/lib/libgcc* $prefix/lib/libmsvcrt* -fi - # Apply patches atomic_patch -p1 $WORKSPACE/srcdir/patches/shared.diff atomic_patch -p1 $WORKSPACE/srcdir/patches/lt_init.diff