Skip to content

Incorrect flags when loading multiple executable components on GHC 9.4 #3513

Closed
@Vic-M

Description

@Vic-M

Hello, I'm not sure if this is a configuration issue with my hie.yaml, but I'm unable to get HLS to work with two Main.hs files at the same time. There's no issues with compiling both of them with cabal though.

Your environment

Which OS do you use?
Windows WSL2 running CentOS Stream 9

Which version of GHC do you use and how did you install it?
GHC 9.4.4 from ghcup

How is your project built (alternative: link to the project)?
https://gitlab.com/vmatassa/hls-two-main-example

Which LSP client (editor/plugin) do you use?
vscode

Which version of HLS do you use and how did you install it?
HLS 1.9.1.0 from ghcup

Steps to reproduce

  1. Open projectA/app/Main.hs
  2. Open projectB/app/Main.hs right after

Actual behaviour

HLS is unable to recognize libraries that are exclusively in projectB cabal's file.

Could not load module ‘Data.Aeson’
It is a member of the hidden package ‘aeson-2.1.2.1’.
Perhaps you need to add ‘aeson’ to the build-depends in your .cabal file.
It is a member of the hidden package ‘aeson-2.1.1.0’.
Perhaps you need to add ‘aeson’ to the build-depends in your .cabal file.
It is a member of the hidden package ‘aeson-2.1.1.0’.
Perhaps you need to add ‘aeson’ to the build-depends in your .cabal file.

image

Expected behaviour

HLS should be able to find installed libraries from all cabal files in the project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: ghcidetype: bugSomething isn't right: doesn't work as intended, documentation is missing/outdated, etc..

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions