Skip to content
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

stack setup does not use gcc specified with "with-gcc" #5493

Closed
BebeSparkelSparkel opened this issue Feb 24, 2021 · 0 comments
Closed

stack setup does not use gcc specified with "with-gcc" #5493

BebeSparkelSparkel opened this issue Feb 24, 2021 · 0 comments

Comments

@BebeSparkelSparkel
Copy link

General summary/comments (optional)

expect to be able to specify the gcc path to be used with with-gcc in config.yaml and have stack setup --verbose use that version when adding a binary-dis of ghc.

Steps to reproduce

  1. Ensure that there is a gcc version less than 4.4 in PATH. `
$ gcc --version
gcc (GCC) 4.2.1 20070719
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  1. Have a binary distribution on file and list it in config.yaml
# example config.yaml entry
setup-info:
  ghc:
    openbsd64-maj6-min7:
      8.8.1:
        url: '/home/user/ghc/ghc-8.8.1-x86_64-unknown-openbsd.tar.xz'
  1. Add the with-gcc to config.yaml. Example with-gcc: '/usr/local/bin/egcc'
  2. Create a new project stack new different-gcc-; cd different-gcc
  3. Add compiler: ghc-8.8.1 to the project's stack.yaml
  4. run stack setup --version

~/.stack/config.yaml

setup-info:
  ghc:
    openbsd64-maj6-min7:
      8.8.1:
        url: '/home/wjr/repos/ghc/ghc-8.8.1-x86_64-unknown-openbsd.tar.xz'
with-gcc: '/usr/local/bin/egcc'

different-gcc-version/stack.yaml

resolver: lts-14.27
compiler: ghc-8.8.1
packages:
- .

Expected

I expected stack to use the gcc specified with with-gcc when importing a new ghc distribution.

Actual

Stack continues to use the gcc that it finds in PATH

$ stack setup --verbose
...
2021-02-24 10:07:26.701864: [error] configure: error: Need at least gcc version 4.4 (4.7+ recommended)
2021-02-24 10:07:26.770883: [debug] checking version of gcc...
2021-02-24 10:07:26.773779: [error] Received ExitFailure 1 when running
Raw command: /home/wjr/.stack/programs/x86_64-openbsd/ghc-maj6-min7-8.8.1.temp/ghc-8.8.1/configure --prefix=/home/wjr/.stack/programs/x86_64-openbsd/ghc-maj6-min7-8.8.1/
Run from: /home/wjr/.stack/programs/x86_64-openbsd/ghc-maj6-min7-8.8.1.temp/ghc-8.8.1/

2021-02-24 10:07:26.773999: [error] 
Error: Error encountered while configuring GHC with
         /home/wjr/.stack/programs/x86_64-openbsd/ghc-maj6-min7-8.8.1.temp/ghc-8.8.1/configure --prefix=/home/wjr/.stack/programs/x86_64-openbsd/ghc-maj6-min7-8.8.1/
         run in /home/wjr/.stack/programs/x86_64-openbsd/ghc-maj6-min7-8.8.1.temp/ghc-8.8.1/
     
       The following directories may now contain files, but won't be used by stack:
         - /home/wjr/.stack/programs/x86_64-openbsd/ghc-maj6-min7-8.8.1.temp/
         - /home/wjr/.stack/programs/x86_64-openbsd/ghc-maj6-min7-8.8.1/
     
       For more information consider rerunning with --verbose flag
     
Configuring GHC ... 

Stack version

$ stack --version
Version 2.6.0, Git revision 30224e347624f34c9ebbbb444c07339cd123eb4d (8277 commits) PRE-RELEASE x86_64 hpack-0.33.0

Method of installation

stack install compile source

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

2 participants