From 4eb74342b30d08571ec69a2e196662f98005ab69 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Sun, 21 Jul 2024 20:08:26 +0000 Subject: [PATCH] Fix ForeignLibs test for Windows (backport #10212) (#10219) * Fix ForeignLibs test for Windows (cherry picked from commit be1ae31830c913485fd1714607e1063a60177f83) # Conflicts: # cabal-testsuite/PackageTests/ForeignLibs/setup.test.hs * try to build without #10211 * Swap it in the correct direction --------- Co-authored-by: Javier Sagredo Co-authored-by: brandon s allbery kf8nh --- cabal-testsuite/PackageTests/ForeignLibs/MyForeignLib.def | 4 ++++ .../PackageTests/ForeignLibs/my-foreign-lib.cabal | 3 ++- cabal-testsuite/PackageTests/ForeignLibs/setup.test.hs | 5 +---- 3 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 cabal-testsuite/PackageTests/ForeignLibs/MyForeignLib.def diff --git a/cabal-testsuite/PackageTests/ForeignLibs/MyForeignLib.def b/cabal-testsuite/PackageTests/ForeignLibs/MyForeignLib.def new file mode 100644 index 00000000000..b9438c8d6a0 --- /dev/null +++ b/cabal-testsuite/PackageTests/ForeignLibs/MyForeignLib.def @@ -0,0 +1,4 @@ +EXPORTS + sayHi + myForeignLibExit + myForeignLibInit diff --git a/cabal-testsuite/PackageTests/ForeignLibs/my-foreign-lib.cabal b/cabal-testsuite/PackageTests/ForeignLibs/my-foreign-lib.cabal index 8b63dc24e9e..43a5a655567 100644 --- a/cabal-testsuite/PackageTests/ForeignLibs/my-foreign-lib.cabal +++ b/cabal-testsuite/PackageTests/ForeignLibs/my-foreign-lib.cabal @@ -16,7 +16,8 @@ foreign-library myforeignlib type: native-shared if os(windows) - options: standalone + options: standalone + mod-def-file: MyForeignLib.def other-modules: MyForeignLib.Hello MyForeignLib.SomeBindings diff --git a/cabal-testsuite/PackageTests/ForeignLibs/setup.test.hs b/cabal-testsuite/PackageTests/ForeignLibs/setup.test.hs index 1dcf918eaed..cf57133aa1b 100644 --- a/cabal-testsuite/PackageTests/ForeignLibs/setup.test.hs +++ b/cabal-testsuite/PackageTests/ForeignLibs/setup.test.hs @@ -27,10 +27,7 @@ import Test.Cabal.Prelude main = setupAndCabalTest . recordMode DoNotRecord $ do -- Foreign libraries don't work with GHC 7.6 and earlier skipUnlessGhcVersion ">= 7.8" - win <- isWindows - ghc94 <- isGhcVersion ">= 9.4.1" - expectBrokenIf (win && ghc94) 8451 $ - withPackageDb $ do + withPackageDb $ do setup_install [] setup "copy" [] -- regression test #4156 dist_dir <- fmap testDistDir getTestEnv