From 3e334ae0aa178c59c06ad800f8f4d2360e93b3f2 Mon Sep 17 00:00:00 2001 From: sergio Date: Tue, 16 Jun 2026 07:22:58 -0400 Subject: [PATCH] =?UTF-8?q?selfhost-verify:=20run=5Frustc=20all=20COMPLETO?= =?UTF-8?q?=20=E2=80=94=20toolchain=20rust=20stage-3=20self-hosted=20(musl?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Con el stage0 musl-host, run_rustc all terminó: rustc stage-3 (host=musl, LLVM 20.1.8, 1.90.0-stable-mrustc) + cargo 1.90.0 + sysroot (294 rlibs) construidos y verificados corriendo. El muro de proc-macros quedó roto (tinystr/displaydoc/icu nativos). Dos snags finales arreglados (en run_rustc.patch, vs be69c74): - Makefile:262 (hello_world FINAL): mismos flags CRT que la 172 (--target + -C target-feature=-crt-static -C link-self-contained=no); solo aflora al completar stage-2/3. - Makefile:235 (cargo FINAL): --features vendored-openssl (openssl-sys no halla openssl del sistema en el devfs hermético; openssl-src lo compila desde fuente). README documenta ambos como snags #4 y #2(262). NEXT: climb 1.90 -> 1.91.0 -> 1.91.1. Co-Authored-By: Claude Opus 4.8 --- scripts/rust-frontier/README.md | 10 +++++++++- scripts/rust-frontier/run_rustc.patch | 11 ++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/scripts/rust-frontier/README.md b/scripts/rust-frontier/README.md index 54aebdce..936e2d3d 100644 --- a/scripts/rust-frontier/README.md +++ b/scripts/rust-frontier/README.md @@ -65,7 +65,15 @@ to bootstrap a usable rust there: can't be reassigned by the makefile, so the `-musl` suffix append is skipped and the build contaminates the gnu output dir. Let it default. -4. **minicargo OUT_DIR host/target split** (only when building the musl stage0's +4. **final cargo needs vendored OpenSSL.** The fully-bootstrapped `prefix/bin/cargo` + rule (Makefile:235) builds cargo with default features, so `openssl-sys` looks + for a system OpenSSL via pkg-config and fails (the hermetic musl devfs has none, + and no `openssl.pc`). Fix: add `--features vendored-openssl` to that cargo build + so `openssl-src` compiles OpenSSL from source — same approach the stage0 cargo + build uses. Real cargo (unlike minicargo) handles the OUT_DIR fine, so snag #4 + doesn't recur here. Only surfaces after the final hello_world (snag #2/262) passes. + +5. **minicargo OUT_DIR host/target split** (only when building the musl stage0's cargo). With `RUSTC_TARGET` set, minicargo runs each cargo build-script under `cargo-build/host/build_X/`, but the *target* crate's `include!` / `include_bytes!(concat!(env!("OUT_DIR"), "/.."))` resolves `OUT_DIR` to diff --git a/scripts/rust-frontier/run_rustc.patch b/scripts/rust-frontier/run_rustc.patch index 67e2d199..0c7f6bde 100644 --- a/scripts/rust-frontier/run_rustc.patch +++ b/scripts/rust-frontier/run_rustc.patch @@ -1,5 +1,5 @@ diff --git a/run_rustc/Makefile b/run_rustc/Makefile -index e78d8c5..00162a7 100644 +index e78d8c5..6acc615 100644 --- a/run_rustc/Makefile +++ b/run_rustc/Makefile @@ -108,7 +108,7 @@ CARGO_FLAGS := --target $(RUSTC_TARGET) -j $(PARLEVEL) --release --verbose @@ -29,6 +29,15 @@ index e78d8c5..00162a7 100644 # --- # Stage 2: Build a proper libstd (which includes dynamc libraries too) +@@ -232,7 +232,7 @@ endif + # + $(BINDIR)cargo: $(BINDIR)rustc + @echo [CARGO] $(RUST_SRC_RUSTC)Cargo.toml '>' $(OUTDIR)build-rustc/ +- $VTMPDIR=$(abspath $(PREFIX)tmp) $(CARGO_ENV_RUSTC) $(BINDIR_S)cargo build $(CARGO_FLAGS) --manifest-path $(RUST_SRC_CARGO)Cargo.toml ++ $VTMPDIR=$(abspath $(PREFIX)tmp) $(CARGO_ENV_RUSTC) $(BINDIR_S)cargo build $(CARGO_FLAGS) --features vendored-openssl --manifest-path $(RUST_SRC_CARGO)Cargo.toml + $Vcp $(CARGO_OUTDIR_RUSTC)cargo $(BINDIR)cargo + + @@ -259,7 +259,7 @@ endif $(BINDIR)hello_world: $(RUST_SRC_HELLO) $(BINDIR)rustc $(LIBDIR)libstd.rlib @mkdir -p $(dir $@)