[Git][ghc/ghc][wip/mangoiv/27672] configure: fix sed script and subst tooldir script
Hannes Siebenhandl pushed to branch wip/mangoiv/27672 at Glasgow Haskell Compiler / GHC Commits: 2e06635e by mangoiv at 2026-10-02T11:16:03+02:00 configure: fix sed script and subst tooldir script Fixes #27672 Adds sanity checking for SUBST_TOOLDIR Metric Decrease: LinkableUsage01 MultiLayerModulesTH_OneShot T10547 T12234 T12425 T13035 T13820 T18140 T18730 T18923 T9198 TcPlugin_RewritePerf mhu-perf - - - - - 2 changed files: - distrib/configure.ac.in - m4/subst_tooldir.m4 Changes: ===================================== distrib/configure.ac.in ===================================== @@ -103,7 +103,7 @@ AC_ARG_ENABLE(distro-toolchain, AC_SUBST([EnableDistroToolchain]) if test "$HostOS" = "mingw32" -a "$EnableDistroToolchain" = "NO"; then - FP_SETUP_WINDOWS_TOOLCHAIN([$hardtop/mingw/], [\$\$topdir/../mingw/]) + FP_SETUP_WINDOWS_TOOLCHAIN([$hardtop/mingw/], [\$topdir/../mingw/]) fi ===================================== m4/subst_tooldir.m4 ===================================== @@ -41,5 +41,13 @@ dnl ghc-toolchain. # See Note [How we configure the bundled windows toolchain] AC_DEFUN([SUBST_TOOLDIR], [ - sed -i.bkp $1 's%'"$mingw_prefix"'%'"$mingw_install_prefix"'%g' + if ! grep -qF "$mingw_prefix" $1; then + AC_MSG_ERROR([SUBST_TOOLDIR: $1 does not refer to the bundled mingw toolchain at $mingw_prefix]) + fi + if ! sed -i.bkp 's%'"$mingw_prefix"'%'"$mingw_install_prefix"'%g' $1; then + AC_MSG_ERROR([SUBST_TOOLDIR: failed to substitute $mingw_prefix in $1]) + fi + if grep -qF "$mingw_prefix" $1; then + AC_MSG_ERROR([SUBST_TOOLDIR: $1 still refers to $mingw_prefix after substitution]) + fi ]) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2e06635e593997342d63d96cb82c24ef... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2e06635e593997342d63d96cb82c24ef... You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
participants (1)
-
Hannes Siebenhandl (@fendor)