Skip to content

stack: hls fails to load modules from test component #151

@1Computer1

Description

@1Computer1

To reproduce:

  • $ stack new bug
  • Create .hie.yaml with the three targets:
cradle:
    stack:
        - path: "./src"
          component: "bug:lib"
        - path: "./app"
          component: "bug:exe:bug-exe"
        - path: "./test"
          component: "bug:test:bug-test"
  • Create a bunch of new modules in the library.
  • Import them in the tests. It should work at the moment.
  • Reload/restart HLS? I'm not sure about this step, something goes wrong here.
  • The test module should now fail to find one of the library modules, and adding new ones won't work either. It doesn't seem to work after another reload too.

The logs seem to tell me that it is using the wrong .cabal file:

"Making new HscEnv[main]"
(([],Just HscEnvEq 4),fromList [("bug.cabal",Just 2020-06-06 22:16:45.8126357 UTC),("package.yaml",Just 2020-06-06 22:04:03.9856616 UTC),("stack.yaml",Just 2020-06-06 22:04:04.6931537 UTC)])
2020-06-06 18:18:41.2528917 [ThreadId 125] - finish: FileStoreTC (took 6.83s)
2020-06-06 18:18:41.3349849 [ThreadId 344] - finish: InitialLoad (took 0.07s)

The file is from 2020-06-06 22:16:45.8126357 UTC but the current time is 18:18:41.2528917.

I'm on Stack LTS 15.15, commit 2310e10 of HLS, Ubuntu 20.04 (WSL 1).

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