Top Level Namespace
Defined Under Namespace
Modules: Microsandbox
Constant Summary collapse
- MSRV =
Preflight: the embedded microsandbox core is edition 2024 and pulls smoltcp, which sets a Minimum Supported Rust Version of 1.91. An older rustc (commonly Homebrew's, which shadows a newer rustup on PATH and ignores this gem's rust-toolchain.toml) fails deep in the build with a cryptic "rustc X is not supported by smoltcp" error. Detect it up front and explain the fix instead.
Probe the same rustc the build will invoke. create_rust_makefile drives the build through
cargo, and cargo resolves its compiler exactly as: theRUSTCenv var if set, otherwise the barerustcfound on PATH. It does NOT use therustcsitting beside thecargobinary, and the rustupcargoshim neither setsRUSTCnor prepends its toolchain bin to PATH — toolchain selection survives only because the PATHrustcis normally itself a rustup shim that honors rust-toolchain.toml. So a non-rustup rustc earlier on PATH (which reads neither RUSTUP_TOOLCHAIN nor the toolchain file) is what the build actually runs. Mirroring cargo's RUSTC-then-PATH resolution is the only probe that neither false-passes (the trap of checking the cargo sibling, which stays a valid rustup shim while the build silently uses the stale PATH rustc) nor false-aborts (whenRUSTCpoints at a newer compiler than the PATHrustc). Gem::Version.new("1.91")
Instance Method Summary collapse
Instance Method Details
#build_rustc ⇒ Object
27 28 29 30 |
# File 'ext/microsandbox/extconf.rb', line 27 def build_rustc rustc = ENV["RUSTC"].to_s.strip rustc.empty? ? "rustc" : rustc end |