Skip to content

RFC: pkgx.sh/bootstrap-tools — seed bottle to close pantry's bootstrap problem #12972

Description

@tannevaled

Status: RFC / proposal

Asks for buy-in on creating a new top-level package (pkgx.sh/bootstrap-tools) and a companion build-infra repo (pkgxdev/bootstrap-tools) that, together, would close the bootstrap problem for pantry's GNU toolchain (the chicken-and-egg of building old gcc when only modern gcc exists in dist.pkgx.dev).

This is companion-piece #4 to the structural improvements proposed in:

Items 1–3 are small additive changes. This proposal (#4) is larger structurally and warrants discussion before code.

The bootstrap problem we hit

In #12968 (gnu.org/glibc) and the companion older-toolchain PRs (#12966 binutils, #12967 gcc), we demonstrated that pantry CAN build the HPC range — glibc 2.17 (CentOS 7 / manylinux2014 baseline) through 2.43 (current) on both linux/x86-64 and linux/aarch64. The catch: each cascade step needs an older compiler than the one pkgx ships. We built it manually:

pkgx gcc 16 (existing dist.pkgx.dev)
  ↓ builds glibc 2.43
  ↓ builds gcc 9.5 (using gcc 16 + glibc 2.43 sysroot)
  ↓ builds binutils 2.32 (using gcc 9.5)
  ↓ builds gcc 7.5 (using gcc 9.5)
  ↓ builds binutils 2.28 (using gcc 7.5)
  ↓ builds glibc 2.24 + glibc 2.17 (using gcc 7.5 + binutils 2.28)

Each step takes 30–60 min. The full chain is multi-hours. Done once, the resulting bottles serve everyone, forever — but right now there's no place for them to live in dist.pkgx.dev and no way for brewkit CI to chain them.

Proposal

Two new artefacts:

1. pkgxdev/bootstrap-tools (new repo, build infrastructure)

A repo with:

  • A GitHub Actions workflow that builds a single "seed" tarball on a centos:7 (or equivalent) base image with naturally-old glibc 2.17 — call it the bootstrap origin
  • Output: bootstrap-tools-<version>-{linux+x86-64,linux+aarch64}.tar.xz published to GitHub Releases
  • Contents (statically linked or patchelf $ORIGIN-relocatable):
bootstrap-tools/v1.0.0/
├── bin/
│   ├── gcc, g++, gfortran      # gcc ~9.5
│   ├── ld, as, ar, ranlib, nm, objdump, strip, ...   # binutils ~2.32
│   ├── make, m4, awk, sed, grep, sort, ...
│   └── sh, bash, perl, python
├── lib/
│   ├── libc.so.6 ld-linux-*.so.*   # glibc 2.17 (manylinux2014 baseline)
│   ├── libstdc++.so.*, libgcc_s.so.*
│   └── ...
├── include/
└── relocate.sh   # post-extract patchelf to RPATH=$ORIGIN

Size estimate: ~80 MB compressed, ~250 MB uncompressed.

2. pkgx.sh/bootstrap-tools (pantry recipe)

A tiny recipe that downloads + extracts the tarball — NO compiler needed:

distributable:
  url: https://github.com/pkgxdev/bootstrap-tools/releases/download/v{{version}}/bootstrap-tools-{{version}}-{{hw.platform}}+{{hw.arch}}.tar.xz
  strip-components: 1

versions:
  github: pkgxdev/bootstrap-tools

platforms: linux

build:
  script:
    - cp -a . {{prefix}}/
    - {{prefix}}/relocate.sh "{{prefix}}"

test:
  - {{prefix}}/bin/gcc --version | grep -q "GCC"
  - {{prefix}}/bin/ld --version | grep -q "GNU"
  - {{prefix}}/lib/ld-linux-*.so.* --version

Usage by old-version recipes

The HPC cascade becomes expressible in pantry yml:

# Older glibc, e.g. gnu.org/glibc/v2.17.0
build:
  sysroot:
    libc: pkgx.sh/bootstrap-tools     # routes gcc at bootstrap's glibc 2.17
  dependencies:
    pkgx.sh/bootstrap-tools: '*'
    # gcc and binutils from bootstrap-tools' bin/, not the modern dist.pkgx.dev ones

Combined with #343's build.sysroot: directive, every recipe in the pantry could optionally target glibc 2.17 for manylinux2014 ABI baseline. Big leap toward Nix nixpkgs parity.

Why this needs maintainer buy-in (not just a PR)

  1. New top-level project namespace (pkgx.sh/...) — only pkgxdev should own that.
  2. Build infrastructure on centos:7 — needs a runner that can use that image, and a workflow that pushes Releases under pkgxdev/bootstrap-tools.
  3. One-time blessing of binary blobs — the bootstrap blob is binary, but it's GPL-compatible (gcc, glibc, binutils, coreutils, perl, python). Same legal/policy bar as nixpkgs' bootstrap-tools.
  4. Long-term commit — once recipes depend on it, the format becomes a stable API.

What we have if you want to start

I have working build scripts (from session 2026-05-19/20 in pkgm/notes/) that produce the cascaded gcc 7.5/9.5 + binutils 2.28 inside Docker containers. They could be the seed of pkgxdev/bootstrap-tools workflows. Happy to:

  • Open a starter repo with the GitHub Actions workflow that produces the tarball deterministically
  • Run it locally once to verify reproducibility cross-arch (linux/x86-64 + linux/aarch64)
  • Open the pkgx.sh/bootstrap-tools recipe PR alongside

…but only after this RFC has direction from a pkgxdev maintainer.

Smaller stepping-stone alternative

If the bootstrap-tools blob is too big a first step, an interim solution: publish only the cascaded gcc 7.5/9.5 + binutils 2.28 bottles built via #12967 + #12966 (when merged) to dist.pkgx.dev as normal pantry artefacts. Then a pantry recipe gnu.org/glibc=~2.17 could use build.sysroot: + those as deps. This skips the "blessed seed blob" entirely at the cost of a longer chain.

I have no strong preference between the two paths — both are improvements. Curious which the maintainers prefer.

Refs

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions