Skip to main content

dbp

PyPI version Build status

docker-buildpackage

dbp runs git-buildpackage in managed gbp-docker containers, enabling compiler and dependency caches. dbp requires Python >=3.5.

Installation

Fetch the latest release.

pip3 install dbp

Usage

By default, dbp includes OPX apt sources.

  • dbp build src/ runs an out-of-tree build and stores build artifacts in ./pool/ for easy publishing
  • dbp shell launches an interactive bash shell in the development environment container
  • dbp run starts a persistent container in the background
  • dbp rm removes the persistent container from the background

Both dbp build and dbp shell use temporary containers if no container exists.

Advanced usage

Here are some fun things you can do with dbp.

Build a single package in a non-persistent container

dbp build src
  • Builds artifacts for the default Debian distribution
  • Uses packages found in ./pool/stretch-amd64 as build dependencies
  • Deposits artifacts in ./pool/stretch-amd64/src/
  • If workspace container does not exist, a container is created for this build and destroyed after
  • If the workspace container already exists, it is used for the build and not destroyed after
dbp --dist buster build src
  • Builds the package against Buster
  • Deposits artifacts in ./pool/buster-amd64/src/
EXTRA_SOURCES="deb http://deb.openswitch.net/stretch 3.0.0 opx opx-non-free"
dbp build src
  • Adds EXTRA_SOURCES to sources.list

Build multiple repositories

With no directories specified, dbp will build in build dependency order.

dbp build

Otherwise, directories can be manually specified.

dbp build src new-src amazing-src

Build against an OPX release

dbp --release 3.0.0 build

Build against a Debian distribution

dbp --dist bionic build

Build against extra apt sources

dbp will read from the following list of inputs for extra apt sources. These sources must be in standard sources.list format.

  1. --extra-sources argument
  2. EXTRA_SOURCES environment variable
  3. ./.extra_sources.list file
  4. ~/.extra_sources.list file

For example, fill ~/.extra_sources.list with

deb     http://deb.openswitch.net/stretch stable opx opx-non-free
deb-src http://deb.openswitch.net/stretch stable opx

and dbp build will search OpenSwitch for build dependencies.

$ dbp -v build src
INFO:dbp:Loaded extra sources:
deb     http://deb.openswitch.net/stretch stable opx opx-non-free
deb-src http://deb.openswitch.net/stretch stable opx

If no sources are fouhd, the default OPX sources are used.

Exclude custom apt sources

Also excludes default OPX sources.

dbp --no-extra-sources build

Develop inside a persistent development container

Using the run subcommand launches a persistent development container. This container will only be explicitly removed when dbp rm is run in the same directory. Then use dbp shell to enter this container.

dbp run
dbp shell

# Now we are inside the container (denoted by $ prompt)
$ cd src/

# Install build dependencies and build the package
$ gbp buildpackage

# Only install build dependencies
$ install-build-deps

# On failed builds, avoid the long gbp build time by quickly rebuilding
$ fakeroot debian/rules build

# Manually clean up
$ fakeroot debian/rules clean

# Add a new source for build dependencies by appending to the env var
$ export EXTRA_SOURCES="$EXTRA_SOURCES
deb http://deb.openswitch.net/stretch 3.0.0 opx opx-non-free"

# Run gbp buildpackage again to do a clean build, but this time skip installing build deps
$ gbp buildpackage --git-prebuild=':'

# Run an "official" build (what the CI runs)
$ cd /mnt
$ build src

# Build an unstripped, unoptimized binary (this also works with gbp and debian/rules)
$ DEB_BUILD_OPTIONS='nostrip noopt debug' build src

# Exit the container
$ exit

# Remove the container when finished (or use `dbp shell/build` again to re-enter the same container)
dbp rm

Important: Packages are only indexed for build dependencies in pool/${DIST}-${ARCH}/. Building with build ./src automatically deposits build artifacts into the correct directory for indexing. You can also simply copy .deb files into the directory.

Pass additional git-buildpackage options

For example, skip building when tagging by passing the correct flag.

dbp build src --gbp="--git-tag-only"

Pull any Docker image updates

dbp pull
dbp -d buster pull

Metadata

Release files for dbp 0.7.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dbp 0.7.1
File Size Uploaded
dbp-0.7.1.tar.gz 7.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dbp 0.7.1
File Interpreter ABI Platform
dbp-0.7.1-py3-none-any.whl Python 3 none any Details

Total release size: 24.5 kB

Release files / dbp-0.7.1.tar.gz

Download URL dbp-0.7.1.tar.gz
Size 7.1 kB
Tags Source
SHA-256 checksum
How to use checksums
6678376e3e6fccf19b961055f431626818999d074d9bc799e118cc62e977f85f
BLAKE2b-256 checksum
How to use checksums
490ac77cad791244ad585481cabf5d808e1e289cf5a5e97c1848f0d6866989be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.19.1

Release files / dbp-0.7.1-py3-none-any.whl

Download URL dbp-0.7.1-py3-none-any.whl
Size 17.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
876fd26a86d74f996250a55eb8d5944187f32b415f46277a09c5a7fa96990ed0
BLAKE2b-256 checksum
How to use checksums
fc6db8de2b7c962e290c8f00aca9f53eae2e84547065c2d09a71bce0bc80f51f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.19.1
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page