Multi-component session fails: Error while expanding response file: .../multi-out-<pid>/<unit>: openFile: does not exist (HLS 2.14.0.0, cabal 3.16.1.0)
type: bugcomponent: hie-bios
### Environment
- HLS: 2.14.0.0 (binary haskell-language-server-9.10.3~2.14.0.0 from ghcup)
- cabal-install: 3.16.1.0
- GHC: 9.10.3
- OS: macOS 15.7.7 (x86_64)
- Editor: VSCode with vscode-haskell 2.8.1, haskell.manageHLS: "GHCup" (extension launches the toolchain via ghcup run pinning ghc 9.10.3 / cabal 3.16.1.0 / hls 2.14.0.0)
- Session loading: multipleComponents (default)
- Project: multi-package cabal.project (9 local packages), explicit hie.yaml containing just cradle: cabal:
### Symptom
With multi-component session loading, opening a second component's file makes the cradle load fail. GHC (invoked by hie-bios) is passed a @response-file under the hie-bios builddir's multi-out-<pid>/ directory that does not exist. The affected file then gets no diagnostics/hover at all; there is no cradle-error diagnostic in the editor — the failure is only visible in the server log.
Which unit's response file is missing varies between attempts.
```
2026-07-04T13:43:24 | Info | Load cabal cradle using all files (multi-components)
2026-07-04T13:43:24 | Info | cabal --builddir=/Users/luntain/.cache/hie-bios/dist-ta-387d182b2d92d2f166c995ffa5710d0c v2-repl --keep-temp-files --with-repl /Users/luntain/.cache/hie-bios/repl-wrapper-fae20739a232ed1b9dcdf40eca9cf71e --enable-multi-repl /Users/luntain/p/ta/libs/prices/test/Main.hs /Users/luntain/p/ta/libs/prices/src/MD/Store.hs
2026-07-04T13:43:30 | Info | cabal --builddir=/Users/luntain/.cache/hie-bios/dist-ta-387d182b2d92d2f166c995ffa5710d0c v2-repl --with-compiler /Users/luntain/.cache/hie-bios/wrapper-b54f81dea4c0e6d1626911c526bc4e36 --with-hc-pkg /Users/luntain/.cache/hie-bios/ghc-pkg-f0acafe9e7ec7014630d97b31bf0cef4 --enable-multi-repl /Users/luntain/p/ta/libs/prices/test/Main.hs /Users/luntain/p/ta/libs/prices/src/MD/Store.hs
Error while expanding response file: /Users/luntain/.cache/hie-bios/dist-ta-387d182b2d92d2f166c995ffa5710d0c/multi-out-48326/prices-0.1-inplace-unit-test: openFile: does not exist (No such file or directory)
After restarting HLS with both files open, same failure but now the missing unit is the library:
2026-07-04T14:02:05 | Info | cabal --builddir=... v2-repl --with-compiler ... --enable-multi-repl /Users/luntain/p/ta/libs/prices/src/MD/Store.hs /Users/luntain/p/ta/libs/prices/test/Main.hs
Error while expanding response file: /Users/luntain/.cache/hie-bios/dist-ta-387d182b2d92d2f166c995ffa5710d0c/multi-out-55821/prices-0.1-inplace: openFile: does not exist (No such file or directory)
```
Notably the pid in the missing path (multi-out-48326, multi-out-55821) does not correspond to the second cabal invocation that failed, suggesting a stale path is being reused across the two-phase load (first invocation runs with --keep-temp-files --with-repl <wrapper>, second with --with-compiler <wrapper>). No multi-out-* directories exist in the builddir afterwards.
### What works
cabal build all and cabal repl (single target) work fine, including cabal repl libs/prices/test/Main.hs.
One-shot check loads the same file fine with single-component loading: haskell-language-server-9.10.3~2.14.0.0 libs/prices/test/Main.hs → "Load cabal cradle using single file … Completed (1 file worked, 0 files failed)".
Workarounds (either works on its own):
* haskell.sessionLoading: "singleComponent" restores diagnostics everywhere.
* downgrade cabal to 3.14
* downgrade hls to 2.13
### Expected
Either the multi-repl session loads, or the cradle failure surfaces as a diagnostic on the file instead of silently leaving it session-less.
1 条评论