Skip to main content

A container approach to test a Gentoo package within a clean stage3 container

Project description

This is a tool to test a Gentoo ebuild and its dependencies. The idea is that the ebuild is emerged in a clean (and current) stage3 Docker container.

https://badge.fury.io/py/ebuildtester.svg Documentation Status GitHub Actions Join the chat at https://gitter.im/ebuildtester/ebuildtester Get it from the Snap Store

Requirements

Using require Docker and FUSE.

If you plan to use specific storage driver options (by passing --storage-opt), be aware that these are specific to the configured Docker storage driver. Refer to the Docker documentation about storage drivers for more information. Particularly see the list of options per storage driver.

System-wide configuration of the storage driver used by Docker is done in /etc/docker/daemon.json. For example, to select the devicemapper storage driver, specify:

{
  "storage-driver": "devicemapper"
}

Usage

We are going to assume that the user has a local git clone of the portage tree in

/usr/local/git/gentoo

We have added a new ebuild and would like to verify that the build dependencies are all correct. We can build the package (ATOM) with:

ebuildtester --portage-dir /usr/local/git/gentoo \
  --atom ATOM \
  --use USE1 USE2

where we have specified two USE flags, USE1 and USE2. The ebuildtester command will now create a docker container and start installing the ATOM. All specified dependencies will be installed as well.

Command line arguments

The command understands the following command line arguments:

usage: ebuildtester [-h] [--version] [--atom ATOM [ATOM ...]] [--binhost BINHOST] [--live-ebuild]
                    [--manual] --portage-dir PORTAGE_DIR [--overlay-dir OVERLAY_DIR] [--update]
                    [--install-basic-packages] [--threads N] [--use USE [USE ...]]
                    [--global-use GLOBAL_USE [GLOBAL_USE ...]] [--unmask ATOM] [--unstable]
                    [--gcc-version VER] [--python-single-target PYTHON_SINGLE_TARGET]
                    [--python-targets PYTHON_TARGETS] [--rm] [--storage-opt STORAGE_OPT [STORAGE_OPT ...]]
                    [--with-X] [--with-vnc] [--profile PROFILE] [--features FEATURES [FEATURES ...]]
                    [--docker-image DOCKER_IMAGE] [--docker-command DOCKER_COMMAND] [--pull]
                    [--show-options] [--ccache CCACHE_DIR] [--batch]

A dockerized approach to test a Gentoo package within a clean stage3.

options:
  -h, --help            show this help message and exit
  --version             show program's version number and exit
  --atom ATOM [ATOM ...]
                        The package atom(s) to install
  --binhost BINHOST     Binhost URI
  --live-ebuild         Unmask the live ebuild of the atom
  --manual              Install package manually
  --portage-dir PORTAGE_DIR
                        The local portage directory
  --overlay-dir OVERLAY_DIR
                        Add overlay dir (can be used multiple times)
  --update              Update container before installing atom
  --install-basic-packages
                        Install basic packages after container starts
  --threads N           Use N (default 8) threads to build packages
  --use USE [USE ...]   The use flags for the atom
  --global-use GLOBAL_USE [GLOBAL_USE ...]
                        Set global USE flag
  --unmask ATOM         Unmask atom (can be used multiple times)
  --unstable            Globally 'unstable' system, i.e. ~amd64
  --gcc-version VER     Use gcc version VER
  --python-single-target PYTHON_SINGLE_TARGET
                        Specify a PYTHON_SINGLE_TARGET
  --python-targets PYTHON_TARGETS
                        Specify a PYTHON_TARGETS
  --rm                  Remove container after session is done
  --storage-opt STORAGE_OPT [STORAGE_OPT ...]
                        Storage driver options for all volumes (same as Docker param)
  --with-X              Globally enable the X USE flag
  --with-vnc            Install VNC server to test graphical applications
  --profile PROFILE     The profile to use (default = default/linux/amd64/23.0)
  --features FEATURES [FEATURES ...]
                        Set FEATURES, see https://wiki.gentoo.org/wiki/FEATURES (default = ['-sandbox',
                        '-usersandbox', 'userfetch'])
  --docker-image DOCKER_IMAGE
                        Specify the docker image to use (default = gentoo/stage3)
  --docker-command DOCKER_COMMAND
                        Specify the docker command
  --pull                Download latest docker image
  --show-options        Show currently selected options and defaults
  --ccache CCACHE_DIR   Path to mount that contains ccache cache
  --batch               Do not drop into interactive shell

It is also possible to store default values in a toml configuration file at ~/.config/ebuildtester/config.toml. The next example shows all the configuration options that are currently available:

portage_dir = "/var/db/repos/gentoo"
overlay_dir = ["/var/db/repos/guru"]

features = ["sandbox", "usersandbox", "userfetch"]

install_basic_packages = false
docker_command = "docker"
unstable = true
update = true
batch = false
pull = true
rm = true

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ebuildtester-46.tar.gz (25.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ebuildtester-46-py2.py3-none-any.whl (13.6 kB view details)

Uploaded Python 2Python 3

File details

Details for the file ebuildtester-46.tar.gz.

File metadata

  • Download URL: ebuildtester-46.tar.gz
  • Upload date:
  • Size: 25.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for ebuildtester-46.tar.gz
Algorithm Hash digest
SHA256 5fe0813da95f4b4963a6fc4dd6b754c5ec7d524e4cfb089837aae38ac166dd4d
MD5 4d14e86c9ff70d5b1a0928529783d2a3
BLAKE2b-256 34c6636e809dd10cf1c0603ade652b0853d085b20f7570641a5a181788a4336c

See more details on using hashes here.

Provenance

The following attestation bundles were made for ebuildtester-46.tar.gz:

Publisher: publish.yaml on nicolasbock/ebuildtester

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ebuildtester-46-py2.py3-none-any.whl.

File metadata

  • Download URL: ebuildtester-46-py2.py3-none-any.whl
  • Upload date:
  • Size: 13.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for ebuildtester-46-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d1d0f33c8b685a4e5c2e0276c28f102982989f868bcf01f6225b60212bb19b27
MD5 588ab91903d68747917f7b64f2fd9cd6
BLAKE2b-256 e265b17762e8dcd59c21a72f8fe1a4272f59fac285cc224d4bec39cd53b1fa94

See more details on using hashes here.

Provenance

The following attestation bundles were made for ebuildtester-46-py2.py3-none-any.whl:

Publisher: publish.yaml on nicolasbock/ebuildtester

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page