Skip to content

with-gcc option is not respected #3902

Closed
@wdanilo

Description

@wdanilo

Problem description

I'm building a project with some C code and I want to use a specific GCC version. So I'm invoking stack like stack --with-gcc /usr/bin/gcc-6.4.0 .... It seems that stack just does not respect this setting somehow, because it fails with error:

Building library for <libname>...
gcc: error: unrecognized command line option ‘--std=c++17’

What is more interesting:

  1. If I change the GCC path to non-existing one, the build fails earlier with info " Cannot find the program 'gcc'" - which is good, it shows that this option actually makes some effect.
  2. If I change my package.yaml cc-options from --std=c++17 to --version (a little dirty hack), then I can see in my terminal printed gcc (Gentoo 4.9.3 p1.5, pie-0.6.4) 4.9.3 which is my system-wide GCC - so clearly stack uses wrong GCC here.
  3. If I create a local folder (lets call it localbin) and I create symlink gcc -> /usr/bin/gcc-6.4.0 and export it to be on the beginning of $PATH and then invoke stack, everything works.

Stack version

1.6.5

Method of installation

  • Official binary, downloaded from stackage.org or fpcomplete's package repository

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions