dan-t / cabal-bounds Goto Github PK
View Code? Open in Web Editor NEWSet the version bounds of dependencies in a cabal file
License: Other
Set the version bounds of dependencies in a cabal file
License: Other
readme contains cabal-bounds dump --output=libs.hs myproject.cabal
but when i try that, i get:
$> cabal-bounds dump --output=libs.hs multistate.cabal
Unhandled argument, none expected: multistate.cabal
you probably should add a -c
. or allow the free option.
As a proof of concept, I just wrote a tool (https://github.com/nomeata/cabal-plan-bounds) that calculates the cabal bounds from a bunch of plan files, so I were also faced with having to edit the build-depends in a cabal file.
I wrote some code that changes somes cabal fields, while leaving the rest of the syntax completely untouched: https://github.com/nomeata/cabal-plan-bounds/blob/master/src/ReplaceDependencies.hs
Maybe something like this is useful for you too? Although I hope that eventually this functionality will be part of the Cabal library directly (haskell/cabal#7544).
Running with GHC 7.8.3. Seems like some files are used which really shouldn't.
Test suite cabal-bounds-tests: RUNNING...
Tests
Drop Tests
DropBothOfAll: OK
DropUpperOfAll: OK
DropBothOfLib: OK
DropUpperOfLib: OK
DropBothOfExe: OK
DropUpperOfExe: OK
DropBothOfOtherExe: OK
DropUpperOfOtherExe: OK
DropBothOfAllExes: OK
DropUpperOfAllExes: OK
DropBothOfTest: OK
DropUpperOfTest: OK
DropBothOnlyBase: OK
DropUpperOnlyBase: OK
DropBothIgnoreBase: OK
DropUpperIgnoreBase: OK
Update Tests
UpdateBothOfAll: cabal-bounds: ("You need to re-run the 'configure' command. The version of Cabal being used has changed (was Cabal-1.20.0.1, now Cabal-1.20.0.2). Additionally the compiler is different (was ghc-7.6, now ghc-7.8) which is probably the cause of the problem.",ConfigStateFileBadVersion)
diff: tests/outputFiles/UpdateBothOfAll.cabal: No such file or directory
FAIL
UpdateBothOfAll: cabal-bounds: ("You need to re-run the 'configure' command. The version of Cabal being used has changed (was Cabal-1.20.0.1, now Cabal-1.20.0.2). Additionally the compiler is different (was ghc-7.6, now ghc-7.8) which is probably the cause of the problem.",ConfigStateFileBadVersion)
diff: tests/outputFiles/UpdateBothOfAll.cabal: No such file or directory
FAIL
UpdateBothOfAllExes: cabal-bounds: ("You need to re-run the 'configure' command. The version of Cabal being used has changed (was Cabal-1.20.0.1, now Cabal-1.20.0.2). Additionally the compiler is different (was ghc-7.6, now ghc-7.8) which is probably the cause of the problem.",ConfigStateFileBadVersion)
diff: tests/outputFiles/UpdateBothOfAllExes.cabal: No such file or directory
FAIL
UpdateBothOfExe: cabal-bounds: ("You need to re-run the 'configure' command. The version of Cabal being used has changed (was Cabal-1.20.0.1, now Cabal-1.20.0.2). Additionally the compiler is different (was ghc-7.6, now ghc-7.8) which is probably the cause of the problem.",ConfigStateFileBadVersion)
diff: tests/outputFiles/UpdateBothOfExe.cabal: No such file or directory
FAIL
UpdateBothOfLibrary: cabal-bounds: ("You need to re-run the 'configure' command. The version of Cabal being used has changed (was Cabal-1.20.0.1, now Cabal-1.20.0.2). Additionally the compiler is different (was ghc-7.6, now ghc-7.8) which is probably the cause of the problem.",ConfigStateFileBadVersion)
diff: tests/outputFiles/UpdateBothOfLibrary.cabal: No such file or directory
FAIL
UpdateBothOfOtherExe: cabal-bounds: ("You need to re-run the 'configure' command. The version of Cabal being used has changed (was Cabal-1.20.0.1, now Cabal-1.20.0.2). Additionally the compiler is different (was ghc-7.6, now ghc-7.8) which is probably the cause of the problem.",ConfigStateFileBadVersion)
diff: tests/outputFiles/UpdateBothOfOtherExe.cabal: No such file or directory
FAIL
UpdateBothOfTest: cabal-bounds: ("You need to re-run the 'configure' command. The version of Cabal being used has changed (was Cabal-1.20.0.1, now Cabal-1.20.0.2). Additionally the compiler is different (was ghc-7.6, now ghc-7.8) which is probably the cause of the problem.",ConfigStateFileBadVersion)
diff: tests/outputFiles/UpdateBothOfTest.cabal: No such file or directory
FAIL
UpdateLowerOfAll: cabal-bounds: ("You need to re-run the 'configure' command. The version of Cabal being used has changed (was Cabal-1.20.0.1, now Cabal-1.20.0.2). Additionally the compiler is different (was ghc-7.6, now ghc-7.8) which is probably the cause of the problem.",ConfigStateFileBadVersion)
diff: tests/outputFiles/UpdateLowerOfAll.cabal: No such file or directory
FAIL
UpdateLowerOfAllExes: cabal-bounds: ("You need to re-run the 'configure' command. The version of Cabal being used has changed (was Cabal-1.20.0.1, now Cabal-1.20.0.2). Additionally the compiler is different (was ghc-7.6, now ghc-7.8) which is probably the cause of the problem.",ConfigStateFileBadVersion)
diff: tests/outputFiles/UpdateLowerOfAllExes.cabal: No such file or directory
FAIL
UpdateLowerOfExe: cabal-bounds: ("You need to re-run the 'configure' command. The version of Cabal being used has changed (was Cabal-1.20.0.1, now Cabal-1.20.0.2). Additionally the compiler is different (was ghc-7.6, now ghc-7.8) which is probably the cause of the problem.",ConfigStateFileBadVersion)
diff: tests/outputFiles/UpdateLowerOfExe.cabal: No such file or directory
FAIL
UpdateLowerOfLibrary: cabal-bounds: ("You need to re-run the 'configure' command. The version of Cabal being used has changed (was Cabal-1.20.0.1, now Cabal-1.20.0.2). Additionally the compiler is different (was ghc-7.6, now ghc-7.8) which is probably the cause of the problem.",ConfigStateFileBadVersion)
diff: tests/outputFiles/UpdateLowerOfLibrary.cabal: No such file or directory
FAIL
UpdateLowerOfOtherExe: cabal-bounds: ("You need to re-run the 'configure' command. The version of Cabal being used has changed (was Cabal-1.20.0.1, now Cabal-1.20.0.2). Additionally the compiler is different (was ghc-7.6, now ghc-7.8) which is probably the cause of the problem.",ConfigStateFileBadVersion)
diff: tests/outputFiles/UpdateLowerOfOtherExe.cabal: No such file or directory
FAIL
UpdateLowerOfTest: cabal-bounds: ("You need to re-run the 'configure' command. The version of Cabal being used has changed (was Cabal-1.20.0.1, now Cabal-1.20.0.2). Additionally the compiler is different (was ghc-7.6, now ghc-7.8) which is probably the cause of the problem.",ConfigStateFileBadVersion)
diff: tests/outputFiles/UpdateLowerOfTest.cabal: No such file or directory
FAIL
UpdateUpperOfAll: cabal-bounds: ("You need to re-run the 'configure' command. The version of Cabal being used has changed (was Cabal-1.20.0.1, now Cabal-1.20.0.2). Additionally the compiler is different (was ghc-7.6, now ghc-7.8) which is probably the cause of the problem.",ConfigStateFileBadVersion)
diff: tests/outputFiles/UpdateUpperOfAll.cabal: No such file or directory
FAIL
UpdateUpperOfAllExes: cabal-bounds: ("You need to re-run the 'configure' command. The version of Cabal being used has changed (was Cabal-1.20.0.1, now Cabal-1.20.0.2). Additionally the compiler is different (was ghc-7.6, now ghc-7.8) which is probably the cause of the problem.",ConfigStateFileBadVersion)
diff: tests/outputFiles/UpdateUpperOfAllExes.cabal: No such file or directory
FAIL
UpdateUpperOfExe: cabal-bounds: ("You need to re-run the 'configure' command. The version of Cabal being used has changed (was Cabal-1.20.0.1, now Cabal-1.20.0.2). Additionally the compiler is different (was ghc-7.6, now ghc-7.8) which is probably the cause of the problem.",ConfigStateFileBadVersion)
diff: tests/outputFiles/UpdateUpperOfExe.cabal: No such file or directory
FAIL
UpdateUpperOfLibrary: cabal-bounds: ("You need to re-run the 'configure' command. The version of Cabal being used has changed (was Cabal-1.20.0.1, now Cabal-1.20.0.2). Additionally the compiler is different (was ghc-7.6, now ghc-7.8) which is probably the cause of the problem.",ConfigStateFileBadVersion)
diff: tests/outputFiles/UpdateUpperOfLibrary.cabal: No such file or directory
FAIL
UpdateUpperOfOtherExe: cabal-bounds: ("You need to re-run the 'configure' command. The version of Cabal being used has changed (was Cabal-1.20.0.1, now Cabal-1.20.0.2). Additionally the compiler is different (was ghc-7.6, now ghc-7.8) which is probably the cause of the problem.",ConfigStateFileBadVersion)
diff: tests/outputFiles/UpdateUpperOfOtherExe.cabal: No such file or directory
FAIL
UpdateUpperOfTest: cabal-bounds: ("You need to re-run the 'configure' command. The version of Cabal being used has changed (was Cabal-1.20.0.1, now Cabal-1.20.0.2). Additionally the compiler is different (was ghc-7.6, now ghc-7.8) which is probably the cause of the problem.",ConfigStateFileBadVersion)
diff: tests/outputFiles/UpdateUpperOfTest.cabal: No such file or directory
FAIL
UpdateBothOnlyBase: cabal-bounds: ("You need to re-run the 'configure' command. The version of Cabal being used has changed (was Cabal-1.20.0.1, now Cabal-1.20.0.2). Additionally the compiler is different (was ghc-7.6, now ghc-7.8) which is probably the cause of the problem.",ConfigStateFileBadVersion)
diff: tests/outputFiles/UpdateBothOnlyBase.cabal: No such file or directory
FAIL
UpdateUpperOnlyBase: cabal-bounds: ("You need to re-run the 'configure' command. The version of Cabal being used has changed (was Cabal-1.20.0.1, now Cabal-1.20.0.2). Additionally the compiler is different (was ghc-7.6, now ghc-7.8) which is probably the cause of the problem.",ConfigStateFileBadVersion)
diff: tests/outputFiles/UpdateUpperOnlyBase.cabal: No such file or directory
FAIL
UpdateBothIgnoreBase: cabal-bounds: ("You need to re-run the 'configure' command. The version of Cabal being used has changed (was Cabal-1.20.0.1, now Cabal-1.20.0.2). Additionally the compiler is different (was ghc-7.6, now ghc-7.8) which is probably the cause of the problem.",ConfigStateFileBadVersion)
diff: tests/outputFiles/UpdateBothIgnoreBase.cabal: No such file or directory
FAIL
UpdateLowerIgnoreBase: cabal-bounds: ("You need to re-run the 'configure' command. The version of Cabal being used has changed (was Cabal-1.20.0.1, now Cabal-1.20.0.2). Additionally the compiler is different (was ghc-7.6, now ghc-7.8) which is probably the cause of the problem.",ConfigStateFileBadVersion)
diff: tests/outputFiles/UpdateLowerIgnoreBase.cabal: No such file or directory
FAIL
UpdateMinorLower: cabal-bounds: ("You need to re-run the 'configure' command. The version of Cabal being used has changed (was Cabal-1.20.0.1, now Cabal-1.20.0.2). Additionally the compiler is different (was ghc-7.6, now ghc-7.8) which is probably the cause of the problem.",ConfigStateFileBadVersion)
diff: tests/outputFiles/UpdateMinorLower.cabal: No such file or directory
FAIL
UpdateMajor2Lower: cabal-bounds: ("You need to re-run the 'configure' command. The version of Cabal being used has changed (was Cabal-1.20.0.1, now Cabal-1.20.0.2). Additionally the compiler is different (was ghc-7.6, now ghc-7.8) which is probably the cause of the problem.",ConfigStateFileBadVersion)
diff: tests/outputFiles/UpdateMajor2Lower.cabal: No such file or directory
FAIL
UpdateMajor1Lower: cabal-bounds: ("You need to re-run the 'configure' command. The version of Cabal being used has changed (was Cabal-1.20.0.1, now Cabal-1.20.0.2). Additionally the compiler is different (was ghc-7.6, now ghc-7.8) which is probably the cause of the problem.",ConfigStateFileBadVersion)
diff: tests/outputFiles/UpdateMajor1Lower.cabal: No such file or directory
FAIL
UpdateMinorUpper: cabal-bounds: ("You need to re-run the 'configure' command. The version of Cabal being used has changed (was Cabal-1.20.0.1, now Cabal-1.20.0.2). Additionally the compiler is different (was ghc-7.6, now ghc-7.8) which is probably the cause of the problem.",ConfigStateFileBadVersion)
diff: tests/outputFiles/UpdateMinorUpper.cabal: No such file or directory
FAIL
UpdateMajor2Upper: cabal-bounds: ("You need to re-run the 'configure' command. The version of Cabal being used has changed (was Cabal-1.20.0.1, now Cabal-1.20.0.2). Additionally the compiler is different (was ghc-7.6, now ghc-7.8) which is probably the cause of the problem.",ConfigStateFileBadVersion)
diff: tests/outputFiles/UpdateMajor2Upper.cabal: No such file or directory
FAIL
UpdateMajor1Upper: cabal-bounds: ("You need to re-run the 'configure' command. The version of Cabal being used has changed (was Cabal-1.20.0.1, now Cabal-1.20.0.2). Additionally the compiler is different (was ghc-7.6, now ghc-7.8) which is probably the cause of the problem.",ConfigStateFileBadVersion)
diff: tests/outputFiles/UpdateMajor1Upper.cabal: No such file or directory
FAIL
UpdateMinorLowerAndUpper: cabal-bounds: ("You need to re-run the 'configure' command. The version of Cabal being used has changed (was Cabal-1.20.0.1, now Cabal-1.20.0.2). Additionally the compiler is different (was ghc-7.6, now ghc-7.8) which is probably the cause of the problem.",ConfigStateFileBadVersion)
diff: tests/outputFiles/UpdateMinorLowerAndUpper.cabal: No such file or directory
FAIL
UpdateMajor1LowerAndUpper: cabal-bounds: ("You need to re-run the 'configure' command. The version of Cabal being used has changed (was Cabal-1.20.0.1, now Cabal-1.20.0.2). Additionally the compiler is different (was ghc-7.6, now ghc-7.8) which is probably the cause of the problem.",ConfigStateFileBadVersion)
diff: tests/outputFiles/UpdateMajor1LowerAndUpper.cabal: No such file or directory
FAIL
UpdateOnlyMissing: cabal-bounds: ("You need to re-run the 'configure' command. The version of Cabal being used has changed (was Cabal-1.20.0.1, now Cabal-1.20.0.2). Additionally the compiler is different (was ghc-7.6, now ghc-7.8) which is probably the cause of the problem.",ConfigStateFileBadVersion)
diff: tests/outputFiles/UpdateOnlyMissing.cabal: No such file or directory
FAIL
UpdateByHaskellPlatform: OK
UpdateByHaskellPlatformAndSetupConfig: cabal-bounds: ("You need to re-run the 'configure' command. The version of Cabal being used has changed (was Cabal-1.20.0.1, now Cabal-1.20.0.2). Additionally the compiler is different (was ghc-7.6, now ghc-7.8) which is probably the cause of the problem.",ConfigStateFileBadVersion)
diff: tests/outputFiles/UpdateByHaskellPlatformAndSetupConfig.cabal: No such file or directory
FAIL
FromFile: OK
Dump: OK
33 out of 52 tests failed
Test suite cabal-bounds-tests: FAIL
Hi,
it seems that the new support for new-build
style builds does not yet work (I would expect the base
bound to be updated):
~/projekte/programming/haskell/haskell-successors $ cat *.cabal
name: successors
version: 0.1
cabal-version: >=1.10
build-type: Simple
license: MIT
license-file: LICENSE
copyright: 2017 Joachim Breitner
maintainer: [email protected]
homepage: https://github.com/nomeata/haskell-successors
synopsis: An applicative functor to manage successors
description:
This package provides the
'Control.Applicative.Successors.Succs' functor. It models
a node in a graph together with its successors. The
@Applicative@ (and @Monad@) instances are designed so that
the successors of the resulting value take exactly one
step, either in the left or the right argument to @\<*\>@
(or @>>=@).
category: Control
author: Joachim Breitner
extra-source-files:
ChangeLog.md
source-repository head
type: git
location: https://github.com/nomeata/haskell-successors
library
exposed-modules:
Control.Applicative.Successors
build-depends:
base >=4.9 && <4.10
default-language: Haskell2010
hs-source-dirs: src
~/projekte/programming/haskell/haskell-successors $ cat dist-newstyle/cache/plan.json
{"cabal-version":"2.1.0.0","cabal-lib-version":"2.1.0.0","compiler-id":"ghc-8.2.1","os":"linux","arch":"x86_64","install-plan":[{"type":"pre-existing","id":"base-4.10.0.0","pkg-name":"base","pkg-version":"4.10.0.0","depends":["rts","ghc-prim-0.5.1.0","integer-gmp-1.0.1.0"]},{"type":"pre-existing","id":"ghc-prim-0.5.1.0","pkg-name":"ghc-prim","pkg-version":"0.5.1.0","depends":["rts"]},{"type":"pre-existing","id":"integer-gmp-1.0.1.0","pkg-name":"integer-gmp","pkg-version":"1.0.1.0","depends":["ghc-prim-0.5.1.0"]},{"type":"pre-existing","id":"rts","pkg-name":"rts","pkg-version":"1.0","depends":[]},{"type":"configured","id":"successors-0.1-inplace","pkg-name":"successors","pkg-version":"0.1","flags":{},"style":"local","dist-dir":"/home/jojo/projekte/programming/haskell/haskell-successors/dist-newstyle/build/x86_64-linux/ghc-8.2.1/successors-0.1","depends":["base-4.10.0.0"],"exe-depends":[],"component-name":"lib"}]}[jojo@kirk:0] So, der 31.12.2017 um 13:22 Uhr (master u+1) Keep Smiling :-)
~/projekte/programming/haskell/haskell-successors $ ~/.cabal/bin/cabal-bounds update
~/projekte/programming/haskell/haskell-successors $ git diff *.cabal
~/projekte/programming/haskell/haskell-successors $
The generated .cabal file should have a newline to terminate the last line. (To avoid problems with diff, etc.). I'm not sure if the printing is done in cabal-bounds or in Cabal where this recent patch seems to be the fix in generation of initial .cabal files:
haskell/cabal@0124d9b
Kind regards,
Patrik
PS. Some background:
http://stackoverflow.com/questions/729692/why-should-files-end-with-a-newline
Multi-package projects using cabal.project
files have one dist-newstyle
in the root directory instead of having one for every package. cabal-bounds
won't find this folder when run inside a specific package, and doesn't have a way to target packages from outside.
When using cabal-bounds
to update dependencies of a package, the bounds for lens were updated to lens >=4.7.0 && <4.8
. However, on Hackage, lens’s most recent version is given as 4.7, without the trailing zero.
Now cabal is unable to resolve the dependencies because, according to the lexicografic ordering, 4.7 >= 4.7.0 = False.
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?
e.g.
before:
library
if os(darwin)
buildable: True
else
buildable: False
exposed-modules: ...
after cabal-bounds drop --executable=blub
:
library
if os(osx)
else
exposed-modules: ...
versions:
cabal-bounds version 1.0.1
The Glorious Glasgow Haskell Compilation System, version 7.10.1
Consider extending to support hpack. Thanks for considering
Could you please update the code, so it can be built with GHC-9 (anything from 9.2.7 to 9.6.1) and current packages on Hackage?
It would be nice if instead of changing the .cabal file, cabal-bounds
could just print out a cabal.config (similar to what stackage does) with the exact versions of a haskell-platform release. That way
a) no annoying reformatting happens
b) i can still see relatively quickly which of my bounds conflict with some platform release.
Changing the .cabal file would also make sense, but only for loosening bounds. This is currently not possible, is it? I.e. "take current bounds, and loosen them sufficiently to work with platform xy". Together with printing cabal.config, this seems to enable fast workflows like
sorry if cabal-bounds
supports such a workflow already, i may not have read the readme sufficiently carefully.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.