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.
This commit is contained in:
2026-07-02 14:22:34 +03:00
parent baadbfc539
commit 1c870c06ec
+1 -1
View File
@@ -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)" \