build: fix python312 COOKBOOK_TOOLCHAIN, switch userutils to local fork, preflight guards
- recipes/dev/python312/recipe.toml: use COOKBOOK_TOOLCHAIN for --with-build-python instead of /tmp/python312, which the build system never stages. Add [ -x ] guard for clear failure on missing dev-dep. - recipes/core/userutils/recipe.toml: switch from upstream git URL to local fork (local/sources/userutils/) per the local fork model. The upstream source opens /scheme/pty/ptmx which the ptyd scheme does not recognize; the local fork opens /scheme/pty correctly and avoids the getty PTY panic. - local/scripts/build-preflight.sh: warn when a recipe build script references /tmp/<known-package>/, since the cookbook does not stage host dev-deps under /tmp/<name>. Points authors at COOKBOOK_TOOLCHAIN. - local/scripts/build-redbear.sh: replace 'tail -1 || true' on pre-cook failures with proper error capture, last-50-lines tail on failure, and exit-1. Verify the pkgar exists after a successful cook.
This commit is contained in:
@@ -92,6 +92,11 @@ requested = resolve_config(config_path)
|
||||
for pkg in extra_packages:
|
||||
requested.setdefault(pkg, {})
|
||||
|
||||
known_package_paths = {
|
||||
name for name in lookup
|
||||
if not name.startswith("host:")
|
||||
}
|
||||
|
||||
errors = []
|
||||
warnings = []
|
||||
for package_name, package_conf in sorted(requested.items()):
|
||||
@@ -112,6 +117,19 @@ for package_name, package_conf in sorted(requested.items()):
|
||||
if not patch_path.exists():
|
||||
msg = f"missing patch file: {patch} for {recipe_toml.relative_to(project_root)}"
|
||||
(errors if strict_metadata else warnings).append(msg)
|
||||
build = recipe.get("build", {})
|
||||
script = build.get("script", "") if isinstance(build, dict) else ""
|
||||
if script:
|
||||
for dep in known_package_paths:
|
||||
bad = f"/tmp/{dep}/"
|
||||
if bad in script:
|
||||
msg = (
|
||||
f"recipe {recipe_toml.relative_to(project_root)} references {bad} "
|
||||
f"in its build script. The cookbook does not stage host dev-dependencies "
|
||||
f"under /tmp/<name>; use ${{COOKBOOK_TOOLCHAIN}} (the cross recipe's "
|
||||
f"toolchain directory populated from dev-dependencies) instead."
|
||||
)
|
||||
(errors if strict_metadata else warnings).append(msg)
|
||||
|
||||
for warning in warnings:
|
||||
print(f"WARN: {warning}", file=sys.stderr)
|
||||
|
||||
@@ -289,7 +289,14 @@ fi
|
||||
for pkg in $PRECOOK_PKGS; do
|
||||
if [ ! -f "$PROJECT_ROOT/repo/x86_64-unknown-redox/$pkg.pkgar" ]; then
|
||||
echo " cooking $pkg..."
|
||||
"$PROJECT_ROOT/target/release/repo" cook "$pkg" 2>&1 | tail -1 || true
|
||||
log=$(mktemp)
|
||||
if ! COOKBOOK_OFFLINE=false "$PROJECT_ROOT/target/release/repo" cook "$pkg" >"$log" 2>&1; then
|
||||
echo "WARNING: pre-cook of $pkg failed (non-fatal; will build during main phase). Tail of repo log:" >&2
|
||||
tail -50 "$log" >&2
|
||||
rm -f "$log"
|
||||
else
|
||||
rm -f "$log"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
[source]
|
||||
git = "https://gitlab.redox-os.org/redox-os/userutils.git"
|
||||
path = "../../../local/sources/userutils"
|
||||
upstream = "https://gitlab.redox-os.org/redox-os/userutils.git"
|
||||
patches = ["P5-redbear-branding.patch"]
|
||||
|
||||
[build]
|
||||
|
||||
@@ -29,12 +29,17 @@ ARCH="${TARGET%%-*}"
|
||||
OS=$(echo "${TARGET}" | cut -d - -f3-4)
|
||||
|
||||
if [ "$TARGET" != "$COOKBOOK_HOST_TARGET" ]; then
|
||||
BUILD_PYTHON="${COOKBOOK_TOOLCHAIN}/bin/python3.12"
|
||||
if [ ! -x "${BUILD_PYTHON}" ]; then
|
||||
echo "ERROR: host python312 dev-dependency not staged at ${BUILD_PYTHON}" >&2
|
||||
exit 1
|
||||
fi
|
||||
COOKBOOK_CONFIGURE_FLAGS=(
|
||||
--prefix=/usr
|
||||
--disable-ipv6
|
||||
--host=${GNU_TARGET}
|
||||
--build="$ARCH"
|
||||
--with-build-python="/tmp/python312/bin/python3.12"
|
||||
--with-build-python="${BUILD_PYTHON}"
|
||||
--with-ensurepip=install
|
||||
--disable-test-modules
|
||||
--with-ssl-default-suites=openssl
|
||||
|
||||
Reference in New Issue
Block a user