← Back to Pull requests

Makefile: Fix cross-bootstrapped build issues #64371

Closed
unknown closed this pull request without merging on Nov 07, 2026 03:30 UTC
View on GitHub
unknown unknown commented on Oct 27, 2026 07:38 UTC
Author

Fixes #64241

Assisted-by: Kimi Code (Kimi)

Fixes

1. Fix cross-bootstrap builds of julia-sysimg-debug using a release julia binary and the sysbase image.
2. Fix cross-bootstrap builds when sys and sysbase are in different directories.

Improvements

1. Support full debug cross-bootstrap builds using a release julia binary and the sysbase image.
2. Remove SHLIB_EXT from the CROSS_BOOTSTRAP_SYSBASE path. (@xal-0, does this look right to you?)
3. Update the documentation.
4. Update comments.

Testing

I tested these changes on the following platforms:

1. Debian 13 (6.12.133-1 x86_64 GNU/Linux)
2. macOS on Apple M2 (Darwin Kernel Version 24.5.0)
3. Windows 10 (MINGW64_NT-10.0-19045 x86_64 Msys)

Test case 0 (Linux only)

contrib/tsan/build.sh -j"$(nproc)" julia-tsan-build

Test case 1

Tested with the following julia-debugbuild.sh:

#!/bin/bash
set -euo pipefail

SRC=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
BUILD="$SRC/julia-build"
CBUILD="$SRC/julia-release-build"

JOBS="$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 4)"

make O="$CBUILD" -j"$JOBS" julia-sysbase-release

make O="$BUILD" -j"$JOBS" debug \
    CROSS_BOOTSTRAP_JULIA="$CBUILD/usr/bin/julia" \
    CROSS_BOOTSTRAP_SYSBASE="$CBUILD/usr/lib/julia/sysbase"

Implementation notes

1. Using julia-debugbuild.sh as an example, julia-sysimg-debug should be built with $CBUILD/usr/bin/julia and $CBUILD/usr/lib/julia/sysbase. The generated image should be placed in $BUILD/usr/lib/julia/ and linked against the julia-debug and julia-internal runtime libraries. To support this, I modified the definition of julia_exepath in contrib/generate_precompile.jl, added parameters to link_image and link_image_cmd in base/linking.jl, and introduced the JULIA_BINDIR environment variable in the sysimage.mk build.
2. The original CROSS_BOOTSTRAP implementation in #59033 and #59035 only supported builds up to the sysimg stage. A full build would either fail if CROSS_BOOTSTRAP_JULIA and CROSS_BOOTSTRAP_SYSBASE were provided or rebuild everything from scratch without them. Therefore, I used the cross_bootstrap_julia configuration to ensure that CROSS_BOOTSTRAP_JULIA and CROSS_BOOTSTRAP_SYSBASE take effect only during the sysimg build stage.
3. In Test case 0 , a Julia binary without TSan is used to build a TSan-enabled sysimg. The generated image has unresolved TSan symbols because those symbols are provided by the startup executable, so linking with -z defs fails. Therefore, I removed -z defs for TSan builds and added the missing bootstrap_julia_flags to sysimg.mk.
4. I found that adding override USECCACHE=1 to Make.user causes contrib/tsan/build.sh in Test case 0 to fail because overrides CC and CXX failed with ccache. ~~Therefore, I added override USECCACHE=0 to contrib/tsan/Make.user.tsan~~.
5. CROSS_BOOTSTRAP_SYSBASE omits the file extension for consistency with CROSS_BOOTSTRAP_JULIA and to make the documentation and scripts more portable across platforms.

Diff: 396 lines (+297 / -99) across 4 files Reviewer: topolarity Review duration: 15592m
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.43) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.43 · 396 lines diff across 4 files
0.43
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.358
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #64371"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 43.2% (MEDIUM) · Higher = larger blast radius
43.2%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 17.1% · Safe to merge
17.1%