Skip to content

Cabal incorrectly constructs libHSrts library path #7763

Closed

Description

@bgamari

Describe the bug

A recent GHC bug (#20520) brought to light the fact that Cabal includes knowledge of internal implementation details of GHC (specifically, the particular file name of libHSrts). This appears to have been introduced by 382143a and 1c07f83.

This naming is unstable and has indeed changed in recent releases, hence the ghc#20520.

Activity

  1. bgamari commented on Oct 20, 2021

    @bgamari
    ContributorAuthor

    It's quite unclear to me why Cabal is trying to compute the name of libHSrts. It should rather be depending upon GHC's -flink-rts flag to instruct GHC to choose the correct RTS itself.

  2. bgamari commented on Oct 20, 2021

    @bgamari
    ContributorAuthor

    I see the reason: -flink-rts is actually a somewhat new flag (introduced in 9.0). I think the solution here is to teach Cabal to rely on this flag when available. Linking is a tricky thing and only GHC has the information to manage it robustly. We should avoid making Cabal responsible for it.

  3. fgaz commented on Oct 20, 2021

    @fgaz
    Member

    Does this mean Cabal is unusable with ghc post-#20520?

  4. bgamari commented on Oct 20, 2021

    @bgamari
    ContributorAuthor

    Cabal is currently unable to build foreign libraries with GHC 9.0 or 9.2.

  5. Mikolaj commented on Oct 20, 2021

    @Mikolaj
    Member

    I guess this implies cabal-install 3.6.3 (or at least Cabal 3.6.3).

    Edit: scratch that, we seem not to be ready for GHC 9.0 for other reasons: #7747.

  6. Mikolaj commented on Jan 29, 2022

    @Mikolaj
    Member

    @bgamari: any news? #7747 is nearing completion, so soon we should be able to test foreign libraries with master branch.

  7. Bodigrim commented on Feb 1, 2022

    @Bodigrim
    Collaborator

    @bgamari it would be nice to fix this in time for GHC 9.2.2, otherwise Windows users are likely to be stuck with GHC 8.10 indefinitely.

  8. Bodigrim commented on Apr 18, 2022

    @Bodigrim
    Collaborator

    @Mikolaj could Cabal maintainers please take the lead in resolving this?

  9. added this to the Considered for 3.8 milestone on Apr 19, 2022
  10. Mikolaj commented on Apr 19, 2022

    @Mikolaj
    Member

    Easily said. Let me beg @bgamari some more... :)

  11. Bodigrim commented on Apr 19, 2022

    @Bodigrim
    Collaborator
  12. hasufell commented on May 7, 2023

    @hasufell
    Member

    Which Cabal (library) version includes this fix?

  13. Kleidukos commented on May 7, 2023

    @Kleidukos
    Member

    @hasufell according to GH the PR (#7764) is included in 3.8.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions