Skip to content

Regression in 2.0: cabal v1-install happy fails with mysterious interface error #315

Closed

Description

@andreasabel

Lifted from:

CI failure due to happy-2.0: https://github.com/agda/agda-stdlib/actions/runs/11030950764/job/30636656269#step:6:34

$ cabal v1-install happy
...
Building executable 'happy' for happy-2.0.2..
[1 of 2] Compiling Paths_happy      ( dist/build/happy/autogen/Paths_happy.hs, dist/build/happy/happy-tmp/Paths_happy.o )
[2 of 2] Compiling Main             ( app/Main.lhs, dist/build/happy/happy-tmp/Main.o )
/home/runner/.cabal/lib/x86_64-linux-ghc-9.8.2/happy-lib-2.0.2-EgcIv144oLmqXufj3QhQk/Happy/Backend/LALR.hi
Declaration for lalrBackendDataDir
Unfolding of lalrBackendDataDir:
  getDataDir1 ErrorWithoutFlag
                Something is amiss; requested module  happy-lib-2.0.2-EgcIv144oLmqXufj3QhQk-backend-lalr:Paths_happy_lib differs from name found in the interface file happy-lib-2.0.2-EgcIv144oLmqXufj3QhQk-backend-glr:Paths_happy_lib (if these names look the same, try again with -dppr-debug)

<no location info>: error:
    Cannot continue after interface file error

So it looks like v1-install does not work for happy anymore.

Maybe we should reconsider using the interal libraries feature that cabal does not support fully yet.

A proper support by cabal would be at least an error message stating that v1-install does not work with internal libraries.

