commercialhaskell / commercialhaskell/stack

Compiling setup does not honor the --with-gcc flag

Open
#5,035 2 comments 0 reactions 0 assignees View on GitHub
type: bug
Dominant language
Haskell
Stars
4.1k
Forks
850
Avg merge
10h 37m
Merged PRs (30d)
4

Description

I am using stack 2.1.3 on Linux x86_64, downloaded from the Stack website.

I am in an environment where the configured `gcc` doesn't exist, so I'm passing `stack install --with-gcc=/special/gcc`. Unfortunately I get the error:

```
[1 of 2] Compiling Main ( /home/me/.stack/setup-exe-src/setup-mPHDzAJ.hs, /home/me/.stack/setup-exe-src/setup-mPHDZzAJ.o)

: error:
Warning: Couldn't figure out C compiler information!
Make sure you're using GNU gcc, or clang
ghc: could not execute: /garbage/path/where/ghc/thinks/its/settings/are/bin/../lib/../../../../../gcc/stuff/bin/gcc

-- While building simple Setup.hs using:
/system/ghc -rtsopts -threaded -clear-package-db -global-package-db -hide-all-packages -package base -main-is StackSetupShim.mainOverride -package Cabal-2.2.0.1 /home/me/.stack/setup-exe-src/setup-mPHDZzAJ.js /home/me/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs -o /home/me/.stack/setup-exe-cache/x86_64-linux/tmp-Cabal-simple_mPHDZzAJ_2.2.0.1_ghc-8.4.4
Process exited with code: ExitFailure 1
```

My hypothesis is you are forgetting to pass the explicit path to gcc when building Setup.hs?

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.