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

Say what GHC version is being using for the build? #6342

Closed
philderbeast opened this issue Nov 22, 2023 · 4 comments
Closed

Say what GHC version is being using for the build? #6342

philderbeast opened this issue Nov 22, 2023 · 4 comments

Comments

@philderbeast
Copy link
Contributor

I'm comparing stack and cabal output building the same hlint-plugin project and noticed cabal is very clear about which GHC version it is using with its Build profile: -w ghc-9.0.2 -O1 but I have to visually scan path elements of the install path to see this for stack.

$ stack --version
Version 2.13.1, Git revision 8102bb8afce90fc954f48efae38b87f37cabc988 x86_64 hpack-0.36.0

$ cabal --version
cabal-install version 3.11.0.0
compiled using version 3.11.0.0 of the Cabal library

$ stack build --test --no-run-tests

Warning: WARNING: This stack project is generated.
hlint-plugin> configure (lib)
Configuring hlint-plugin-1.0.2...
hlint-plugin> build (lib)
Preprocessing library for hlint-plugin-1.0.2..
Building library for hlint-plugin-1.0.2..
[1 of 2] Compiling HLint.Plugin.Settings
[2 of 2] Compiling HLint.Plugin
hlint-plugin> copy/register
Installing library in /.../hlint-plugin/.stack-work/install/x86_64-linux
   /77e1e65734194babbef5a670a7fffc8ad1833c81e4c13562134c9a797b54872d
   /9.0.2/lib/x86_64-linux-ghc-9.0.2/hlint-plugin-1.0.2-JOPnvvxdmWa2Izg7q332qw
Registering library for hlint-plugin-1.0.2..

$ cabal build all --enable-tests
Resolving dependencies...
Build profile: -w ghc-9.0.2 -O1
In order, the following will be built (use -v for more details):
 - hlint-plugin-1.0.2 (lib) (first run)
Configuring library for hlint-plugin-1.0.2...
Preprocessing library for hlint-plugin-1.0.2...
Building library for hlint-plugin-1.0.2...
[1 of 2] Compiling HLint.Plugin.Settings
[2 of 2] Compiling HLint.Plugin

Could we please have stack say what GHC version is being using for the build?

@mpilgrem
Copy link
Member

This info is already provided as a debug level message, so a solution may be to elevate that same report to an info level message.

@philderbeast
Copy link
Contributor Author

If I run with --verbose or --verbosity=debug then I don't easily see the compiler version in the output but it is there in paths. I don't see one single message we could elevate to the info level that would be suitable.

$ ~/.local/bin/stack build --test --no-run-tests --verbose
...
$ ~/.local/bin/stack build --test --no-run-tests --verbosity=debug

If I run with --cabal-verbose then I do see the compiler version but mixed in with a lot of other output detail.

$ ~/.local/bin/stack build --test --no-run-tests --cabal-verbose
hlint-plugin> configure (lib)
...
Dependency ghc ==9.0.2: using ghc-9.0.2
...
Configured component graph:
    component hlint-plugin-1.0.2-JOPnvvxdmWa2Izg7q332qw
...
        include ghc-9.0.2
...
Linked component graph:
    unit hlint-plugin-1.0.2-JOPnvvxdmWa2Izg7q332qw
...
        include ghc-9.0.2
...
Ready component graph:
    definite hlint-plugin-1.0.2-JOPnvvxdmWa2Izg7q332qw
...
        depends ghc-9.0.2
...
Using Cabal-3.4.1.0 compiled by ghc-9.0
Using compiler: ghc-9.0.2
...
Using ghc version 9.0.2 given by user at:
~/.ghcup/ghc/9.0.2/bin/ghc-9.0.2
Using ghc-pkg version 9.0.2 given by user at:
~/.ghcup/ghc/9.0.2/bin/ghc-pkg-9.0.2
...
Using haddock version 2.25.1 found on system at:
~/.ghcup/ghc/9.0.2/bin/haddock-ghc-9.0.2
...
Using runghc version 9.0.2 found on system at:
~/.ghcup/ghc/9.0.2/bin/runghc-9.0.2
...

@mpilgrem
Copy link
Member

@philderbeast, sorry to send you on a wild goose chase - I was misremembering - and I've also realised that you only want Stack to report the GHC version used for stack build and not other commands that use a Stack environment.

@mpilgrem
Copy link
Member

#6344 now merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants