Automate boot unit inclusion with architecture-aware Moderne analysis
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

- 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
This commit is contained in:
t3hn3rd committed 2026-11-07 21:49:06 +00:00
1 parent 7ed8012c7e
commit dd3bb1e016
20 files changed
+149 -121

No files matched your search

+12
View File
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
# Shared source-architecture selection; callers run from the repository root.
# Folder names: x86 = i386, x86_64 = x86_64.
export ASURO_ARCH="${ASURO_ARCH:-x86}"
if [[ ! "$ASURO_ARCH" =~ ^[a-z][a-z0-9_]*$ ]]; then
echo "Invalid ASURO_ARCH: $ASURO_ARCH" >&2
return 1
fi
if [[ ! -d "src/arch/$ASURO_ARCH" ]]; then
echo "Architecture sources not found: src/arch/$ASURO_ARCH" >&2
return 1
fi
+4 -3
View File
@@ -1,4 +1,6 @@
#!/usr/bin/env bash
TOOLCHAIN_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$TOOLCHAIN_DIR/architecture.sh" || exit 1
ERRCOUNT=0
echo " "
echo "======================="
@@ -20,14 +22,13 @@ runOrFail() {
fi
}
TOOLCHAIN_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
declare -a run_steps=(
"compile_stub.sh" "Failed to compile stub!"
"compile_vergen.sh" "Versions failed to compile"
"compile_lvgl.sh" "Failed to compile LVGL!"
"compile_icons.sh" "Failed to generate icons!"
"compile_wasuro.sh" "Failed to pull Wasuro!"
"compile_dangling.sh" "Failed to generate dangling unit list!"
"compile_sources.sh" "Failed to compile FPC Sources!"
"compile_initcalls.sh" "Failed to generate INITFINAL table!"
"compile_link.sh" "Failed linking!"
@@ -53,4 +54,4 @@ else
. "${TOOLCHAIN_DIR}/compile_finish.sh" "success"
fi
cd ..
cd ..
+26
View File
@@ -0,0 +1,26 @@
#!/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"
+14 -6
View File
@@ -1,13 +1,21 @@
#!/usr/bin/env bash
set -euo pipefail
source "$(dirname "${BASH_SOURCE[0]}")/architecture.sh"
echo " "
echo "======================="
echo " "
echo "Compiling FPC Sources..."
echo " "
# Build -Fu flags for all directories under src/, wasuro/ and compat/
FU_PATHS="-Fusrc -Fuwasuro -Fucompat"
for dir in $(find src wasuro compat -type d 2>/dev/null); do
FU_PATHS="$FU_PATHS -Fu$dir"
done
# Keep other architectures out of FPC's unit resolution, including arch/ itself.
FU_PATHS=()
while IFS= read -r -d '' dir; do
FU_PATHS+=("-Fu$dir")
done < <(find src wasuro compat -path src/arch -prune -o -type d -print0
find "src/arch/$ASURO_ARCH" -type d -print0)
fpc -Aelf -gw -g -gl -n -v0e -O3 -OpPENTIUM3 -Si -Sc -Sg -Xd -CX -XXs -CfSSE -CfSSE2 -Rintel -Pi386 -Tlinux -FElib/ $FU_PATHS src/asuro.pas
if [[ "$ASURO_ARCH" == "x86" ]]; then
fpc -Aelf -gw -g -gl -n -v0e -O3 -OpPENTIUM3 -Si -Sc -Sg -Xd -CX -XXs -CfSSE -CfSSE2 -Rintel -Pi386 -Tlinux -FElib/ "${FU_PATHS[@]}" src/asuro.pas
else
echo "No compiler found for target: $ASURO_ARCH" >&2
exit 1
fi