Skip to content

cabal wrapper uses always global ghc in PATH  #194

@jneira

Description

@jneira
PS D:\dev\ws\haskell\ghcide> ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.8.3
PS D:\dev\ws\haskell\ghcide> ghcide --version
ghcide version: 0.2.0 (GHC: 8.6.5) (PATH: D:\bin\ghcide.exe)
PS D:\dev\ws\haskell\ghcide> cat .\cabal.project
packages: .

with-compiler: ghc-8.6.5
PS D:\dev\ws\haskell\ghcide> cabal clean
PS D:\dev\ws\haskell\ghcide> ghcide
ghcide version: 0.2.0 (GHC: 8.6.5) (PATH: D:\bin\ghcide.exe)
Ghcide setup tester in D:\dev\ws\haskell\ghcide.
Report bugs at https://github.com/digital-asset/ghcide/issues

Step 1/4: Finding files to test in D:\dev\ws\haskell\ghcide
Found 63 files

Step 2/4: Looking for hie.yaml files that control setup
Found 3 cradles

Step 3/4: Initializing the IDE

Step 4/4: Type checking the files
[INFO] Consulting the cradle for "D:\\dev\\ws\\haskell\\ghcide\\src\\Development\\IDE\\GHC\\WithDynFlags.hs"
> Resolving dependencies...
> Build profile: -w ghc-8.8.3 -O1
> In order, the following will be built (use -v for more details):
>  - ghcide-0.2.0 (lib) (first run)
> Configuring library for ghcide-0.2.0..
> Preprocessing library for ghcide-0.2.0..
File:     D:\dev\ws\haskell\ghcide\src\Development\IDE\GHC\WithDynFlags.hs
Hidden:   no
Range:    1:0-100001:0
Source:   compiler
Severity: DsError
Message:
  <command line>: cannot satisfy -package-id aeson-1.5.1.0-1e42a0cdbd4b065e4d6f1c804d63f35706230918:
  aeson-1.5.1.0-1e42a0cdbd4b065e4d6f1c804d63f35706230918 is unusable due to missing dependencies:
  attoparsec-0.13.2.4-04e8dfec95c5fe0d96babd7d76d0463f6955b1db base-4.13.0.0
  base-compat-b_-0.11.1-1ae618f5c56712e963c7c424698817f24ad5c97a bytestring-0.10.10.0
PS D:\dev\ws\haskell\ghcide> ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.8.3
PS D:\dev\ws\haskell\ghcide> cat .\cabal.project
packages: .

with-compiler: ghc-8.6.5
PS D:\dev\ws\haskell\ghcide> cabal exec ghc -- --version
Resolving dependencies...
The Glorious Glasgow Haskell Compilation System, version 8.6.5
PS D:\dev\ws\haskell\ghcide> cabal exec ghc --with-compiler=ghc-8.8.3 -- --version
Resolving dependencies...
The Glorious Glasgow Haskell Compilation System, version 8.8.3
PS D:\dev\ws\haskell\ghcide>
  • so it is ignoring the original ghc used in by hie-bios (ghcPath here )

Possible solutions:

  • Use an intermmediate env var (HIE_BIOS_WRAPPER_GHC?) to inform the wrapper about the real ghc
  • Pass a new argument to the wrapper --hie-bios-ghc and use it, removing it before calling the real ghc

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions