I'm trying to get HLS (Haskell Language Server) working in VSCode using WSL2 so I can get type hints. I've already ran through the week01 instructions so I have a working nix installation. However, when I run code
within nix-shell
to start the VSCode workspace, EnglishAuction.hs
code fails in compilation. I tried removing the module section, suggested in this answer but the same error appears.
Here's the error message:
loadObj "/nix/store/jmhwwzn1yfjzlxavz16afkf1r4shmp8z-persistent-sqlite-lib-persistent-sqlite-2.13.0.3/lib/x86_64-linux-ghc-8.10.4.20210212/persistent-sqlite-2.13.0.3-8rnIaulr0SMFWDeiU7TZN4/HSpersistent-sqlite-2.13.0.3-8rnIaulr0SMFWDeiU7TZN4.o": failedcompiler
Edit:
Here's the entire output when I run haskell-language-server
in the week01 directory:
haskell-language-server version: 1.3.0.0 (GHC: 8.10.4.20210212) (PATH: /nix/store/1f5m9aq39by56hbky1pz7dd52f4ikam8-haskell-language-server-exe-haskell-language-server-1.3.0.0/bin/haskell-language-server)
ghcide setup tester in /home/pioneer/plutus/plutus-pioneer-program/code/week01.
Report bugs at https://github.com/haskell/haskell-language-server/issues
Step 1/4: Finding files to test in /home/pioneer/plutus/plutus-pioneer-program/code/week01
Found 1 files
Step 2/4: Looking for hie.yaml files that control setup
Found 1 cradle
(/home/pioneer/plutus/plutus-pioneer-program/code/week01/hie.yaml)
Step 3/4: Initializing the IDE
Step 4/4: Type checking the files
2022-01-17 22:25:09.635127929 [ThreadId 68] INFO hls: Consulting the cradle for "src/Week01/EnglishAuction.hs"
Output from setting up the cradle Cradle {cradleRootDir = "/home/pioneer/plutus/plutus-pioneer-program/code/week01", cradleOptsProg = CradleAction: Cabal}
> Build profile: -w ghc-8.10.4.20210212 -O1
> In order, the following will be built (use -v for more details):
> - plutus-pioneer-program-week01-0.1.0.0 (lib) (first run)
> Preprocessing library for plutus-pioneer-program-week01-0.1.0.0..
2022-01-17 22:25:10.848135893 [ThreadId 68] INFO hls: Using interface files cache dir: /home/pioneer/.cache/ghcide/plutus-pioneer-program-week01-0.1.0.0-inplace-2ae4e5079a2a61a27b33a1e5e2d7b5d8b0af7455
2022-01-17 22:25:10.848331503 [ThreadId 68] INFO hls: Making new HscEnv[plutus-pioneer-program-week01-0.1.0.0-inplace]
GHC runtime linker: fatal error: I found a duplicate definition for symbol
sqlite3_fts3_may_be_corrupt
whilst processing object file
/nix/store/jmhwwzn1yfjzlxavz16afkf1r4shmp8z-persistent-sqlite-lib-persistent-sqlite-2.13.0.3/lib/x86_64-linux-ghc-8.10.4.20210212/persistent-sqlite-2.13.0.3-8rnIaulr0SMFWDeiU7TZN4/HSpersistent-sqlite-2.13.0.3-8rnIaulr0SMFWDeiU7TZN4.o
The symbol was previously defined in
/nix/store/si95pc9hb5hr1yiyj7b2s75hl4bkn9g2-direct-sqlite-lib-direct-sqlite-2.3.26/lib/x86_64-linux-ghc-8.10.4.20210212/direct-sqlite-2.3.26-Gg0YVBPVrMk3LDxZxB2Bzf/HSdirect-sqlite-2.3.26-Gg0YVBPVrMk3LDxZxB2Bzf.o
This could be caused by:
* Loading two different object files which export the same symbol
* Specifying the same object file twice on the GHCi command line
* An incorrect `package.conf' entry, causing some object to be
loaded twice.
2022-01-17 22:25:13.842245999 [ThreadId 205] INFO hls: File: /home/pioneer/plutus/plutus-pioneer-program/code/week01/src/Week01/EnglishAuction.hs
Hidden: no
Range: 1:1-2:1
Source: compiler
Severity: DsError
Message:
loadObj
"/nix/store/jmhwwzn1yfjzlxavz16afkf1r4shmp8z-persistent-sqlite-lib-persistent-sqlite-2.13.0.3/lib/x86_64-linux-ghc-8.10.4.20210212/persistent-sqlite-2.13.0.3-8rnIaulr0SMFWDeiU7TZN4/HSpersistent-sqlite-2.13.0.3-8rnIaulr0SMFWDeiU7TZN4.o":
failed
2022-01-17 22:25:13.842471029 [ThreadId 222] INFO hls: finish: User TypeCheck (took 2.97s)
2022-01-17 22:25:13.842626898 [ThreadId 226] INFO hls: finish: GetHie (took 0.00s)
Files that failed:
* /home/pioneer/plutus/plutus-pioneer-program/code/week01/src/Week01/EnglishAuction.hs
Completed (0 files worked, 1 file failed)
2022-01-17 22:25:13.842743468 [ThreadId 228] INFO hls: finish: GenerateCore (took 0.00s)
Edit2: The workaround from this answer allowed me to view more documentation, but still waiting for a complete solution.