Activity

  1. changed the title [-]Regression in 2.0: building happy fails with mysterious interface error[/-] [+]Regression in 2.0: `cabal v1-install happy` fails with mysterious interface error[/+] on Sep 25, 2024
  2. added a commit that references this issue on Sep 25, 2024
  3. andreasabel commented on Sep 26, 2024

    @andreasabel
    MemberAuthor

    What limits the impact of this regression is that cabal v1-install foo with happy in the build-tool-depends will not cabal v1-install happy, but just complain that there is no happy in the PATH.
    So the situation can only be triggered by cabal v1-install happy itself.
    In practice, there is no need to use cabal v1-install for an executable over cabal v2-install.

    So maybe all that is to be done here is to bug the Cabal developers to handle the situation of internal-libraries with v1-install properly as opposed to just driving by GIGO.

  4. added
    upstream
    on Sep 26, 2024
  5. sgraf812 commented on Sep 26, 2024

    @sgraf812
    Collaborator

    I'm beginning to think that happy-lib should not use internal libraries. For an important ecosystem tool such as happy, there are just too many papercuts. Even if haskell/cabal#8733 gets fixed, I'm not sure it is acceptable to support v1-install only in Cabal 3.14 and later; this would be an unforced breaking change on many clients.

    So I propose the following:

    • Do not use internal libraries in happy-lib/vendor
    • To guarantee separation of concerns (as @Ericson2314 suggests), add another happy-lib-sep.cabal file which looks like the current happy-lib.cabal file. This file maintains the internal libraries separation and is built as part of CI. The net result is that we build everything twice, but since happy-lib-sep.cabal is not a dependency of the executable I hope that we don't need to build everything twice all that often (except when running cabal test).
  6. sgraf812 commented on Sep 26, 2024

    @sgraf812
    Collaborator

    A low maintenance alternative might be to instead add commented imports. Easier exemplified than explained.
    In Happy.Tabular.Nameset, add

    > import Happy.Grammar () -- See Note [Separation dependency]

    (I see that NameSet already has this dependency. Bother.)

    This dependency expresses that the "top" module in the dependency hierarchy of happy-grammar should be built before the "bottom" module of happy-tabular. (In general, there are no unique tops or bottoms, so perhaps this should rather be "sinks" and "sources".)

    Another example: In Happy.Backend.LALR, add

    > import Happy.Tabular () -- See Note [Separation dependency]

    and so on.

    Now, if there's ever a violation of the separation that the package declarations would enforce, we will get a cyclic import error.

  7. int-index commented on Sep 26, 2024

    @int-index
    Collaborator

    v2- commands have been the default in cabal-install for a while now. I'm not at all worried about compatibility with v1- commands, which will eventually get removed/deprecated anyway.

  8. Ericson2314 commented on Sep 26, 2024

    @Ericson2314
    Collaborator

    Yes in general I am sympathetic that we can only get away with saying "actually it's a Cabal bug" so many times, but in this case I agree with @int-index, I have no sympathy for anyone that insists on using v1 commands in 2024. And indeed no on at the Agda side was actually insisting on this.

    agda/agda#4627 (comment) I left this comment because I think the Agda comment is just plain out of date at this point.

  9. sgraf812 commented on Sep 26, 2024

    @sgraf812
    Collaborator

    I'm hesitant if it's a good idea for us to make an unforced change that in turn forces hundreds of Agda users to change their workflows... I would rather hear from other Agda users that they are fine with v2-install.

  10. Ericson2314 commented on Sep 26, 2024

    @Ericson2314
    Collaborator

    @sgraf812 Well they already changed their CI? It's not clear to me at least that they want anything more from us.

  11. sgraf812 commented on Sep 26, 2024

    @sgraf812
    Collaborator

    Well, the comment you cited indicated that the Agda team recommends its users to install Agda with v1-install. Changing that recommendation would break a lot of habits and existing documentation.

    Although upon searching in https://agda.readthedocs.io/en/latest/, there aren't that many mentions of v1-install.

    As I said, we should ask people who know how many people are affected by this.

    Ah, it may be that Agda users aren't really affected by this because cabal v1-install Agda will just use the happy in $PATH. Anyway, I'm confused enough to wait for a response from an Agdress (sorry, couldn't resist).

  12. Ericson2314 commented on Sep 26, 2024

    @Ericson2314
    Collaborator

    Yeah I am fine waiting too. But my guess is this is basically a stale comment (that, according to the one person, linked the wrong issue too). I imagine we'll all be a bit confused at first :).

  13. andreasabel commented on Sep 26, 2024

    @andreasabel
    MemberAuthor

    So yes, what I was trying to say is that it should not be a big problem for Agda users, as the official installation instructions do not recommend v1-install unless you want to install the development version. But even then, it says to cabal install happy first which would not cause the present issue.
    So we could hope that no more complaints come in...

  14. sgraf812 commented on Oct 21, 2024

    @sgraf812
    Collaborator

    I'm inclined to close this issue as won't fix then. Feel free to reopen if you think your v1-install use case is urgent.

  15. andreasabel commented on Jan 19, 2025

    @andreasabel
    MemberAuthor

    The current behavior of v1-install is now (happy-2.1.4):

    • cabal-3.12.1.0: succeeds
    • cabal-3.14.1.1: fails
    $ cabal v1-install happy 
    Resolving dependencies...
    Error: [Cabal-7654]
    No cabal file found.
    Please create a package description file <pkgname>.cabal
    
    Failed to install happy-lib-2.1.4
    Error: [Cabal-7140]
    Some packages failed to install:
    happy-2.1.4-FEt88s8bYtb4jlboxNtUeZ depends on happy-2.1.4 which failed to install.
    happy-lib-2.1.4-1UOKRLhw4Nh6fWsmrPkI7e failed during the configure step. The exception was:
      ExitFailure 1
    

    Upstream issue:

  16. Mikolaj commented on Mar 13, 2025

    @Mikolaj
    Member

    Given that this ticket got closed, is there also a fix for haskell/cabal#10761?

  17. andreasabel commented on Mar 13, 2025

    @andreasabel
    MemberAuthor

    happy-2.1.4 closed this ticket.

    Given that this ticket got closed, is there also a fix for haskell/cabal#10761?

    That one I reported with happy-2.1.4, but somehow cannot reproduce it, so I closed it now.

  18. Mikolaj commented on Mar 13, 2025

    @Mikolaj
    Member

    Thank you.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    build failureregression in happy-2.*upstreamwontfix

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions