DEBSPAWN-BUILD(1)

πŸ“¦
version 0.6.5 Β· 3 versions
, in ubuntu stonking

πŸ’– DEBSPAWN-BUILD πŸ’–

okay bestie, so this is the manual page for debspawn-build from the debspawn situation β€” literally the tool that builds Debian packages inside a container. pull up a chair, we're getting into it 🫢


✨ NAME ✨

debspawn-build β€” build Debian packages in a container, no cap πŸŽ€


🌸 SYNOPSIS 🌸

debspawn build [-h|--help] [--variant] [-a|--arch] [--suite] [--sign]
               [--only] [--include-orig] [--buildflags] [--results-dir]
               [--maintainer] [--clean-source] [--lintian]
               [--no-buildlog] [-i|--interact] [--allow-network]
               [-e|--setenv] {SUITE} [DIR|DSC_FILE]

πŸ¦‹ DESCRIPTION πŸ¦‹

so basically: you build a Debian package either from a directory or from a source package *.dsc file. debspawn makes a brand-new container for that build using the base image you specified, builds the package, and then hands the build artifacts back to you in the default output directory /var/lib/debspawn/results/ β€” unless you told it to put them somewhere else with the --results-dir flag. πŸ’…

the packages that get downloaded as build dependencies? they're cached, and debspawn will reuse them on later builds whenever it can. obsessed tbh. πŸŽ€

you can also inject packages into the build environment that aren't in the preconfigured APT repositories. how? drop them in /var/lib/debspawn/injected-pkgs/${container-name}, or in /var/lib/debspawn/injected-pkgs/ if you want that package available in all environments. under the hood debspawn builds a transient package repository out of those packages and adds it as a package source for APT. iconic. ✨

and if you wanna debug the package build process, pass the --interact flag to debspawn. that opens an interactive root shell in the build environment post-build β€” doesn't matter whether the build failed or succeeded, you get your shell. after you've investigated the issue / built the package manually, you exit the shell and debspawn asks you whether it should copy the changes you made in the packages' debian/ directory back to the host so they become permanent. just know that while interactive mode is enabled, no build log can be created. πŸ’€

by default, network access is disabled during the untrusted package build step. you can explicitly opt into network access with --allow-network if your build workflow requires it.


πŸ”₯ EXAMPLES πŸ”₯

you can build a package from its source directory, or just by handing a plain .dsc file to debspawn build. and if you want the result automatically signed, you gotta pass the --sign flag too:

$ cd ~/packages/hello
$ debspawn build sid --sign

$ debspawn build --arch=i386 cosmic ./hello_2.10-1.dsc

you can also build packages with git-buildpackage and debspawn together. in that case the --lintian flag is used too, so it runs a Lintian static analysis check in the container after the build:

$ gbp buildpackage --git-builder='debspawn b sid --lintian --sign'

and to debug a build issue interactively, the --interact flag is right there:

$ debspawn build sid --interact

πŸ’… OPTIONS πŸ’…

  • -h, --help β€” prints brief help info about the available commands. short king of flags. 🫢
  • --variant β€” sets the variant of the selected image, the one that was used for bootstrapping.
  • -a, --arch β€” the architecture of the base image that should be selected.
  • --suite β€” explicitly sets a suite name, instead of having it derived from the container name.
  • --sign β€” signs the resulting package. πŸ”
  • --only β€” selects only a specific set of packages to be built. the choices are:
    • binary: build only binary packages, no source files are to be built and/or distributed.
    • arch: build only architecture-specific binary packages.
    • indep: build only architecture-independent (arch:all) binary packages.
    • source: do a source-only build, no binary packages are made.
  • --include-orig β€” forces the inclusion of the original source.
  • --buildflags β€” sets flags passed through to dpkg-buildpackage as a semicolon-separated list.
  • --results-dir β€” overrides the configured results directory and returns artifacts at a custom location.
  • --maintainer β€” sets the name and email address of the maintainer for this package and upload, rather than using the information from the source tree's control file or changelog.
  • --clean-source β€” runs the d/rules clean target outside of the container. heads up bestie: this means the package build dependencies need to be installed on the host system when you're building from a source directory. 😭
  • --lintian β€” runs the Lintian static analysis tool for Debian packages after the package is built.
  • --no-buildlog β€” does not write a build log.
  • -i, --interact β€” runs an interactive shell in the build environment after build. this implies --no-buildlog and disables the log.
  • --allow-network β€” allows network access during the package build step. it's disabled by default. 🚫🌐
  • -e, --setenv β€” sets an environment variable for the build process. takes a key=value pair and may be defined multiple times to set different environment variables.

🌈 DIFFERENCES TO SBUILD 🌈

so on Debian, sbuild is the primary tool used for package building, and it uses a whole different technology. so naturally the question is: are the sbuild build environments and the debspawn build environments identical, or at least compatible? valid question, bestie.

and the tea is: because of the different technology used, there may be subtle differences between sbuild chroots and debspawn containers. those differences shouldn't have any impact on package builds, and if any such thing does happen, it's highly likely a bug in the package's build process. if you think it's not? please file a bug against Debspawn. we try to be as close to sbuild's default environment as possible, but unfortunately we can not make any guarantees. 🀷

one way the debspawn build environment differs from Debian's default sbuild setup intentionally is in its consistent use of unicode. by default, debspawn will ensure that unicode is always available and enabled. if you do not want this behavior, you can pass the --no-unicode flag to debspawn build to disable unicode in the tool itself and in the build environment.


πŸŽ€ SEE ALSO πŸŽ€

debspawn-update(1), debspawn-create(1), dpkg-buildpackage(1).


πŸ‘‘ AUTHOR πŸ‘‘

this manual page was written by Matthias Klumpp <mak@debian.org>. slay.


Copyright Β© 2018-2022 Matthias Klumpp


okay that's the whole thing, you're officially a debspawn build girlie now πŸ’– this was the Debspawn manual, DEBSPAWN-BUILD(1), Β© 2018-2022 Matthias Klumpp β€” go build something iconic bestie, periodt βœ¨πŸ¦‹

πŸ“¦ where this page comes from