Skip to content

Can't find interface-file declaration when loading a TemplateHaskell-enabled module #149

Closed
@maoe

Description

@maoe

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 git@github.com: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.hs

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

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