From 1c870c06ec437127d2169ce5f34799b6e51cd674 Mon Sep 17 00:00:00 2001 From: vasilito Date: Thu, 2 Jul 2026 14:22:34 +0300 Subject: [PATCH] kernel: add -Zunstable-options to cargo rustc for custom target cargo 1.98.0-dev (4d1f98451 2026-05-15) requires -Zunstable-options to be passed to cargo itself (not just rustc) to accept a custom target spec. Without it, the kernel Makefile fails with: error: error loading target specification: custom targets are unstable and require `-Zunstable-options` The Makefile already had -Z build-std, -Zbuild-std-features, and -Z json-target-spec (which are passed to rustc), but the top-level cargo invocation needed -Zunstable-options to accept the target. This is required by both nightly-2025-10-03 (the kernel fork rust-toolchain) and nightly-2026-04-01 (the host default). On the cookbook (redoxer-1.0 toolchain), the error is the same because -Zunstable-options is a separate cargo-level flag from the rustc-level -Z flags. Discovered when attempting to build redbear-mini after the 0.2.5 fork was created from 0.2.4. The Makefile worked on 0.2.4 because the prior kernel cook used a cached build; the 0.2.5 build started fresh and hit the error. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 1c658da303..24bff8a48c 100644 --- a/Makefile +++ b/Makefile @@ -31,7 +31,7 @@ TARGET_SPEC=$(RUST_TARGET_PATH)/$(ARCH)-unknown-kernel.json KERNEL_CARGO_FEATURES?= $(BUILD)/kernel.all: $(LD_SCRIPT) $(LOCKFILE) $(MANIFEST) $(TARGET_SPEC) $(shell find $(SOURCE) -name "*.rs" -type f) - cargo rustc \ + cargo -Zunstable-options rustc \ --bin kernel \ --manifest-path "$(MANIFEST)" \ --target "$(TARGET_SPEC)" \