dan-t / cabal-bounds

Set the version bounds of dependencies in a cabal file
Other
66 stars 7 forks source link

Support new-build #11

Closed nomeata closed 6 years ago

nomeata commented 6 years ago

I really like the idea of cabal-bounds. But my workflow is built around cabal new-build instead of sandboxes, and in such a setting it does not find the current versions, because it knows about dist, but not dist-newstyle:

~/projekte/programming/hledger/hledger-irr $ ~/.cabal/bin/cabal-bounds update -e foo
cabal-bounds: Couldn't find 'dist' directory! Have you already build the project?

Have you looked into supporting this workflow?

nomeata commented 6 years ago

dist-newstyle/cache/plan.json might be an easy to parser source for that information.

dan-t commented 6 years ago

It might be quite easy supporting cabal new-build.

The function libraries in CabalBounds/Main.hs already handles different cases for supplying the libraries and their versions: from the build, a haskell platform version or from a file.

So adding support for the libraries from dist-newstyle/cache/plan.json should be quite straight forward.

dan-t commented 6 years ago

The current github version should now support cabal new-build. For now only cabal 1.24 is supported, but I want to add support for cabal 2.

There's now the new subcommand cabal-bounds libs to just output the libraries and versions a cabal-bounds update run would use.

dan-t commented 6 years ago

cabal-bounds 1.3 should now support cabal new-build.

Unfortunately cabal 2.0 has a broken pretty printing of cabal files. So by now there's only support for cabal 1.24.

nomeata commented 6 years ago

Unfortunately cabal 2.0 has a broken pretty printing of cabal files. So by now there's only support for cabal 1.24.

Is there a upstream bug report for that?

dan-t commented 6 years ago

Seems to be already fixed.