From 617faf4cba95c20a7b3ca9e0295cfb2803ac5067 Mon Sep 17 00:00:00 2001 From: Javier Sagredo Date: Fri, 19 Jul 2024 00:31:23 +0200 Subject: [PATCH 1/3] Fix ForeignLibs test for Windows (cherry picked from commit be1ae31830c913485fd1714607e1063a60177f83) # Conflicts: # cabal-testsuite/PackageTests/ForeignLibs/setup.test.hs --- cabal-testsuite/PackageTests/ForeignLibs/MyForeignLib.def | 4 ++++ cabal-testsuite/PackageTests/ForeignLibs/my-foreign-lib.cabal | 3 ++- cabal-testsuite/PackageTests/ForeignLibs/setup.test.hs | 4 ++++ 3 files changed, 10 insertions(+), 1 deletion(-) 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..c64b452d3c5 100644 --- a/cabal-testsuite/PackageTests/ForeignLibs/setup.test.hs +++ b/cabal-testsuite/PackageTests/ForeignLibs/setup.test.hs @@ -29,8 +29,12 @@ main = setupAndCabalTest . recordMode DoNotRecord $ do skipUnlessGhcVersion ">= 7.8" win <- isWindows ghc94 <- isGhcVersion ">= 9.4.1" +<<<<<<< HEAD expectBrokenIf (win && ghc94) 8451 $ withPackageDb $ do +======= + withPackageDb $ do +>>>>>>> be1ae3183 (Fix ForeignLibs test for Windows) setup_install [] setup "copy" [] -- regression test #4156 dist_dir <- fmap testDistDir getTestEnv From 69f6e201b20e5fa9ee089aff7255882c1634d009 Mon Sep 17 00:00:00 2001 From: brandon s allbery kf8nh Date: Sat, 20 Jul 2024 22:10:08 -0400 Subject: [PATCH 2/3] try to build without #10211 --- cabal-testsuite/PackageTests/ForeignLibs/setup.test.hs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/cabal-testsuite/PackageTests/ForeignLibs/setup.test.hs b/cabal-testsuite/PackageTests/ForeignLibs/setup.test.hs index c64b452d3c5..1dcf918eaed 100644 --- a/cabal-testsuite/PackageTests/ForeignLibs/setup.test.hs +++ b/cabal-testsuite/PackageTests/ForeignLibs/setup.test.hs @@ -29,12 +29,8 @@ main = setupAndCabalTest . recordMode DoNotRecord $ do skipUnlessGhcVersion ">= 7.8" win <- isWindows ghc94 <- isGhcVersion ">= 9.4.1" -<<<<<<< HEAD expectBrokenIf (win && ghc94) 8451 $ withPackageDb $ do -======= - withPackageDb $ do ->>>>>>> be1ae3183 (Fix ForeignLibs test for Windows) setup_install [] setup "copy" [] -- regression test #4156 dist_dir <- fmap testDistDir getTestEnv From b7f5c522c9ff93cfba34c3ccfc129da2fd0bfda0 Mon Sep 17 00:00:00 2001 From: brandon s allbery kf8nh Date: Sat, 20 Jul 2024 22:35:49 -0400 Subject: [PATCH 3/3] Swap it in the correct direction --- cabal-testsuite/PackageTests/ForeignLibs/setup.test.hs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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