haskell / haskell/cabal

env file created by "cabal install --lib ..." (Cabal 3.8.1 ) breaks profiling with ghc 9.6.1 on my Mac

Open
#8,948 3 comments 0 reactions 0 assignees View on GitHub
cabal-install: environment-files re: install --lib
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

**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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.