Commit 844faf7
committed
build-script: opt-in
Adds a top-level `linux-sysroot:` key to the package.yml schema that,
when set, redirects the compiler at a specific glibc bottle (instead
of using the build host's libc). This is the hermetic-build / host-
independent piece needed for the pantry to target manylinux baselines,
build on Alpine-musl hosts, and produce bottles that don't carry the
build runner's libc ABI assumptions.
YAML schema (top-level + scalar form):
linux-sysroot: gnu.org/glibc=~2.28
build:
dependencies:
gnu.org/glibc: ~2.28 # MUST also be a build dep
kernel.org/linux-headers: ^7 # auto-picked-up if present
When `linux-sysroot:` is set, the generated build script exports:
SYSROOT=<libc-install-prefix>
CC="${CC:-gcc} -nostdinc -isystem <libc>/include [-isystem <khdr>/include]
-B <libc>/lib -Wl,--enable-new-dtags,
--dynamic-linker=<libc>/lib/ld-linux-*.so.*,--rpath=<libc>/lib"
CXX="${CXX:-g++} <same> -nostdinc++"
CPP="${CPP:-gcc} <same> -E"
The libc package must already be a `build.dependencies` entry (so
it's installed and resolved); this directive merely routes existing
deps, it doesn't add them. kernel-headers is auto-detected from
build.dependencies — if `kernel.org/linux-headers` is among them,
its include dir is prepended.
No behaviour change for recipes that don't declare `linux-sysroot:`,
and no-op on non-linux hosts.
## Naming
Renamed from the original `build.sysroot.libc:` (nested) form per
@jhheider's review feedback on #343. Top-level +
`linux-`-prefixed makes the platform context explicit at read-time.
Did NOT go with "auto-detect from glibc dep presence" because some
recipes have glibc in their dep closure transitively but don't want
sysroot routing (e.g. Go binaries with cgo-disabled, kernel modules).
Explicit > implicit here.
## Refs
- #343 (this PR)
- pkgxdev/pantry#12968 (motivating use case: glibc cascade)
- #346 (Windows-port RFC — sibling pattern via bkwinvenv)linux-sysroot: directive in package.yml1 parent 47eb6dd commit 844faf7
1 file changed
Lines changed: 81 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
20 | 29 | | |
21 | 30 | | |
22 | 31 | | |
| |||
71 | 80 | | |
72 | 81 | | |
73 | 82 | | |
| 83 | + | |
74 | 84 | | |
75 | 85 | | |
76 | 86 | | |
| |||
82 | 92 | | |
83 | 93 | | |
84 | 94 | | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
85 | 166 | | |
86 | 167 | | |
87 | 168 | | |
| |||
0 commit comments