Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Haskell Language Server passes file target for direct cradle to the cabal cradle #4431

Open
fendor opened this issue Oct 15, 2024 · 0 comments
Assignees
Labels
component: ghcide multi-component Issues relating to multi-component support type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..

Comments

@fendor
Copy link
Collaborator

fendor commented Oct 15, 2024

More generally, if a project has a multi cradle setup, we need to make sure we respect cradle type resolution.

Reproducer:

  • cabal 3.12.1.0
  • sessionLoading: multiComponent
  • HLS: master 1ec65ee

Logs:

2024-10-15T14:55:15.565298Z | Debug | Session loading result: Left [CradleError {cradleErrorDependencies = ["haskell-language-server.cabal","cabal.project","cabal.project.local"], cradleErrorExitCode = ExitFailure 1, cradleErrorStderr = ["Failed to run [\"cabal\",\"v2-repl\",\"--keep-temp-files\",\"--enable-multi-repl\",\"/home/hugin/Documents/haskell/hls/ghcide/src/Development/IDE/Spans/AtPoint.hs\",\"/home/hugin/Documents/haskell/hls/ghcide/test/data/hover/GotoImplementation.hs\",\"/home/hugin/Documents/haskell/hls/ghcide/test/exe/FindImplementationAndHoverTests.hs\"] in directory \"/home/hugin/Documents/haskell/hls\". Consult the logs for full command and error.","Failed command: cabal --builddir=/home/hugin/.cache/hie-bios/dist-hls-036ebb56a4cc135651b7510a90f3136d v2-repl --with-compiler /home/hugin/.cache/hie-bios/wrapper-b54f81dea4c0e6d1626911c526bc4e36 --with-hc-pkg /home/hugin/.cache/hie-bios/ghc-pkg-99f55999495b863a61d4f15d989eaab4 --keep-temp-files --enable-multi-repl /home/hugin/Documents/haskell/hls/ghcide/src/Development/IDE/Spans/AtPoint.hs /home/hugin/Documents/haskell/hls/ghcide/test/data/hover/GotoImplementation.hs /home/hugin/Documents/haskell/hls/ghcide/test/exe/FindImplementationAndHoverTests.hs","","Error: [Cabal-7121]\nFailed extracting script block: `{- cabal:` start marker not found\n\n","","Process Environment:","HIE_BIOS_GHC: /home/hugin/.ghcup/ghc/9.6.5/lib/ghc-9.6.5/bin/ghc-9.6.5","HIE_BIOS_GHC_ARGS: -B/home/hugin/.ghcup/ghc/9.6.5/lib/ghc-9.6.5/lib"]}]

the issue boils down to this cabal error:

$ cabal v2-repl --enable-multi-repl /home/hugin/Documents/haskell/hls/ghcide/src/Development/IDE/Spans/AtPoint.hs /home/hugin/Documents/haskell/hls/ghcide/test/data/hover/GotoHover.hs
Error: [Cabal-7121]
Failed extracting script block: `{- cabal:` start marker not found

GotoHover is part of a direct cradle with the contents:

cradle: {direct: {arguments: ["Foo", "Bar", "GotoHover", "RecordDotSyntax"]}}
@fendor fendor added type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. status: needs triage labels Oct 15, 2024
@wz1000 wz1000 self-assigned this Oct 16, 2024
@fendor fendor added component: ghcide multi-component Issues relating to multi-component support and removed status: needs triage labels Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: ghcide multi-component Issues relating to multi-component support type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..
Projects
None yet
Development

No branches or pull requests

2 participants