Skip to content

PackageTests/Regression/T4025/setup.test.hs fails on MacOS on some GHC versions #7988

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
andreabedini opened this issue Feb 17, 2022 · 4 comments

Comments

@andreabedini
Copy link
Collaborator

The test PackageTests/Regression/T4025/setup.test.hs fails on MacOS with some GHC versions.

GHC versions known to fail

  • 8.10.7

GHC versions known to pass

  • 8.8.4

The test cases checks makes sure we do not set the RPATH accidentally. Therefore the test crafts an executable and expects it to fail to run.

-- This should fail as it we should NOT be able to find the
-- dynamic library for the internal library (since we didn't
-- install it). If we incorrectly encoded our local dist
-- dir in the RPATH, this will succeed.
recordMode DoNotRecord . fails $ runExe "exe" []

Comparing these two locally, the RPATH is not set with GHC 8.8.4 but it is set with GHC 8.10.7

With GHC 8.10.7

The test fails and the RPATH is set

$ otool -l /Users/andrea/code/cabal/cabal-testsuite/PackageTests/Regression/T4025/setup.dist/work/./dist/build/exe/exe
/Users/andrea/code/cabal/cabal-testsuite/PackageTests/Regression/T4025/setup.dist/work/./dist/build/exe/exe:
...
Load command 25
          cmd LC_RPATH
      cmdsize 112
         path /Users/andrea/code/cabal/cabal-testsuite/PackageTests/Regression/T4025/setup.dist/work/dist/build (offset 12)

With GHC 8.8.4

The test passes and you can see the linker complaining.

Linking setup.dist/work/dist/build/exe/exe ...
+ /Users/andrea/code/cabal/cabal-testsuite/PackageTests/Regression/T4025/setup.dist/work/./dist/build/exe/exe
dyld[39050]: Library not loaded: @rpath/libHST4025-1.0-ghc8.8.4.dylib
  Referenced from: /Users/andrea/code/cabal/cabal-testsuite/PackageTests/Regression/T4025/setup.dist/work/dist/build/exe/exe
  Reason: tried: '/Users/andrea/code/cabal/cabal-testsuite/PackageTests/Regression/T4025/setup.dist/usr/lib/x86_64-osx-ghc-8.8.4/libHST4025-1.0-ghc8.8.4.dylib' (no such file), '/Users/andrea/.ghcup/ghc/8.8.4/lib/ghc-8.8.4/base-4.13.0.0/libHST4025-1.0-ghc8.8.4.dylib' (no such file), '/Users/andrea/.ghcup/ghc/8.8.4/lib/ghc-8.8.4/ghc-prim-0.5.3/libHST4025-1.0-ghc8.8.4.dylib' (no such file), '/Users/andrea/.ghcup/ghc/8.8.4/lib/ghc-8.8.4/integer-gmp-1.0.2.0/libHST4025-1.0-ghc8.8.4.dylib' (no such file), '/Users/andrea/.ghcup/ghc/8.8.4/lib/ghc-8.8.4/rts/libHST4025-1.0-ghc8.8.4.dylib' (no such file), '/Users/andrea/code/cabal/cabal-testsuite/PackageTests/Regression/T4025/setup.dist/usr/lib/x86_64-osx-ghc-8.8.4/libHST4025-1.0-ghc8.8.4.dylib' (no such file), '/Users/andrea/.ghcup/ghc/8.8.4/lib/ghc-8.8.4/base-4.13.0.0/libHST4025-1.0-ghc8.8.4.dylib' (no such file), '/Users/andrea/.ghcup/ghc/8.8.4/lib/ghc-8.8.4/ghc-prim-0.5.3/libHST4025-1.0-ghc8.8.4.dylib' (no such file), '/Users/andrea/.ghcup/ghc/8.8.4/lib/ghc-8.8.4/integer-gmp-1.0.2.0/libHST4025-1.0-ghc8.8.4.dylib' (no such file), '/Users/andrea/.ghcup/ghc/8.8.4/lib/ghc-8.8.4/rts/libHST4025-1.0-ghc8.8.4.dylib' (no such file), '/usr/local/lib/libHST4025-1.0-ghc8.8.4.dylib' (no such file), '/usr/lib/libHST4025-1.0-ghc8.8.4.dylib' (no such file)
@andreasabel
Copy link
Member

This bug has been reported as:

@Mikolaj
Copy link
Member

Mikolaj commented Feb 17, 2022

Duplicate of #7610

@Mikolaj Mikolaj marked this as a duplicate of #7610 Feb 17, 2022
@Mikolaj
Copy link
Member

Mikolaj commented Feb 17, 2022

@andreabedini: if you agree, feel free to close.

@andreabedini
Copy link
Collaborator Author

Yes, it looks like the same bug.

robx added a commit to robx/cabal that referenced this issue Feb 28, 2022
robx added a commit to robx/cabal that referenced this issue Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants