{"id":15050824,"url":"https://github.com/debian/ratt","last_synced_at":"2025-10-19T23:31:16.047Z","repository":{"id":36503073,"uuid":"40808748","full_name":"Debian/ratt","owner":"Debian","description":"Rebuild All The Things!","archived":false,"fork":false,"pushed_at":"2022-08-05T09:02:56.000Z","size":56,"stargazers_count":33,"open_issues_count":5,"forks_count":15,"subscribers_count":41,"default_branch":"master","last_synced_at":"2025-01-30T08:43:06.591Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Debian.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-08-16T09:52:38.000Z","updated_at":"2024-09-20T02:03:49.000Z","dependencies_parsed_at":"2022-09-06T16:40:16.037Z","dependency_job_id":null,"html_url":"https://github.com/Debian/ratt","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Debian%2Fratt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Debian%2Fratt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Debian%2Fratt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Debian%2Fratt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Debian","download_url":"https://codeload.github.com/Debian/ratt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237228644,"owners_count":19275733,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-24T21:29:27.270Z","updated_at":"2025-10-19T23:31:16.041Z","avatar_url":"https://github.com/Debian.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Description\n\nratt (“Rebuild All The Things!”) operates on a Debian .changes file of a just-built package, identifies all reverse-build-dependencies and rebuilds them with the .debs from the .changes file.\n\nThe intended use-case is, for example, to package a new snapshot of a Go library and verify that the new version does not break any other Go libraries/binaries.\n\n# Installation (from git, for hacking on ratt)\n\nPlease install ratt from Debian. In case you want to hack on ratt, you can use the following commands to install Go, download ratt from git and compile/install it:\n\n```bash\nsudo apt-get install golang-go\ngit clone https://github.com/Debian/ratt\ncd ratt\ngo install\n```\n\nStart the resulting binary in `~/go/bin/ratt`:\n\n```bash\n~/go/bin/ratt -help\n```\n\nAfter making changes to the code, to recompile and install it again, use:\n\n```bash\ngo install\n```\n\n# Usage\n\nLet’s assume you build a new version of a Go library, like so:\n\n```bash\ndebcheckout golang-github-jacobsa-gcloud-dev\ncd golang-github-jacobsa-gcloud-dev\ndch -i -m 'dummy new version'\ngit commit -a -m 'dummy new version'\ngbp buildpackage --git-pbuilder  \n```\n\nNow you can use ratt to identify and rebuild all reverse-build-dependencies:\n```\n$ ratt golang-github-jacobsa-gcloud_0.0\\~git20150709-2_amd64.changes         \n2015/08/16 11:48:41 Loading changes file \"golang-github-jacobsa-gcloud_0.0~git20150709-2_amd64.changes\"\n2015/08/16 11:48:41  - 1 binary packages: golang-github-jacobsa-gcloud-dev\n2015/08/16 11:48:41  - corresponding .debs (will be injected when building):\n2015/08/16 11:48:41     golang-github-jacobsa-gcloud-dev_0.0~git20150709-2_all.deb\n2015/08/16 11:48:41 Loading sources index \"/var/lib/apt/lists/ftp.ch.debian.org_debian_dists_sid_contrib_source_Sources\"\n2015/08/16 11:48:41 Loading sources index \"/var/lib/apt/lists/ftp.ch.debian.org_debian_dists_sid_main_source_Sources\"\n2015/08/16 11:48:43 Loading sources index \"/var/lib/apt/lists/ftp.ch.debian.org_debian_dists_sid_non-free_source_Sources\"\n2015/08/16 11:48:43 Building golang-github-jacobsa-ratelimit_0.0~git20150723.0.2ca5e0c-1 (commandline: [sbuild --arch-all --dist=sid --nolog golang-github-jacobsa-ratelimit_0.0~git20150723.0.2ca5e0c-1 --extra-package=golang-github-jacobsa-gcloud-dev_0.0~git20150709-2_all.deb])\n2015/08/16 11:49:19 Build results:\n2015/08/16 11:49:19 PASSED: golang-github-jacobsa-ratelimit_0.0~git20150723.0.2ca5e0c-1\n```\n\nratt uses `sbuild(1)` to build packages, see https://wiki.debian.org/sbuild for instructions on how to set up sbuild. Be sure to add `--components=main,contrib,non-free` to the sbuild-createchroot line in case you want to deal with packages outside of main as well.\n\n# Targeting a different suite\n\nImagine you’re running Debian stable on your machine, but you’re working on a package for Debian unstable (“sid”). Unless you already have configured a corresponding `sources.list` entry for sid, you will encounter an error message like this:\n\n```\n$ ratt golang-google-grpc_1.11.0-1_amd64.changes\n2019/01/19 10:44:34 Loading changes file \"golang-google-grpc_1.11.0-1_amd64.changes\"\n2019/01/19 10:44:34  - 1 binary packages: golang-google-grpc-dev\n2019/01/19 10:44:34 Corresponding .debs (will be injected when building):\n2019/01/19 10:44:34     golang-google-grpc-dev_1.11.0-1_all.deb\n2019/01/19 10:44:34 Setting -dist=sid (from .changes file)\n2019/01/19 10:44:34 Could not find InRelease file for sid . Are you missing sid in your /etc/apt/sources.list?\n```\n\nThe most direct solution is to add sid to your `/etc/apt/sources.list` file, then set `Default-Release` to stable, so that apt prefers the same packages as before your addition:\n\n```\n# echo 'deb http://deb.debian.org/debian sid main' \u003e\u003e /etc/apt/sources.list\n# echo 'deb-src http://deb.debian.org/debian sid main' \u003e\u003e /etc/apt/sources.list\n# echo 'APT::Default-Release \"stable\";' \u003e\u003e /etc/apt/apt.conf\n# apt update\n$ ratt ...\n```\n\nAn alternative solution is to use `chdist(1)`, a tool that allows to create and maintain different apt trees for different suites. Assuming that you have a sid distribution ready in your `~/.chdist`, you can then use it by setting the environment variable `APT_CONFIG`:\n\n```\nAPT_CONFIG=~/.chdist/sid/etc/apt/apt.conf ratt ...\n```\n\n# Restricting the set of packages that will be built\n\nIn some cases there are many build dependencies; to focus on a smaller set of packages, invoke ratt with the `-include` / `-exclude` options.\n\nTo only build selected packages, use:\n\n```\nratt -recheck -include '^(hwloc|fltk1.3|wcslib|ccfits|qevercloud|libstxxl|caffe|frobby|starpu)$' ../doxygen_1.8.17-1_amd64.changes\n```\n\nTo exclude certain packages (for example those with longer build times):\n\n```\nratt -recheck -exclude '^(gcc-9|gcc-8|llvm-toolchain-10|libreoffice|trilinos|llvm-toolchain-9|llvm-toolchain-8|llvm-toolchain-7|gcc-snapshot|gcc-10|deal.ii|kodi|vg|qgis|openms|siconos|ball|gtg-trace|libsbml|dcmtk|gromacs|gudhi|kicad|libpwiz)$' ../doxygen_1.8.17-1_amd64.changes\n```\n\n**Note**: you need to escape the `+` sign in package names as in `dbus-c\\+\\+` to avoid messing up the regexp expression.\n\n\n# Using `-chdist` to target multiple Debian suites\n\nInstead of modifying your system-wide `/etc/apt/sources.list`, you can use\n`chdist` to simulate isolated APT environments per suite.\n\n1. Create a named distribution profile:\n\n    ```\n    chdist create \u003cDIST\u003e \u003cURL\u003e \u003cRELEASE\u003e \u003cSECTIONS\u003e\n    ```\n\n    A common example:\n\n    ```\n    chdist create bookworm http://deb.debian.org/debian bookworm main\n    ```\n\n    This creates a chdist environment named unstable.\n\n2. Update the APT metadata\n\n    After creating the distribution, update it:\n\n    ```\n    chdist bookworm apt-get update\n    ```\n\n    This step is mandatory, it downloads the package index files (*_Sources,\n    *_Packages, etc.) that ratt will later use\n\n3. Run ratt with the `-chdist` option\n\n    Once the chdist environment is set up and updated, you can run ratt with the\n    `-chdist` flag pointing to the name of the distribution:\n\n    ```\n    ratt -chdist bookworm yourpackage_*.changes\n    ```\n\n    This will use the index files from the chdist environment located at\n    `~/.chdist/bookworm`, instead of the host system's APT config.\n\n    **Note**: The name passed to `-chdist` refers to the profile created via `chdist\n    create`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdebian%2Fratt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdebian%2Fratt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdebian%2Fratt/lists"}