MyNixOS website logo
Description

Automatically bump package versions, also transitively.

Automatically bump package versions, also transitively.

Readme: https://www.github.com/silkapp/bumper/blob/master/README.md

Bumper

Build Status

Bumper is a tool for working with cabal packages. It lets you manage the version bounds of packages by transitively bumping packages (and their dependencies transitively), without you needing to edit the cabal files manually.

It's useful if you have a set of packages that you develop together.

You can install the latest version from Hackage

$ cabal install bumper

or try the git version if you are feeling adventurous.

To get started you should have all projects under a common directory, such as

project/package-1
project/package-2

You can now make changes to these packages and use bumper to handle version bumps. See Examples below.

Interface

$ bumper --help
Usage: bumper [OPTIONS...], with the following options:
  -m PACKAGE(,PACKAGE)*  --major=PACKAGE(,PACKAGE)*                         Comma-separated list of packages which will get a major bump (bump at position 1).
  -n PACKAGE(,PACKAGE)*  --minor=PACKAGE(,PACKAGE)*                         Comma-separated list of packages which will get a minor bump (bump at position 2).
  -0 PACKAGE(,PACKAGE)*  --bump-0=PACKAGE(,PACKAGE)*                        Comma-separated list of packages which will get a bump at position 0.
  -1 PACKAGE(,PACKAGE)*  --bump-1=PACKAGE(,PACKAGE)*                        Comma-separated list of packages which will get a bump at position 1.
  -2 PACKAGE(,PACKAGE)*  --bump-2=PACKAGE(,PACKAGE)*                        Comma-separated list of packages which will get a bump at position 2.
  -3 PACKAGE(,PACKAGE)*  --bump-3=PACKAGE(,PACKAGE)*                        Comma-separated list of packages which will get a bump at position 3.
                         --set-versions=PACKAGE@VERSION(,PACKAGE@VERSION)*  Comma-separated list of packages and their versions.
  -t                     --no-transitive                                    Do not apply bumping transitively.
  -i PACKAGE(,PACKAGE)*  --ignore=PACKAGE(,PACKAGE)*                        Comma-separated list of packages which will be ignored when transitive bumping.
  -g PATH                --global=PATH                                      Bump according to latest version number in the given package database.
  -d                     --dry-run                                          Just output the dependencies that will be updated.
  -?                     --help                                             Show usage help and exit.
  -v                     --version                                          Show version info and exit.

Behavior

  • Bumper does not reformat your cabal file, it only replaces the version ranges without using Cabal's pretty printer (which ignores existing formatting)

  • Transitive bumps are always position 3 (D) bumps. Note that your transitive packages may re-export modules or instances from their dependencies, so they may need to bumped further

  • There is no support for bumping external packages. If you depend on something you are not maintaining you need to bump that version manually

  • Bumper respects version ranges you have specified, if b depends on a >= 0.1 && < 0.3 and you bump a to 0.2.3 the bound will not change, but if you bump a to 0.3b's dependency will change to a == 0.3.*

  • If you depend on a specific version range (minor, major, ...) the level of the range may change after bumping. Depending on a == 0.1.2.* and doing a major bump of a will change your dependency to a == 0.2.*, but...

  • If you have an explicit version dependency (a == 0.1.0.1) then a major bump of a will result in a == 0.2.

Examples

You can find this repository with empty cabal projects at http://github.com/silkapp/bumper-example

$ git clone http://www.github.com/silkapp/bumper-example.git

It contains four empty cabal projects, all with version 0.1:

  • b depends on a == 0.1 (fixed version)
  • c depends on a == 0.1.* and b == 0.1.* (major dependencies)
  • d depends on a (any version) and b >= 0.1 && < 0.2 (major dependency)

Say we make a minor change to a and we've checked that all packages build together, so we run

$ bumper --minor a # or bumper -2 a
$ git diff

a/a.cabal
-version:             0.1
+version:             0.1.1

b/b.cabal
-version:             0.1
+version:             0.1.0.1
-                     , a == 0.1
+                     , a == 0.1.1

b's version and its dependency on a was bumped as well. c and d are still compatible with a so they were not modified.

It works in the same fashion no matter what degree of bumping you do.

$ git reset --hard
$ bumper --major a
$ git diff

a/a.cabal
-version:             0.1
+version:             0.2

b/b.cabal
-version:             0.1
+version:             0.1.0.1
-                     , a == 0.1
+                     , a == 0.2

c/c.cabal
-version:             0.1
+version:             0.1.0.1
-                     , a == 0.1.*
+                     , a == 0.2.*

Bumper combines all changes you do so versions aren't bumped several times, below b gets one major bump instead of a major and a minor.

$ git reset --hard
$ bumper --major a,b
$ git diff

a/a.cabal
-version:             0.1
+version:             0.2

b/b.cabal
-version:             0.1
+version:             0.2

c/c.cabal
-version:             0.1
+version:             0.1.0.1
-                     , a == 0.1.*
+                     , a == 0.2.*
-                     , b == 0.1.*
+                     , b == 0.2.*

d/d.cabal
-version:             0.1
+version:             0.1.0.1
-                     , b >= 0.1 && < 0.2
+                     , b == 0.2
Metadata

Version

0.6.0.3

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows