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

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

Closed
1Computer1 opened this issue Jun 6, 2020 · 5 comments
Closed

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

1Computer1 opened this issue Jun 6, 2020 · 5 comments
Labels
build tool: stack can-workaround component: hie-bios type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..

Comments

@1Computer1
Copy link

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).

@jneira
Copy link
Member

jneira commented Jun 12, 2020

Did you build stack with tests enabled (with stack build --test --no-run-tests) at any moment?
I am afraid stack does not build tests by default and the ide (through hie-bios) cant find the required files to load test modules. The root cause is in stack: commercialhaskell/stack#5213

@1Computer1 please, try to build tests with the cited command above and reload the ide to check it.

@jneira jneira added status: needs info Not actionable, because there's missing information type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. labels Jun 12, 2020
@1Computer1
Copy link
Author

I can confirm that building the tests and then a reload fixes the problem.

@jneira jneira changed the title HLS fails to load new module from a different target (Stack) stack: hls fails to load modules from test component Jun 12, 2020
@jneira jneira added can-workaround component: hie-bios and removed status: needs info Not actionable, because there's missing information labels Jun 12, 2020
@jneira
Copy link
Member

jneira commented Jun 12, 2020

Thanks for report and try the workaround, we'll keep this one to track this problem. It is a frequent issue, reported in #121 for example.

@jneira
Copy link
Member

jneira commented Nov 9, 2020

As commercialhaskell/stack#5213 was fixed, using a newer stack version should not reproduce the issue, @1Computer1 could you confirm it, pleas?

@jneira jneira added the status: needs info Not actionable, because there's missing information label Nov 9, 2020
@jneira
Copy link
Member

jneira commented Nov 17, 2020

I am gonna optimistically close the issue, @1Computer1 feel free to reopen if you continue hitting the error

@jneira jneira closed this as completed Nov 17, 2020
@jneira jneira removed the status: needs info Not actionable, because there's missing information label Nov 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build tool: stack can-workaround component: hie-bios type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..
Projects
None yet
Development

No branches or pull requests

2 participants