Skip to content

c2hs + template-haskell: During interactive linking, GHCi couldn't find the following symbol #3742

@Abastro

Description

@Abastro

Your environment

Which OS do you use?
Linux (Ubuntu)

Which version of GHC do you use and how did you install it?
GHC 9.4.5 from ghcup

How is your project built (alternative: link to the project)?
A cabal project which build-tool-depends on c2hs

Which LSP client (editor/plugin) do you use?
VS Code+vscode-haskell

Which version of HLS do you use and how did you install it?
HLS 2.0.0.1 from ghcup

Have you configured HLS in any way (especially: a hie.yaml file)?
No, I am using implicit-hie.

Steps to reproduce

I am yet to test this with a small project, but it seems like HLS, when subject to the application, cannot recognize the symbols from c2hs file.
For reference, cabal repl works perfectly fine.

Expected behaviour

HLS works normally on a file with template-haskell splices, which depends on a c2hs file.

Actual behaviour

haskell-language-server-9.4.5: ^^ Could not load 'zdwaylandzmhszm0zi1zi0zi0zminplacezdGraphicsziWaylandziUtilzdwaylandzzmhszzm0zzi1zzi0zzi0zzminplacezuGraphicszziWaylandzziUtilzumakeDispatcher', dependency unresolved.

Graphics.Wayland.Util is a .chs file pre-processed by c2hs.

Debug information

2023-08-04T07:45:41.861221Z | Info | updateFileDiagnostics published different from new diagnostics - file diagnostics: File:     /home/abastro/Documents/Projects/wayland-projects/wayland-hs/src/Graphics/Wayland/Test.hs
Hidden:   no
Range:    1:1-2:1
Source:   typecheck
Severity: DsError
Message: 
  �[0;91mProgram error:
  GHC.ByteCode.Linker: can't find label
  During interactive linking, GHCi couldn't find the following symbol:
  zdwaylandzmhszm0zi1zi0zi0zminplacezdGraphicsziWaylandziUtilzdwaylandzzmhszzm0zzi1zzi0zzi0zzminplacezuGraphicszziWaylandzziUtilzumakeDispatcher
  This may be due to you not asking GHCi to load extra object files,
  archives or DLLs needed by your current session. Restart GHCi, specifying
  the missing library using the -L/path/to/object/dir and -lmissinglibname
  flags, or simply by naming the relevant files on the GHCi command line.
  Alternatively, this link failure might indicate a bug in GHCi.
  If you suspect the latter, please report this as a GHC bug:
  https://www.haskell.org/ghc/reportabug�[0m

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: needs infoNot actionable, because there's missing informationtype: 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