Skip to content

fix(oss-build): allow nightly features on stable via RUSTC_BOOTSTRAP#1365

Open
vegerot wants to merge 1 commit into
facebook:mainfrom
vegerot:pr1365
Open

fix(oss-build): allow nightly features on stable via RUSTC_BOOTSTRAP#1365
vegerot wants to merge 1 commit into
facebook:mainfrom
vegerot:pr1365

Conversation

@vegerot

@vegerot vegerot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

make oss failed on stable Rust 1.97.1 with:

error[E0554]: #![feature] may not be used on stable
--> smallvec-1.15.2/src/lib.rs:95: specialization
and 8 crates using #![feature(once_cell_try)]

Buck builds use a nightly toolchain internally and handle this,
but cargo oss builds use stable rustc by default.

Cargo.toml files are @generated by autocargo from BUCK files,
so we should not hand-edit them to remove the features.

Setting RUSTC_BOOTSTRAP=1 in build.py's cargo_env allows stable
cargo/rustc to accept these nightly features without requiring
users to install a nightly toolchain or override.

Fixes: cd eden/scm && make -j oss

make oss failed on stable Rust 1.97.1 with:

  error[E0554]: #![feature] may not be used on stable
    --> smallvec-1.15.2/src/lib.rs:95: specialization
  and 8 crates using #![feature(once_cell_try)]

Buck builds use a nightly toolchain internally and handle this,
but cargo oss builds use stable rustc by default.

Cargo.toml files are @generated by autocargo from BUCK files,
so we should not hand-edit them to remove the features.

Setting RUSTC_BOOTSTRAP=1 in build.py's cargo_env allows stable
cargo/rustc to accept these nightly features without requiring
users to install a nightly toolchain or override.

Fixes: cd eden/scm && make -j oss
Copilot AI review requested due to automatic review settings July 21, 2026 23:41
@meta-cla meta-cla Bot added the CLA Signed label Jul 21, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts Sapling’s OSS cargo build environment so stable Rust can compile dependencies that use nightly-only #![feature] gates, avoiding requiring a nightly toolchain for make oss.

Changes:

  • Set RUSTC_BOOTSTRAP=1 (if not already set) in cargo_env() to allow compiling crates that require nightly features during OSS cargo builds.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@meta-codesync

meta-codesync Bot commented Jul 21, 2026

Copy link
Copy Markdown

This pull request has been imported. If you are a Meta employee, you can view this in D113135919. (Because this pull request was imported automatically, there will not be any future comments.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants