Skip to content

Removal of sub-component targets breaks HLS/hie-bios: we need regression test #9688

@TeofilC

Description

@TeofilC

UPDATE: the change was reverted but let's leave the ticket open until we have a regression test.

Describe the bug

#8966 removes cabal-install's support for sub-module targets.

But this (mis-)feature is used by HLS via hie-bios to determine the flags for a component.

In particular it makes a call to cabal v2-repl <path to a .hs in the component>

To Reproduce
Steps to reproduce the behavior:

Have a prerelease of cabal-install on your PATH

$ cabal repl <path to a .hs file>
Warning: this is a debug build of cabal-install with assertions enabled.
Error: [Cabal-7121]
Failed extracting script block: `{- cabal:` start marker not found

or

$ haskell-language-server <path to .hs file or a component target>
...
Loading the module 'so-and-so.hs' failed.

  It may not be listed in your .cabal file!
  Perhaps you need to add `so-and-so` to other-modules or exposed-modules.

Expected behavior
HLS should at least work.
Perhaps some work needs to be done to migrate HLS/hie-bios off this feature.
Alternatively the MR could be reverted.

System information
tested using cabal-head

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions