GithubHelp home page GithubHelp logo

cabal-db's People

Contributors

bartavelle avatar bsummer4 avatar davorak avatar qnikst avatar vincenthz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cabal-db's Issues

Some bounds need revision

I am trying to reverse-engineer correct bounds for cabal-db master to build.

Seems we need:

  • optparse-applicative < 0.14
  • Cabal < 2
  • base < 4.9

I applied these upper bounds to all releases of cabal-db on hackage, e.g. https://hackage.haskell.org/package/cabal-db-0.1.12/revisions/
Older versions might need even tighter bounds, but I will not research the bounds for old versions. The bounds that make 0.1.12 compile will also prevent the resolver to find older version.

Works:

$ cabal build -w ghc-7.10.3 --constraint='Cabal < 2' --constraint='optparse-applicative < 0.14' 

Failures

PackageName

Old GHCs:

Src/Env.hs:8:37: error:
    Data constructor not in scope: PackageName :: [Char] -> a
  |
8 | platformPackages = S.fromList $ map PackageName $
  |                                     ^^^^^^^^^^^
$ cabal build -w ghc-8.4.4 --constraint='Cabal < 3'
$ cabal build -w ghc-8.4.4 --constraint='Cabal < 2.4'
$ cabal build -w ghc-7.10.3 --constraint='Cabal == 2.0.*' --constraint='optparse-applicative < 0.14'

New GHCs:

[1 of 8] Compiling Env              ( Src/Env.hs, /Users/abel/bin/src/cabal-db/dist-newstyle/build/x86_64-osx/ghc-9.2.1/cabal-db-0.1.12/x/cabal-db/build/cabal-db/cabal-db-tmp/Env.o )

Src/Env.hs:8:37: error:
    • Illegal term-level use of the type constructor ‘PackageName’
        imported from ‘Distribution.Package’ at Src/Env.hs:5:30-44
        (and originally defined in ‘Distribution.Types.PackageName’)
$ cabal build -w ghc-9.2.1

Not in Scope: (<>)

[3 of 8] Compiling Options          ( Src/Options.hs, /Users/abel/bin/src/cabal-db/dist-newstyle/build/x86_64-osx/ghc-8.0.2/cabal-db-0.1.12/x/cabal-db/build/cabal-db/cabal-db-tmp/Options.o )

Src/Options.hs:67:50: error:
    • Variable not in scope: (<>) :: Mod f9 a9 -> Mod f8 a8 -> t3
$ cabal build -w ghc-7.10.3 --constraint='Cabal < 3'
$ cabal build -w ghc-8.0.2 --constraint='Cabal < 3'
$ cabal build -w ghc-7.10.3 --constraint='Cabal < 2' --constraint='optparse-applicative == 0.14.*'
$ cabal build -w ghc-8.0.2 --constraint='Cabal < 2' --constraint='optparse-applicative < 0.14'
$ cabal build -w ghc-8.2.2 --constraint='Cabal < 2' --constraint='optparse-applicative < 0.14'

Wrong location of hackage.haskell.org/00-index.tar

On my mac, the hackage.haskell.org/00-index.tar file is not located in ~/.cabal/packages but in ~/Library/Haskell/repo-cach.
Not sure if it's due to that it's running on a mac, or because it's a cabal-install 1.17.0 snapshot.

 $ cabal-db info binary
cabal-db: /Users/kolmodin/.cabal/packages/hackage.haskell.org/00-index.tar: openBinaryFile: does not exist (No such file or directory)

 $ ls ~/.cabal
config      config.platform logs        setup-exe-cache

 $ ls -lah ~/Library/Haskell/repo-cache/hackage.haskell.org/00-index.tar
-rw-------  1 kolmodin  staff    88M Apr 22 10:44 /Users/kolmodin/Library/Haskell/repo-cache/hackage.haskell.org/00-index.tar

Reading the ~/.cabal/config gives some help in finding the tarball.

 $ grep remote-repo-cache .cabal/config
remote-repo-cache: /Users/kolmodin/Library/Haskell/repo-cache

Doesn't work for packages that are not on Hackage?

I don't know how is cabal-db working, but as far as I can see it's not working for packages that are not on Hackage.

I have a library and executable that I develop using sandbox so every dependency is in the sandbox or in system-level dirs. Is there a way to make cabal-db working in this case? Would it be too hard to add this feature?

Not in scope: data constructor `AGPL'

It seems that your package is missing some CPP magic, or dependency version bounds:

$ cabal install cabal-db
Resolving dependencies...
Downloading cabal-db-0.1.8...
Configuring cabal-db-0.1.8...
Building cabal-db-0.1.8...
Preprocessing executable 'cabal-db' for cabal-db-0.1.8...
[1 of 4] Compiling Paths_cabal_db   ( dist/build/autogen/Paths_cabal_db.hs, dist/build/cabal-db/cabal-db-tmp/Paths_cabal_db.o )
[2 of 4] Compiling Graph            ( Src/Graph.hs, dist/build/cabal-db/cabal-db-tmp/Graph.o )
[3 of 4] Compiling Options          ( Src/Options.hs, dist/build/cabal-db/cabal-db-tmp/Options.o )
[4 of 4] Compiling Main             ( Src/Main.hs, dist/build/cabal-db/cabal-db-tmp/Main.o )

Src/Main.hs:342:20:
    Not in scope: data constructor `AGPL'
    Perhaps you meant one of these:
      `GPL' (imported from Distribution.License),
      `LGPL' (imported from Distribution.License)
Failed to install cabal-db-0.1.8
cabal: Error: some packages failed to install:
cabal-db-0.1.8 failed during the building phase. The exception was:
ExitFailure 1

(This is with Cabal-1.6)

cabal db didn't clean up

I interrupted cabal-db diff with Ctrl-C, and the source directories were not removed. (I hope they would have been removed if I didn't interrupt!) You probably have to add a bracket in the relevant place.

Also, it would be cleaner if the packages were unpacked not in the current directory, but in a temporary one.

Build failure - Ambiguous occurrence

Preprocessing executable 'cabal-db' for cabal-db-0.1.11...
[1 of 8] Compiling Printing         ( Src/Printing.hs, dist/build/cabal-db/cabal-db-tmp/Printing.o )
[2 of 8] Compiling Ver              ( Src/Ver.hs, dist/build/cabal-db/cabal-db-tmp/Ver.o )
[3 of 8] Compiling Database         ( Src/Database.hs, dist/build/cabal-db/cabal-db-tmp/Database.o )
[4 of 8] Compiling Policy           ( Src/Policy.hs, dist/build/cabal-db/cabal-db-tmp/Policy.o )
[5 of 8] Compiling Env              ( Src/Env.hs, dist/build/cabal-db/cabal-db-tmp/Env.o )
[6 of 8] Compiling Graph            ( Src/Graph.hs, dist/build/cabal-db/cabal-db-tmp/Graph.o )
[7 of 8] Compiling Options          ( Src/Options.hs, dist/build/cabal-db/cabal-db-tmp/Options.o )
[8 of 8] Compiling Main             ( Src/Main.hs, dist/build/cabal-db/cabal-db-tmp/Main.o )

Src/Main.hs:201:23:
    Ambiguous occurrence ‘unPackageName’
    It could refer to either ‘Main.unPackageName’,
                             defined at Src/Main.hs:41:1
                          or ‘Distribution.Package.unPackageName’,
                             imported from ‘Distribution.Package’ at Src/Main.hs:6:1-27

Src/Main.hs:202:42:
    Ambiguous occurrence ‘unPackageName’
    It could refer to either ‘Main.unPackageName’,
                             defined at Src/Main.hs:41:1
                          or ‘Distribution.Package.unPackageName’,
                             imported from ‘Distribution.Package’ at Src/Main.hs:6:1-27

Src/Main.hs:216:65:
    Ambiguous occurrence ‘unPackageName’
    It could refer to either ‘Main.unPackageName’,
                             defined at Src/Main.hs:41:1
                          or ‘Distribution.Package.unPackageName’,
                             imported from ‘Distribution.Package’ at Src/Main.hs:6:1-27

Src/Main.hs:278:23:
    Ambiguous occurrence ‘unPackageName’
    It could refer to either ‘Main.unPackageName’,
                             defined at Src/Main.hs:41:1
                          or ‘Distribution.Package.unPackageName’,
                             imported from ‘Distribution.Package’ at Src/Main.hs:6:1-27

Src/Main.hs:297:44:
    Ambiguous occurrence ‘unPackageName’
    It could refer to either ‘Main.unPackageName’,
                             defined at Src/Main.hs:41:1
                          or ‘Distribution.Package.unPackageName’,
                             imported from ‘Distribution.Package’ at Src/Main.hs:6:1-27

Src/Main.hs:337:28:
    Ambiguous occurrence ‘unPackageName’
    It could refer to either ‘Main.unPackageName’,
                             defined at Src/Main.hs:41:1
                          or ‘Distribution.Package.unPackageName’,
                             imported from ‘Distribution.Package’ at Src/Main.hs:6:1-27

Src/Main.hs:343:61:
    Ambiguous occurrence ‘unPackageName’
    It could refer to either ‘Main.unPackageName’,
                             defined at Src/Main.hs:41:1
                          or ‘Distribution.Package.unPackageName’,
                             imported from ‘Distribution.Package’ at Src/Main.hs:6:1-27
Failed to install cabal-db-0.1.11
cabal: Error: some packages failed to install:
cabal-db-0.1.11 failed during the building phase. The exception was:
ExitFailure 1
ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.8.4


cabal --version
cabal-install version 1.22.0.0
using version 1.22.0.0 of the Cabal library

Compilation fails with tar version 0.3.2.0

I tried installing cabal-db but the compilation failed with the following (abbreviated) error message:

Src/Main.hs:94:32:
    `Tar.Entries' is applied to too many type arguments
    In the type signature for `listTar':
      listTar :: Show e => Tar.Entries e -> [([FilePath], ByteString)]

Turned out that the tar package was installed at version 0.3.2.0. Changing cabal-db.cabal to restrict the version of tar to 0.4, i.e., tar == 0.4.*, made the compilation complete successfully and the program now runs flawlessly.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.