You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
env file created by "cabal install --lib ..." (Cabal 3.8.1 ) breaks profiling with ghc 9.6.1 on my Mac
To Reproduce
Steps to reproduce the behavior:
On a Mac running ghc 9.6.1 and cabal 3.8.1 where packages have been installed with "cabal install --lib ..." do
ghc -static -prof -fprof-auto hello.hs
Loaded package environment from /Users/gcolpitts/.ghc/x86_64-darwin-9.6.1/environments/default
[1 of 2] Compiling Main ( hello.hs, hello.o ) [Missing object file]
[2 of 2] Linking hello [Objects changed]
ld: warning: directory not found for option '-L/opt/local/lib/'
ld: library not found for -lHStxmth-0.12.7.1-f954854b_p
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ghc-9.6.1: `gcc' failed in phase `Linker'. (Exit code: 1)
The file hello.hs has one line
main = putStrLn "hello"
The file compiles without error if I add "-package-env=-"
ghc -static -package-env=- -prof -fprof-auto hello.hs
[1 of 2] Compiling Main ( hello.hs, hello.o ) [Missing object file]
[2 of 2] Linking hello [Objects changed]
Expected behavior
I expect it to compile without error if I omit "-package-env=-"
System information
MacOS Ventura 13.3.1
cabal --version
cabal-install version 3.8.1.0
compiled using version 3.8.1.0 of the Cabal library
bash-3.2$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 9.6.1
The text was updated successfully, but these errors were encountered:
So it appears that with a package environment, ghc tries to link against profiling libs of all packages in the environment, regardless of if they are used by the package being compiled. This seems like a ghc issue and not a cabal issue per-se? I.e. your reproducer only requires ghc and an environment file (which may also be created outside of cabal) that happens to have a lib without profiling involved, correct?
Describe the bug
env file created by "cabal install --lib ..." (Cabal 3.8.1 ) breaks profiling with ghc 9.6.1 on my Mac
To Reproduce
Steps to reproduce the behavior:
On a Mac running ghc 9.6.1 and cabal 3.8.1 where packages have been installed with "cabal install --lib ..." do
The file hello.hs has one line
The file compiles without error if I add "-package-env=-"
Expected behavior
I expect it to compile without error if I omit "-package-env=-"
System information
MacOS Ventura 13.3.1
cabal --version
cabal-install version 3.8.1.0
compiled using version 3.8.1.0 of the Cabal library
bash-3.2$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 9.6.1
The text was updated successfully, but these errors were encountered: