Giter Club home page Giter Club logo

xbstrap's Introduction

xbstrap: Build system for OS distributions

xbstrap is a build system designed to build "distributions" consisting of multiple (usually many) packages. It does not replace neither make and ninja nor autoconf, automake, meson or cmake and similar utilities. Instead, xbstrap is intended to invoke those build systems in the correct order, while respecting inter-package dependencies.

Official Discord server: https://discord.gg/7WB6Ur3

Installation

xbstrap is available from PyPI. To install it using pip, use:

pip3 install xbstrap

Basic usage

See the boostrap-managarm repository for an example bootstrap.yml file.

Installing all tools (that run on the build system) is done using:

xbstrap install-tool --all

Installing all packages to a sysroot (of the host system):

xbstrap install --all

It is often useful to rebuild specific packages. Rebuilding package foobar can be done by:

xbstrap install --rebuild foobar

If the configure script shall be run again, use instead:

xbstrap install --reconfigure foobar

Local development

When developing xbstrap, you must install your local copy instead of the one provided by the pip repositories. To do this, run:

pip install --user -e .

Development with Docker

For containerized builds, most xbstrap commands will run in two stages: once on the host, then again on the container to actually execute the build steps. Therefore, installing xbstrap locally (as shown above) is not sufficient in this case.

In addition, you must change your Dockerfile so that instead of grabbing xbstrap from the pip repositories, it installs from the host:

  1. Add the following lines (replace /local-xbstrap at your convenience):
ADD xbstrap /local-xbstrap
RUN pip3 install -e /local-xbstrap
  1. Copy or symlink your local xbstrap into the same folder that contains the Dockerfile, so that it can be accessed by the previous step.
  2. Rebuild the docker container as usual.

Enabling the pre-commit hook for linting (optional)

To avoid running into the CI complaining about formatting, linting can be done in a pre-commit hook. To enable this, run:

git config core.hooksPath .githooks

xbstrap's People

Contributors

48cf avatar 64 avatar arsenarsen avatar avdgrinten avatar dchapiesky avatar dennisbonke avatar no92 avatar qookei avatar

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

xbstrap's Issues

Allow commits to be fixed

Allow bootstrap-commits.yml to fix the commits of packages that would otherwise build from branches.

Add stability_level property to tools/packages

Allow bootstrap.yml to indicate stability levels from the set: stable, unstable, broken. Do not build broken packages in xbstrap-pipeline. Do not care about the success of unstable packages.

Add maintainer tool for bumping packages

It would be convenient to have a tool to bump packages, e.g. when bumping the world on ABI breaks. Implementing this by rewriting the YML would be hard, so I'd suggest making the revision field required and grepping for that.

Unify tool and package builds

Currently, there is an asymmetry between tool and package builds. Tools have an additional ìnstallspecification inbootstrap.ymland do not use the collection mechanism. Furthermore, there is an unintuitive difference in names:compile-toolfor tools vs.build` for packages. Fix this.

--recursive updates are not useful

--recursive currently checks for updates along edges of the dependency graph. It also tries to redo all steps that can reach these updates. However, this strategy is overly broad: for example, it tends to rebuild toolchains that depend on some package that was changed (e.g., a libc).

It would be more useful if --recursive only redid steps that reach the updates by build edges (but the check for updates should still follow all edges).

no __main__ module

Currently theres no __main__ module installed during pip install xbstrap. this prevents xbstrap being run via python -m xbstrap.

Add command to rebuild stale packages

Add a command that rebuilds packages after repositories or dependencies have been updated. Proposed name: xbstrap remake and xbstrap remake --recursive (to also rebuild if dependencies have changed).

Similarly, add xbstrap remake --reverse to update all reverse dependencies of a package.

xbstrap doesn't work on Nix OS

Due to the lack of /bin/bash xbstrap doesn't work on Nix OS when recipes shell out. References to /bin/bash should be replaced with /usr/bin/env bash.

Directory not created on download

When running xbstrap download --all and the packages directory is not created it errors about that, it should probably create it itself

determine_rolling_id() does not consider fixed commits

determine_rolling_id() does not consider commits that have been fixed by commit: properties or by bootstrap-commits.yml entries; this can yield false positive Rolling ID of package X does not match true rolling ID errors.

Add versioning based on VCS information

some packages will need to generate their version dynamically, based on information from git repositories, one of these packages is managarm-system, another is mlibc

naturally, this state of things should be considered temporary, and proper versioning should be introduced into mlibc and managarm, in the meanwhile however, arch (for once) has a decent solution: https://wiki.archlinux.org/index.php/VCS_package_guidelines#The_pkgver()_function and specifically

pkgver() {
  cd "$pkgname"
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

this is of high priority: tonigts CI run will be largely futile without it

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.