GithubHelp home page GithubHelp logo

cabal-bounds's People

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

cabal-bounds's Issues

unhandled argument on snippet from readme

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.

Updating bounds without reformatting

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).

Fragile tests

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

new-build support not quite working

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 $ 

Support projects using cabal.project

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.

Cabal’s lexicografic ordering and trailing zeros in version bounds

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.

Support new-build

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?

drops `if` clause in `library`

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

Hpack?

Consider extending to support hpack. Thanks for considering

write cabal.config / loosen bounds

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

  1. loosen bounds for platform xy and write the exact bounds into cabal.config
  2. try to compile/test (using sandbox of course)
  3. a) everything is fine -> delete cabal.config; b) fix fixable problems, then delete cabal.config or c) revert 1.

sorry if cabal-bounds supports such a workflow already, i may not have read the readme sufficiently carefully.

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.