Files
Asuro/toolchain/compile_dangling.sh
t3hn3rd dd3bb1e016
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
Automate boot unit inclusion with architecture-aware Moderne analysis
- Replace boot.mgr's static unit list with generated dangling_units.inc
- Generate Pascal LSTs and run the dangling-unit recipe before compilation
- Exclude Wasuro, inactive architectures, and NOT_DANGLING units
- Add ASURO_ARCH selection with an x86 default
- Mark unfinished legacy units as NOT_DANGLING
- Inherit pinned Moderne tooling in the builder image
- Ensure Drone pulls the latest builder image
- Document the updated build pipeline in MkDocs

Validation:
- Full x86 ISO build and VirtualBox boot succeeded
- 1,133 kernel tests passed with no failures
- x86_64 build failed clearly due to unavailable sources
2026-11-07 21:49:06 +00:00

27 lines
1.1 KiB
Bash

#!/usr/bin/env bash
set -euo pipefail
echo "Generating dangling Pascal units..."
TOOLCHAIN_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "${TOOLCHAIN_DIR}/.."
source "$TOOLCHAIN_DIR/architecture.sh"
OUT="$(pwd)/src/boot/dangling_units.inc"
# Remove stale output before attempting analysis. Work in a separate temporary
# repository so developer Moderne runs and generated sources cannot contaminate it.
rm -f "$OUT"
WORK="$(mktemp -d)"
trap 'rm -rf "$WORK"' EXIT
mkdir -p "$WORK/src" "$WORK/compat"
cp -a src/. "$WORK/src/"
cp -a compat/. "$WORK/compat/"
# Do not parse inactive architectures: incomplete ports must not break this build.
for dir in "$WORK/src/arch/"*; do
[[ "$(basename "$dir")" == "$ASURO_ARCH" ]] || rm -rf "$dir"
done
git -C "$WORK" init -q
git -C "$WORK" remote add origin https://gitea.spexeah.com/Spexeah/Asuro.git
PASCAL_JAVA_OPTIONS='-Dpascal.sourceRoots=src,compat -Dpascal.failOnParseError=true' pascal-lst "$WORK"
mod run "$WORK" --recipe org.openrewrite.pascal.boot.FindDanglingUnits \
--recipe-option "architecture=$ASURO_ARCH"
dangling-include "$WORK" "$OUT"