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

HLS 1.5 does not handle TH correctly #2379

Closed
pepeiborra opened this issue Nov 21, 2021 · 2 comments · Fixed by #2380
Closed

HLS 1.5 does not handle TH correctly #2379

pepeiborra opened this issue Nov 21, 2021 · 2 comments · Fixed by #2380
Labels
component: ghcide type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..

Comments

@pepeiborra
Copy link
Collaborator

This is another regression from #2323 and can generate errors like below in TH codebases:

  tried to look at linkable for GetModIfaceWithoutLinkable for NormalizedFilePath
  "/home/adam/src/ghc/ghc-8.10/hls/th-pq-segfault/pqexample/src/PQ.hs"
  CallStack (from HasCallStack):
  error, called at src/Development/IDE/Core/Rules.hs:888:79 in
  ghcide-1.5.0-inplace:Development.IDE.Core.Rules
pepeiborra added a commit that referenced this issue Nov 21, 2021
We cannot use GetModIfaceWithoutLinkable since the session might be reused later to load a module that needs linkables

Note that this does not have any effects on performance, since GetModIfaceWithoutLinkable is just a synonym for GetModIface that removes the linkable

Fixes #2379
adamse pushed a commit to adamse/hls that referenced this issue Nov 21, 2021
We cannot use GetModIfaceWithoutLinkable since the session might be reused later to load a module that needs linkables

Note that this does not have any effects on performance, since GetModIfaceWithoutLinkable is just a synonym for GetModIface that removes the linkable

Fixes haskell#2379
@jneira jneira added type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. component: ghcide type: template haskell related labels Nov 21, 2021
pepeiborra added a commit that referenced this issue Nov 21, 2021
We cannot use GetModIfaceWithoutLinkable since the session might be reused later to load a module that needs linkables

Note that this does not have any effects on performance, since GetModIfaceWithoutLinkable is just a synonym for GetModIface that removes the linkable

Fixes #2379
@mergify mergify bot closed this as completed in #2380 Nov 22, 2021
mergify bot pushed a commit that referenced this issue Nov 22, 2021
* Fix regression in GhcSessionDeps

We cannot use GetModIfaceWithoutLinkable since the session might be reused later to load a module that needs linkables

Note that this does not have any effects on performance, since GetModIfaceWithoutLinkable is just a synonym for GetModIface that removes the linkable

Fixes #2379

* add test files

* delete unused bits

* Tweak test for compat. with GHC 9.0.1
@runeksvendsen
Copy link
Contributor

Thank you for fixing this issue.

I can't use HLS with https://github.com/haskell-nix/hnix because of this issue, so I'm wondering if you can do a minor version release that includes this fix?

(This is the error I get)

2021-11-25 11:11:09.772295 [ThreadId 4626] INFO hls:	File:     /Users/rune/code/hnix/src/Nix/Builtins.hs
Hidden:   no
Range:    1:1-2:1
Source:   compiler
Severity: DsError
Message:
  tried to look at linkable for GetModIfaceWithoutLinkable for NormalizedFilePath
  "/Users/rune/code/hnix/src/Nix/Expr/Shorthands.hs"
  CallStack (from HasCallStack):
  error, called at src/Development/IDE/Core/Rules.hs:888:79 in
  ghcide-1.5.0-inplace:Development.IDE.Core.Rules

@jneira
Copy link
Member

jneira commented Nov 25, 2021

@runeksvendsen yeah, we are working in such minor release: #2393

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: ghcide type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants