Repository navigation
Closed
Labels
component: ghcidetype: bugSomething isn't right: doesn't work as intended, documentation is missing/outdated, etc..
Description
Current master (2310e10) of HLS fails to load threadscope like this:
ghcide version: 0.1.0.0 (GHC: 8.8.3) (PATH: /Users/maoe/.local/bin/haskell-language-server-wrapper)
ghcide version: 0.1.0.0 (GHC: 8.8.3) (PATH: /Users/maoe/.local/bin/haskell-language-server-8.8.3)
(haskell-language-server)Ghcide setup tester in /Users/maoe/src/github.com/haskell/ThreadScope.
Report bugs at https://github.com/haskell/haskell-language-server/issues
Step 1/6: Finding files to test in /Users/maoe/src/github.com/haskell/ThreadScope
Found 1 files
Step 2/6: Looking for hie.yaml files that control setup
Found 1 cradle
Step 3/6: Initializing the IDE
Step 4/6: Type checking the files
Consulting the cradle for "/Users/maoe/src/github.com/haskell/ThreadScope/GUI/MainWindow.hs"
> Resolving dependencies...
> Build profile: -w ghc-8.8.3 -O1
> In order, the following will be built (use -v for more details):
> - threadscope-0.2.13 (first run)
> Configuring threadscope-0.2.13...
> Preprocessing executable 'threadscope' for threadscope-0.2.13..
Right (ComponentOptions {componentOptions = ["-fbuilding-cabal-package","-O0","-outputdir","/Users/maoe/src/github.com/haskell/ThreadScope/dist-newstyle/build/x86_64-osx/ghc-8.8.3/threadscope-0.2.13/build/thr
eadscope/threadscope-tmp","-odir","/Users/maoe/src/github.com/haskell/ThreadScope/dist-newstyle/build/x86_64-osx/ghc-8.8.3/threadscope-0.2.13/build/threadscope/threadscope-tmp","-hidir","/Users/maoe/src/githu
b.com/haskell/ThreadScope/dist-newstyle/build/x86_64-osx/ghc-8.8.3/threadscope-0.2.13/build/threadscope/threadscope-tmp","-stubdir","/Users/maoe/src/github.com/haskell/ThreadScope/dist-newstyle/build/x86_64-o
sx/ghc-8.8.3/threadscope-0.2.13/build/threadscope/threadscope-tmp","-i","-i/Users/maoe/src/github.com/haskell/ThreadScope/dist-newstyle/build/x86_64-osx/ghc-8.8.3/threadscope-0.2.13/build/threadscope/threadsc
ope-tmp","-i.","-i/Users/maoe/src/github.com/haskell/ThreadScope/dist-newstyle/build/x86_64-osx/ghc-8.8.3/threadscope-0.2.13/build/threadscope/autogen","-i/Users/maoe/src/github.com/haskell/ThreadScope/dist-n
ewstyle/build/x86_64-osx/ghc-8.8.3/threadscope-0.2.13/build/global-autogen","-I/Users/maoe/src/github.com/haskell/ThreadScope/dist-newstyle/build/x86_64-osx/ghc-8.8.3/threadscope-0.2.13/build/threadscope/auto
gen","-I/Users/maoe/src/github.com/haskell/ThreadScope/dist-newstyle/build/x86_64-osx/ghc-8.8.3/threadscope-0.2.13/build/global-autogen","-I/Users/maoe/src/github.com/haskell/ThreadScope/dist-newstyle/build/x
86_64-osx/ghc-8.8.3/threadscope-0.2.13/build/threadscope/threadscope-tmp","-Iinclude","-I/Users/maoe/src/github.com/haskell/ThreadScope/dist-newstyle/build/x86_64-osx/ghc-8.8.3/threadscope-0.2.13/build/includ
e","-optP-include","-optP/Users/maoe/src/github.com/haskell/ThreadScope/dist-newstyle/build/x86_64-osx/ghc-8.8.3/threadscope-0.2.13/build/threadscope/autogen/cabal_macros.h","-hide-all-packages","-Wmissing-ho
me-modules","-no-user-package-db","-package-db","/Users/maoe/.cabal/store/ghc-8.8.3/package.db","-package-db","/Users/maoe/src/github.com/haskell/ThreadScope/dist-newstyle/packagedb/ghc-8.8.3","-package-db","
/Users/maoe/src/github.com/haskell/ThreadScope/dist-newstyle/build/x86_64-osx/ghc-8.8.3/threadscope-0.2.13/package.conf.inplace","-package-id","array-0.5.4.0","-package-id","base-4.13.0.0","-package-id","bina
ry-0.8.7.0","-package-id","bytestring-0.10.10.0","-package-id","cr-0.13.8.0-d632bd6d","-package-id","containers-0.6.2.1","-package-id","deepseq-1.4.4.0","-package-id","fl-mbd-0.0.12.0-05bcb782","-package-id",
"filepath-1.4.2.1","-package-id","ghc-vnts-0.13.0-50e09703","-package-id","glb-0.13.8.0-7685cbfa","-package-id","gtk-0.15.4-094c3f5d","-package-id","mtl-2.2.2","-package-id","png-0.13.8.0-266afd56","-package-
id","template-haskell-2.15.0.0","-package-id","tmprry-1.3-bd69c6d2","-package-id","text-1.2.4.0","-package-id","time-1.9.3","-package-id","unix-2.7.2.2","-XHaskell98","-XRecordWildCards","-XNamedFieldPuns","-
XBangPatterns","-XPatternGuards","./Main.hs","Events.HECs","Events.EventDuration","Events.EventTree","Events.ReadEvents","Events.SparkStats","Events.SparkTree","Events.TestEvents","GUI.App","GUI.Main","GUI.Ma
inWindow","GUI.EventsView","GUI.DataFiles","GUI.Dialogs","GUI.SaveAs","GUI.Timeline","GUI.Histogram","GUI.TraceView","GUI.BookmarkView","GUI.KeyView","GUI.StartupInfoView","GUI.SummaryView","GUI.Types","GUI.C
oncurrencyControl","GUI.ProgressView","GUI.ViewerColours","GUI.Timeline.Activity","GUI.Timeline.CairoDrawing","GUI.Timeline.HEC","GUI.Timeline.Motion","GUI.Timeline.Render","GUI.Timeline.Sparks","GUI.Timeline
.Ticks","GUI.Timeline.Types","GUI.Timeline.Render.Constants","GUI.GtkExtras","Graphics.UI.Gtk.ModelView.TreeView.Compat","Paths_threadscope","-Wall","-fwarn-tabs","-rtsopts","-fno-warn-type-defaults","-fno-wa
rn-name-shadowing","-fno-warn-unused-do-bind","-hide-all-packages","-j"], componentRoot = "/Users/maoe/src/github.com/haskell/ThreadScope", componentDependencies = ["threadscope.cabal","cabal.project","cabal.
project.local"]})
"Making new HscEnv[main]"
(([],Just HscEnvEq 3),fromList [("cabal.project",Just 2020-05-25 15:56:56.78656145 UTC),("cabal.project.local",Just 2020-06-06 00:35:10.524803549 UTC),("threadscope.cabal",Just 2020-06-04 14:43:44.096629579 U
TC)])
[INFO] finish: TypecheckTest (took 4.67s)
File: /Users/maoe/src/github.com/haskell/ThreadScope/GUI/MainWindow.hs
Hidden: no
Range: 144:10-144:19
Source: typecheck
Severity: DsError
Message:
/Users/maoe/src/github.com/haskell/ThreadScope/GUI/MainWindow.hs:144:11: error:
• Can't find interface-file declaration for variable GUI.DataFiles.renderLogo
Probable cause: bug in .hi-boot file, or inconsistent .hi file
File: /Users/maoe/src/github.com/haskell/ThreadScope/GUI/MainWindow.hs
Hidden: no
Range: 144:10-144:19
Source: typecheck
Severity: DsError
Message:
/Users/maoe/src/github.com/haskell/ThreadScope/GUI/MainWindow.hs:144:11: error: [33/1583]
• Can't find interface-file declaration for variable GUI.DataFiles.renderLogo
Probable cause: bug in .hi-boot file, or inconsistent .hi file
Use -ddump-if-trace to get an idea of which file caused the error
• In a stmt of a 'do' block:
logo <- (GUI.DataFiles.renderLogo
(GHC.IO.Unsafe.unsafePerformIO
((Data.ByteString.Unsafe.unsafePackAddressLen 5358)
... very long blob dump here ...
In the expression:
do let getWidget cast name = builderGetObject builder cast name
mainWindow <- getWidget castToWindow "main_window"
statusBar <- getWidget castToStatusbar "statusbar"
sidebarBox <- getWidget castToWidget "sidebar"
....
In an equation for ‘mainWindowNew’:
mainWindowNew builder actions
= do let getWidget cast name = ...
mainWindow <- getWidget castToWindow "main_window"
statusBar <- getWidget castToStatusbar "statusbar"
Steps to reproduce:
git clone [email protected]:haskell/ThreadScope.git
cd ThreadScope
gen-hie > hie.yaml
cp cabal.project.osx cabal.project # if you're on macOS
haskell-language-server-wrapper GUI/MainWindow.hsFWIW current master of ghcide fails silently on the same module:
% ghcide GUI/MainWindow.hs
ghcide version: 0.2.0 (GHC: 8.8.3) (PATH: /Users/maoe/.local/bin/ghcide)
Ghcide setup tester in /Users/maoe/src/github.com/haskell/ThreadScope.
Report bugs at https://github.com/digital-asset/ghcide/issues
Step 1/4: Finding files to test in /Users/maoe/src/github.com/haskell/ThreadScope
Found 1 files
Step 2/4: Looking for hie.yaml files that control setup
Found 1 cradle
Step 3/4: Initializing the IDE
Step 4/4: Type checking the files
[INFO] Consulting the cradle for "/Users/maoe/src/github.com/haskell/ThreadScope/GUI/MainWindow.hs"
> Resolving dependencies...
> Build profile: -w ghc-8.8.3 -O1
> In order, the following will be built (use -v for more details):
> - threadscope-0.2.13 (configuration changed)
> Configuring threadscope-0.2.13...
> Preprocessing executable 'threadscope' for threadscope-0.2.13..
[INFO] Using interface files cache dir: /Users/maoe/.cache/ghcide/main-b3d011f566f19fbfdd392a1581bf784ebd22508d
[INFO] Making new HscEnv[main]
Files that failed:
* /Users/maoe/src/github.com/haskell/ThreadScope/GUI/MainWindow.hs
Completed (0 files worked, 1 file failed)Reacted by Marc Scholten and Vaclav Svejcar
Metadata
Metadata
Assignees
Labels
component: ghcidetype: bugSomething isn't right: doesn't work as intended, documentation is missing/outdated, etc..
Activity
jneira commentedon Jun 12, 2020
Hi, it is a shoot in the dark but maybe cleaning the cache of ghcide and hie-bios. where they save hie files, could help: they are in
$XDG_CACHE_DIRECTORY, by default~/.cachein linux andC:/Users/<user>/AppData/Localin windowsmaoe commentedon Jun 12, 2020
Thanks. I’ll ll try that later. I’m having the same issue in our private in-house repository too so there may be a real issue. I’ll try to make a smaller reproducer.
maoe commentedon Jun 12, 2020
I made a tiny reproducer: https://github.com/maoe/hls-reproducer. This project builds fine with cabal but if you run
haskell-language-server MyLib.hs:maoe commentedon Jun 12, 2020
And if you replace
myIdwithidin the definition oftemplate, hls works fine.jneira commentedon Jun 12, 2020
Thanks for the small reproducer, i hope it will help to identify the cause
maoe commentedon Jun 12, 2020
Currently available workaround for this issue is to define myId in a separate module. See maoe/hls-reproducer@c4add31
maoe commentedon Jun 12, 2020
And current master (4e7b2fc) of ghcide again silently fails:
pepeiborra commentedon Jun 13, 2020
Loading the hls-reproducer example in VSCode with ghcide HEAD works fine for me. The command line is a diagnostic tool, but not always equivalent to loading in an IDE.
Trying to build threadscope with Nix gets stuck in:
jneira commentedon Jul 6, 2020
@maoe can you load the module
MyLibin your editor (with hover and other lsp features), like @pepeiborra? please, use the just released version or mastermaoe commentedon Jul 6, 2020
@jneira I just tried haskell-language-server 0.2 (7ad18cf) and a fairly recent ghcide (035019d) with VSCode 1.46.1 on macOS. I used GHC 8.10.1 except for HIE.
"languageServerHaskell.hieVariant": "haskell-language-server"
This reproduces the error.
"languageServerHaskell.hieVariant": "ghcide"
This also reproduces the error.
The ghcide extension instead of the Haskell Language Server extension
I couldn't get the ghcide extension working. It prints a lot of errors as follows:
"languageServerHaskell.hieVariant": "haskell-language-server"
It works as expected. Because HIE doesn't support 8.10 I used 8.8.3 for this demonstration.
maoe commentedon Jul 6, 2020
The obvious question would be if hls works with GHC 8.8.3. The answer is no. It fails in the same way as GHC 8.10.1.
maoe commentedon Aug 22, 2020
I confirmed that ghcide from wz1000/ghcide on the hls-3 branch fixes this issue. For those who are eager to try, add the following snippet to cabal.project when building hls:
maoe commentedon Aug 22, 2020
I still see this issue in our in-house codebase even with the patched ghcide. I'll try to make a reproducer.
jbransen commentedon Oct 15, 2020
I can reproduce this issue with https://github.com/jbransen/hls-bug using
haskell-language-server-8.8.4(75c4ebc).stack buildsucceeds,haskell-language-server-8.8 A.hsfails with:maoe commentedon Oct 15, 2020
FWIW I tried some intermediate commit of haskell/ghcide#836 with hls and it fixed the issue in our codebase. I had to disable a few plugins to build hls though. So I think #463 is going to fix this issue.
jbransen commentedon Nov 4, 2020
I can confirm that #530 seems to have solved this! Latest master now works fine for my bigger projects.
jneira commentedon Nov 4, 2020
@jbransen great! thanks for confirming it
Bump GHC 8.8 stacksnapshot (#149)