diff --git a/local/recipes/libs/glib/redox.patch b/local/recipes/libs/glib/redox.patch index a006af0e6c..868bb3a0cc 100644 --- a/local/recipes/libs/glib/redox.patch +++ b/local/recipes/libs/glib/redox.patch @@ -27,7 +27,7 @@ #endif +#if defined(__redox__) -+#undef AT_FDCWD ++/* relibc now provides faccessat()/AT_FDCWD from ; keep it defined */ +#endif + #ifndef O_BINARY diff --git a/local/recipes/libs/mesa/recipe.toml b/local/recipes/libs/mesa/recipe.toml index e64712877d..5e17de1365 100644 --- a/local/recipes/libs/mesa/recipe.toml +++ b/local/recipes/libs/mesa/recipe.toml @@ -79,7 +79,6 @@ cookbook_meson \ -Dglx=disabled \ -Dgallium-drivers=softpipe,llvmpipe,virgl,crocus,iris \ -Dllvm=enabled \ - -Dosmesa=true \ -Dplatforms=wayland \ -Degl-native-platform=surfaceless \ -Dshader-cache=disabled \ @@ -91,5 +90,9 @@ cookbook_meson \ # Hack to add LLVM libs, the list can be seen from meson log and check for matches $("${LLVM_CONFIG}" --libs) LLVMLIBS="-lLLVMBitReader -lLLVMCore -lLLVMExecutionEngine -lLLVMInstCombine -lLLVMMCDisassembler" LLVMLIBS+=" -lLLVMMCJIT -lLLVMScalarOpts -lLLVMTransformUtils -lLLVMCoroutines -lLLVMLTO" -sed -i "s/ -lOSMesa / -lOSMesa ${LLVMLIBS} -lstdc++ /" "${COOKBOOK_STAGE}/usr/lib/pkgconfig/osmesa.pc" +# osmesa is no longer built (the -Dosmesa meson option was dropped upstream); only +# patch its pkg-config file if it exists. +if [ -f "${COOKBOOK_STAGE}/usr/lib/pkgconfig/osmesa.pc" ]; then + sed -i "s/ -lOSMesa / -lOSMesa ${LLVMLIBS} -lstdc++ /" "${COOKBOOK_STAGE}/usr/lib/pkgconfig/osmesa.pc" +fi """ diff --git a/local/scripts/build-redbear.sh b/local/scripts/build-redbear.sh index fcba1fa792..ef1cdf3662 100755 --- a/local/scripts/build-redbear.sh +++ b/local/scripts/build-redbear.sh @@ -623,6 +623,34 @@ if [ "$NO_CACHE" != "1" ]; then fi done + # Shared forks not covered by the pkgar loop above. userutils ships a pkgar + # (login/getty/etc); syscall/libredox/redox-scheme are Cargo path-dep crates + # with NO pkgar of their own but are linked into most of userspace, so + # cookbook's per-recipe cache cannot detect a change in them. Detect a source + # change and force a full userspace relink to prevent stale-binary skew. + for src in userutils syscall libredox redox-scheme; do + src_dir="$PROJECT_ROOT/local/sources/$src" + fingerprint="$PROJECT_ROOT/repo/x86_64-unknown-redox/$src.source-fingerprint" + [ -d "$src_dir/.git" ] || continue + src_commit=$(git -C "$src_dir" rev-parse HEAD 2>/dev/null || echo "") + last_commit=$(cat "$fingerprint" 2>/dev/null || echo "") + src_dirty=0 + if ! git -C "$src_dir" diff --quiet HEAD 2>/dev/null \ + || ! git -C "$src_dir" diff --cached --quiet HEAD 2>/dev/null \ + || [ -n "$(git -C "$src_dir" ls-files --others --exclude-standard 2>/dev/null)" ]; then + src_dirty=1 + fi + # Only act when a prior fingerprint exists (skip the first build, which + # cooks everything anyway). + if [ -n "$last_commit" ] && { [ "$src_commit" != "$last_commit" ] || [ "$src_dirty" = "1" ]; }; then + echo ">>> Stale shared fork $src detected; forcing full userspace relink (correctness)..." + STALE_DETECTED=1 + USERSPACE_RUNTIME_STALE=1 + [ "$src" = "userutils" ] && rm -f "$PROJECT_ROOT/repo/x86_64-unknown-redox/userutils".* + fi + done + + if [ "$USERSPACE_RUNTIME_STALE" = "1" ]; then echo ">>> Cleaning stale build/sysroot dirs (userspace-linked runtime changed)..." find "$PROJECT_ROOT/recipes" "$PROJECT_ROOT/local/recipes" \ @@ -867,7 +895,7 @@ for pkg in $PRECOOK_PKGS; do fi done -for src in relibc kernel base bootloader installer; do +for src in relibc kernel base bootloader installer userutils syscall libredox redox-scheme; do src_dir="$PROJECT_ROOT/local/sources/$src" if [ -d "$src_dir/.git" ]; then git -C "$src_dir" rev-parse HEAD 2>/dev/null > \