Skip to content

v1-install fails with internal libraries #8733

Open
1 of 1 issue completed
Open

Description

@andreasabel

Lifted from:

cabal v1-install chokes on the hackage-cli executable in the linking phase. @gbaz suspects it is because hackage-cli defines an internal library (cabal-revisions):

$ cabal get hackage-cli-0.1.0.0
$ cd hackage-cli-0.1.0.0
$ cabal v1-install -w ghc-9.4.4
...
Building library 'cabal-revisions' for hackage-cli-0.1.0.0..
...
Building executable 'hackage-cli' for hackage-cli-0.1.0.0..
...
[5 of 5] Linking dist/build/hackage-cli/hackage-cli
Installing internal library cabal-revisions in /Users/abel/.cabal/lib/x86_64-osx-ghc-9.4.4/hackage-cli-0.1.0.0-Dk3ZdfpjcyF4Z0aP4NlJOe
Installing executable hackage-cli in /Users/abel/.cabal/bin
Failed to install hackage-cli-0.1.0.0
Error: cabal: Some packages failed to install:
hackage-cli-0.1.0.0-Dk3ZdfpjcyF4Z0aP4NlJOe failed during the final install
step. The exception was:
dieVerbatim: user error (Error: cabal: '/usr/local/bin/ghc-pkg-9.4.4' exited
with an error:
z-hackage-cli-z-cabal-revisions-0.1.0.0: Warning: haddock-interfaces:
/Users/abel/.cabal/share/doc/x86_64-osx-ghc-9.4.4/hackage-cli-0.1.0.0/html/hackage-cli.haddock
doesn't exist or isn't a file
z-hackage-cli-z-cabal-revisions-0.1.0.0: Warning: haddock-html:
/Users/abel/.cabal/share/doc/x86_64-osx-ghc-9.4.4/hackage-cli-0.1.0.0/html
doesn't exist or isn't a directory
z-hackage-cli-z-cabal-revisions-0.1.0.0: installed package info from too old
version of Cabal (key field does not match id field)
)

The last line of the error "installed package info from too old version of (key field does not match id field)" is also present in this issue:

Sub-issues

Sub-issues

1 of 1 Issues completed
Loading 1 sub-issues

Activity

  1. added
    re: internal library
    on Feb 4, 2023
  2. andreasabel commented on Sep 25, 2024

    @andreasabel
    MemberAuthor

    This issue is maybe more relevant as cabal v1-install happy fails now (since happy-2.0).

    The error message is quite hermetic:

    $ cabal v1-install happy
    ...
    Completed    happy-lib-2.0.2
    ...
    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 )
    /Users/abel/.cabal/lib/x86_64-osx-ghc-9.10.1-2e29/happy-lib-2.0.2-15p6rBDzTdm9pd5BXGUD6u/Happy/Backend/LALR.hi
    Declaration for lalrBackendDataDir
    Unfolding of lalrBackendDataDir:
      getDataDir1 ErrorWithoutFlag
                    Something is amiss; requested module  happy-lib-2.0.2-15p6rBDzTdm9pd5BXGUD6u-backend-lalr:Paths_happy_lib differs from name found in the interface file happy-lib-2.0.2-15p6rBDzTdm9pd5BXGUD6u-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
    

    The least that should happen for this issue is a proper error like "v1-install not supported for package with internal libraries".

  3. sgraf812 commented on Dec 4, 2024

    @sgraf812
    Contributor

    This issue presumably came up again in haskell/happy#328, which wants to use Setup.hs for packaging happy in Arch. It appears that this issue is a blocker for anyone wanting to package binaries of haskell libraries with private sub-libraries.

  4. Vekhir commented on Dec 27, 2024

    @Vekhir

    During packaging of happy-lib, it seems that Cabals Setup copy command doesn't copy correctly when specifying --libsubdir in the Setup configure step and writes the Paths_happy_lib file to the wrong location. This happens for both, so the second one overwrites the first.

    To reproduce the issue, setting --libsubdir to any value produces the invalid artifact. Not specifying it doesn't exhibit this issue. After running the copy command with --verbose (and including other debug info like the directory structure), I got the below attached log.

    Log

    with --libsubdir=\$compiler/site-local/\$pkgid

    without --libsubdir

  5. sgraf812 commented on Jan 18, 2025

    @sgraf812
    Contributor

    It is likely that this issue is a consequence of #10687. I found a workaround to #10687 and released happy 2.1.4 with it, now cabal v1-install happy works again.

  6. andreasabel commented on Jan 19, 2025

    @andreasabel
    MemberAuthor

    now cabal v1-install happy works again.

    It does so with cabal-3.12.1.0.
    But it fails with cabal-3.14.1.1, so this might be a new regression:

    $ 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
    
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

    cabal-install: v1-re: internal librarytype: bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions