Summary
On a clean clone against the toolchain the repo itself pins
(rust-toolchain.toml -> channel = "stable", rust-version = "1.95"),
cargo check --workspace fails for me. Two dependencies of the Type-1
(hv1-*) crates require nightly and abort the check on a stable x86_64 host.
The rest of the workspace (all hv2-* crates plus hm-cli/hm-gui) compiles
cleanly once these two are addressed.
Environment
rustc 1.95.0 stable, cargo 1.95.0 (matches rust-toolchain.toml and the
workspace rust-version = "1.95")
- Host:
x86_64 Linux
protoc 35.1 present (so the hv2-api build is not the blocker)
- Current
master (Cargo.lock: x86_64 v0.15.4, bootloader v0.11.15)
Reproduction
$ cargo check --workspace --all-targets
Fails with exit code 101. A minimal single-crate check reproduces the primary
blocker on its own:
$ cargo check -p hv1-core
Root cause 1: x86_64 = "0.15" enables the nightly abi_x86_interrupt gate
crates/hv1-core/Cargo.toml (and crates/hv1-boot/Cargo.toml) depend on
x86_64 = "0.15" with default features. In x86_64 0.15.4,
default = ["nightly", "instructions"] and nightly pulls in
abi_x86_interrupt, which activates a nightly-only feature gate:
error[E0554]: `#![feature]` may not be used on the stable release channel
--> x86_64-0.15.4/src/lib.rs:5
5 | #![cfg_attr(feature = "abi_x86_interrupt", feature(abi_x86_interrupt))]
error: could not compile `x86_64` (lib) due to 1 previous error
This hits the library build of hv1-core, so plain cargo check --workspace (not just --all-targets) fails. The x86_64 dependency is
target-gated to cfg(target_arch = "x86_64"), which does not help on an
x86_64 host: the gate is true, so the nightly-requiring dependency is pulled
in as normal.
Root cause 2: bootloader v0.11 build script uses nightly-only -Z flags
crates/hv1-boot has bootloader = "0.11" as a build-dependency. Its build
script invokes cargo with -Z flags, which stable cargo rejects:
error: failed to run custom build command for `bootloader v0.11.15`
error: the `-Z` flag is only accepted on the nightly channel of Cargo, but
this is the `stable` channel
This surfaces when --all-targets pulls in the hv1-boot bootable-image
target. Building an actual boot image is inherently a nightly task, so this
one is arguably by design; see the suggestion below.
Impact
- A plain workspace check against the pinned toolchain does not succeed out of
the box. New contributors following the repo's own toolchain hit a hard
error on first cargo check.
- Any stable CI job that runs a full
cargo check --workspace on x86_64 would
hit the same failure (target-gating does not skip the dep on an x86_64
host).
Suggested minimal fix
Drop the x86_64 crate's nightly default feature and keep instructions (the
CPU-intrinsics / MSR-access feature the hv1 call sites I checked appear to
need; if you rely on the abi_x86_interrupt interrupt-handler surface
elsewhere you will want to keep that feature too):
# crates/hv1-core/Cargo.toml and crates/hv1-boot/Cargo.toml
- x86_64 = "0.15"
+ x86_64 = { version = "0.15", default-features = false, features = ["instructions"] }
For hv1-boot, since it is a genuinely nightly bootable-image crate, the
cleanest option is to keep it out of the default stable workspace build rather
than force it onto stable. Options, in order of least surprise (maintainers'
call):
- Document
cargo +nightly build -p hv1-boot and exclude it from the stable
cargo check --workspace lane in CI, or
- Move
hv1-boot to exclude = [...] in the workspace with a
# nightly-only bootimage note, or
- Keep it a member but add a nightly CI job for it specifically.
Minor: crates/hv1-boot/Cargo.toml carries edition = "2024" # Requires nightly Rust. Edition 2024 has been stable since Rust 1.85, so that comment
is a bit out of date; the real nightly requirement here is the bootloader
build script.
Verification
With the x86_64 change applied and hv1-boot excluded:
$ cargo check --workspace --exclude hv1-boot --all-targets
Finished `dev` profile [unoptimized + debuginfo] target(s) in 10.67s
Finishes in about 11s on my machine (10.67s wall clock here), exit 0, zero
errors. All 13 remaining workspace crates compile on stable 1.95.0, including
hv1-core and hv1-arm (one pre-existing unused-Result warning at
crates/hv1-core/src/vm.rs:724, unrelated to this change).
Happy to open a PR for the x86_64 feature change once you have a preference
on how to handle hv1-boot (1 / 2 / 3 above), or to adjust it to match
whatever you prefer.
Summary
On a clean clone against the toolchain the repo itself pins
(
rust-toolchain.toml->channel = "stable",rust-version = "1.95"),cargo check --workspacefails for me. Two dependencies of the Type-1(
hv1-*) crates require nightly and abort the check on a stable x86_64 host.The rest of the workspace (all
hv2-*crates plushm-cli/hm-gui) compilescleanly once these two are addressed.
Environment
rustc 1.95.0stable,cargo 1.95.0(matchesrust-toolchain.tomland theworkspace
rust-version = "1.95")x86_64Linuxprotoc35.1 present (so thehv2-apibuild is not the blocker)master(Cargo.lock:x86_64 v0.15.4,bootloader v0.11.15)Reproduction
$ cargo check --workspace --all-targetsFails with exit code 101. A minimal single-crate check reproduces the primary
blocker on its own:
$ cargo check -p hv1-coreRoot cause 1:
x86_64 = "0.15"enables the nightlyabi_x86_interruptgatecrates/hv1-core/Cargo.toml(andcrates/hv1-boot/Cargo.toml) depend onx86_64 = "0.15"with default features. Inx86_64 0.15.4,default = ["nightly", "instructions"]andnightlypulls inabi_x86_interrupt, which activates a nightly-only feature gate:This hits the library build of
hv1-core, so plaincargo check --workspace(not just--all-targets) fails. Thex86_64dependency istarget-gated to
cfg(target_arch = "x86_64"), which does not help on anx86_64 host: the gate is true, so the nightly-requiring dependency is pulled
in as normal.
Root cause 2:
bootloader v0.11build script uses nightly-only-Zflagscrates/hv1-boothasbootloader = "0.11"as a build-dependency. Its buildscript invokes cargo with
-Zflags, which stable cargo rejects:This surfaces when
--all-targetspulls in thehv1-bootbootable-imagetarget. Building an actual boot image is inherently a nightly task, so this
one is arguably by design; see the suggestion below.
Impact
the box. New contributors following the repo's own toolchain hit a hard
error on first
cargo check.cargo check --workspaceon x86_64 wouldhit the same failure (target-gating does not skip the dep on an x86_64
host).
Suggested minimal fix
Drop the
x86_64crate's nightly default feature and keepinstructions(theCPU-intrinsics / MSR-access feature the hv1 call sites I checked appear to
need; if you rely on the
abi_x86_interruptinterrupt-handler surfaceelsewhere you will want to keep that feature too):
For
hv1-boot, since it is a genuinely nightly bootable-image crate, thecleanest option is to keep it out of the default stable workspace build rather
than force it onto stable. Options, in order of least surprise (maintainers'
call):
cargo +nightly build -p hv1-bootand exclude it from the stablecargo check --workspacelane in CI, orhv1-boottoexclude = [...]in the workspace with a# nightly-only bootimagenote, orMinor:
crates/hv1-boot/Cargo.tomlcarriesedition = "2024" # Requires nightly Rust. Edition 2024 has been stable since Rust 1.85, so that commentis a bit out of date; the real nightly requirement here is the
bootloaderbuild script.
Verification
With the
x86_64change applied andhv1-bootexcluded:Finishes in about 11s on my machine (10.67s wall clock here), exit 0, zero
errors. All 13 remaining workspace crates compile on stable 1.95.0, including
hv1-coreandhv1-arm(one pre-existing unused-Resultwarning atcrates/hv1-core/src/vm.rs:724, unrelated to this change).Happy to open a PR for the
x86_64feature change once you have a preferenceon how to handle
hv1-boot(1 / 2 / 3 above), or to adjust it to matchwhatever you prefer.