pkgx Pantry

repository·main·Indexed 41 days ago

https://github.com/pkgxdev/pantry

A collection of host-independent, relocatable glibc 'bottles' built using a strictly controlled toolchain via pkgx to ensure maximum portability across different Linux distributions. Includes documentation and setup guides for various integrated projects such as Apache ZooKeeper, Conda, Colima, llama.cpp, and TamaGo.

Tokens
9.5K
Snippets
64
Records
79
Agent score
49%

What's inside Pantry

  1. Overview of TamaGo bare-metal Go toolchain

    main

    TamaGo is a Go distribution designed for bare-metal execution (no operating system). It provides the GOOS=tamago target, allowing developers to write pure-Go, cgo-free firmware and unikernels.

    Key characteristics:

    • Targeting: Supports amd64 (Cloud Hypervisor, Firecracker, QEMU, UEFI, GCE), arm/arm64 (NXP i.MX, Raspberry Pi), and riscv64.
    • Toolchain Access: Unlike the upstream tamago CLI which fetches toolchains at runtime, this package provides the toolchain directly via pkgx for immediate use.
    • Integration: Works with the tamago framework for SoC drivers and board packages.
  2. Overview of gnu.org/glibc host-independent builds

    main
    The glibc project provides glibc packaged as relocatable bottles. Each bottle includes its own ld-linux*.so and libc.so.6. To ensure host independence and prevent the build host's environment from leaking into the result, the build process consumes only pkgx-supplied tools.
  3. Overview of Nex lexer

    main

    Nex is a lexer similar to Lex/Flex designed for the Go ecosystem. Unlike traditional Lex/Flex which generates C code, Nex generates Go code and integrates directly with Go's yacc implementation.

    Key features include:

    • Go-native generation: Produces Go code instead of C.
    • Yacc integration: Works with Go's built-in yacc.
    • UTF-8 support: Full support for UTF-8 character encoding.
    • Advanced Regex: Supports nested structural regular expressions.
  4. Overview of rbw

    main
    rbw is an unofficial command-line client for Bitwarden. Unlike the standard stateless Bitwarden CLI—which requires manual locking/unlocking and passing temporary keys via environment variables—rbw uses a background agent to maintain state. This agent holds keys in memory (similar to ssh-agent or gpg-agent), allowing for a much simpler and more seamless user experience where the background process manages the necessary authentication state.
  5. Understand glibc version compatibility and build constraints

    main

    The current pkgx toolchain (gcc 16.1, binutils 2.46, linux-headers 7.0.9) supports a specific range of glibc versions for host-independent builds.

    Supported Range

    • 2.27 → 2.43: Fully supported. This covers RHEL 8+, manylinux_2_28+, and modern Debian/Ubuntu/Alpine LTS hosts.

    Unsupported/Problematic Versions

    • glibc 2.17 (manylinux2014 / CentOS 7): Fails because gcc 16 no longer supports the -traditional / strict-C89 mode required by older configure scripts, and /lib/cpp is not symlinked in modern slim images.
    • glibc 2.24 (manylinux_2_24 / Debian 9): Fails because sunrpc/rpcgen requires the host's stdio.h, which is blocked by the recipe's -nostdinc regime.
    • glibc 2.19–2.26 on aarch64: Fails with dangerous relocation: unsupported relocation when using binutils ≥ 2.40 due to GOT overflow issues.
  6. How pip3.x packages behave in the pantry

    main

    The pantry provides various pip3.x versions. When invoked, these packages are designed to automatically call pip using the specific Python version they are associated with.

    Environment Priority: If a pkgx Python instance is already present in your current environment, the system will prioritize and use that existing Python instead of the one bundled with the pip3.x package.

  7. How the HPC bootstrap cascade works

    main

    For older manylinux baselines (glibc 2.17 and 2.24) that require older compilers than those currently in dist.pkgx.dev, a bootstrap cascade is used. This process builds vintage toolchain bottles using only modern pkgx-supplied tools as the foundation.

    The Cascade Logic (linux/aarch64):

    1. Base: Use pkgx gcc 16 + pkgx binutils 2.46 to build a modern glibc 2.43 bottle.
    2. Intermediate GCC: Build gcc 9.5 using the glibc 2.43 bottle as a sysroot (with --disable-bootstrap, --disable-lto, and --disable-plugin).
    3. Intermediate Binutils: Build binutils 2.30/31/32 using gcc 9.5.
    4. Vintage GCC: Build gcc 7.5 using gcc 9.5 (using custom specs to force the --dynamic-linker and baking LDFLAGS=-Wl,-rpath for dependencies).
    5. Vintage Binutils: Build binutils 2.28 using gcc 7.5.
    6. Target Glibc: Build glibc 2.24 and glibc 2.17 using gcc 7.5 and binutils 2.28.
  8. Implement the Bottle-as-sysroot technique for host-independent builds

    main

    To build packages host-independently using pkgx, you must ensure the compiler finds the correct libc instead of the host's /usr/lib. The Bottle-as-sysroot technique routes gcc to a specific glibc bottle using SYSROOT_FLAGS. This pattern is essential for any non-glibc Linux package to achieve true host independence.

    Use the following flag configuration when invoking CC and CPP during the ./configure step:

    SYSROOT_FLAGS="
      -nostdinc
      -isystem $GLIBC_BOTTLE/include
      -isystem $KERNEL_HEADERS/include
      -isystem $GCC_BOTTLE/lib/gcc/$TRIPLE/$GCC_V/include
      -B $GLIBC_BOTTLE/lib
      -Wl,--dynamic-linker=$GLIBC_BOTTLE/lib/ld-linux-<arch>.so.<n>
      -Wl,--rpath=$GLIBC_BOTTLE/lib
    "
    CC="gcc $SYSROOT_FLAGS" CPP="gcc $SYSROOT_FLAGS -E" \
      ./configure ...