srid / haskell-template

Haskell project template using Nix + Flakes + VSCode (HLS)
https://srid.ca/haskell-template
MIT License
227 stars 32 forks source link

Sanity Check Fails #37

Closed dfee closed 2 years ago

dfee commented 2 years ago

I'm not sure what debugging I can provide you with, but I'm running nix (Nix) 2.10.3 and did the following:

  1. git clone https://github.com/srid/haskell-template
  2. nix develop -i -c haskell-language-server

That got to step 4 and produced the following error:

$ nix develop -i -c haskell-language-server
2022-08-18T14:01:38.093670Z | Info | No log file specified; using stderr.
2022-08-18T14:01:38.093966Z | Info | haskell-language-server version: 1.7.0.0 (GHC: 9.0.2) (PATH: /nix/store/9r70hgwq3fx1pnxr1gjygrww3jkxppw5-haskell-language-server-1.7.0.0/bin/haskell-language-server)
2022-08-18T14:01:38.094979Z | Info | Directory: /private/tmp/haskell-template
2022-08-18T14:01:38.095214Z | Info | Logging heap statistics every 60.00s
 ghcide setup tester in /private/tmp/haskell-template.
Report bugs at https://github.com/haskell/haskell-language-server/issues

Step 1/4: Finding files to test in /private/tmp/haskell-template
Found 3 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
2022-08-18T14:01:38.129318Z | Info | Cradle path: src/Lib.hs
2022-08-18T14:01:38.129389Z | Warning | No [cradle](https://github.com/mpickering/hie-bios#hie-bios) found for src/Lib.hs.
Proceeding with [implicit cradle](https://hackage.haskell.org/package/implicit-hie).
You should ignore this message, unless you see a 'Multi Cradle: No prefixes matched' error.
2022-08-18T14:01:38.133733Z | Info | Cradle path: tests/Spec.hs
2022-08-18T14:01:38.133798Z | Warning | No [cradle](https://github.com/mpickering/hie-bios#hie-bios) found for tests/Spec.hs.
Proceeding with [implicit cradle](https://hackage.haskell.org/package/implicit-hie).
You should ignore this message, unless you see a 'Multi Cradle: No prefixes matched' error.
2022-08-18T14:01:38.145244Z | Info | updateFileDiagnostics published different from new diagnostics - file diagnostics: File:     /private/tmp/haskell-template/src/Lib.hs
Hidden:   no
Range:    1:1-2:1
Source:   cradle
Severity: DsError
Message:
  Multi Cradle: No prefixes matched
  pwd: /private/tmp/haskell-template
  filepath: /private/tmp/haskell-template/src/Lib.hs
  prefixes:
  ("./Main.hs",Cabal {component = Just "haskell-template:exe:haskell-template"})
  ("tests",Cabal {component = Just "haskell-template:test:tests"})
2022-08-18 07:01:40.728715 [ThreadId 50] INFO hie-bios: Resolving dependencies...
2022-08-18 07:01:40.992997 [ThreadId 50] INFO hie-bios: Build profile: -w ghc-9.0.2 -O1
2022-08-18 07:01:40.993078 [ThreadId 50] INFO hie-bios: In order, the following will be built (use -v for more details):
2022-08-18 07:01:40.993103 [ThreadId 50] INFO hie-bios:  - haskell-template-0.1.0.0 (test:tests) (first run)
2022-08-18 07:01:41.059092 [ThreadId 50] INFO hie-bios: Configuring test suite 'tests' for haskell-template-0.1.0.0..
2022-08-18 07:01:41.605033 [ThreadId 48] INFO hie-bios: Warning: Packages using 'cabal-version: >= 1.10' and before 'cabal-version:
2022-08-18 07:01:41.605106 [ThreadId 48] INFO hie-bios: 3.4' must specify the 'default-language' field for each component (e.g.
2022-08-18 07:01:41.605148 [ThreadId 48] INFO hie-bios: Haskell98 or Haskell2010). If a component uses different languages in
2022-08-18 07:01:41.605183 [ThreadId 48] INFO hie-bios: different modules then list the other ones in the 'other-languages' field.
2022-08-18 07:01:42.568375 [ThreadId 50] INFO hie-bios: Preprocessing test suite 'tests' for haskell-template-0.1.0.0..
2022-08-18T14:01:43.151612Z | Info | Interface files cache directory: /Users/devin.fee/.cache/ghcide/main-a0fdafc114593191f79773368a636c11d0431c0e
2022-08-18T14:01:43.152187Z | Info | Making new HscEnv. In-place unit ids: [main]
2022-08-18T14:01:43.284161Z | Info | Cradle path: src/Main.hs
2022-08-18T14:01:43.284233Z | Warning | No [cradle](https://github.com/mpickering/hie-bios#hie-bios) found for src/Main.hs.
Proceeding with [implicit cradle](https://hackage.haskell.org/package/implicit-hie).
You should ignore this message, unless you see a 'Multi Cradle: No prefixes matched' error.
2022-08-18T14:01:43.289071Z | Info | updateFileDiagnostics published different from new diagnostics - file diagnostics: File:     /private/tmp/haskell-template/src/Main.hs
Hidden:   no
Range:    1:1-2:1
Source:   cradle
Severity: DsError
Message:
  Multi Cradle: No prefixes matched
  pwd: /private/tmp/haskell-template
  filepath: /private/tmp/haskell-template/src/Main.hs
  prefixes:
  ("./Main.hs",Cabal {component = Just "haskell-template:exe:haskell-template"})
  ("tests",Cabal {component = Just "haskell-template:test:tests"})
Files that failed:
 * /private/tmp/haskell-template/src/Main.hs

Completed (2 files worked, 1 file failed)
srid commented 2 years ago

Ah, yes, this is serious regression. @EvanPiro - looks like this was caused by the introduction of tests. Is there a way to solve it? Otherwise I would have to remove it (until we can add back tests without breaking HLS support).

EDIT: Adding a hie.yaml (85f9b3e) fixes, though I wish we didn't have to.