Skip to content

Commit 32c23a1

Browse files
Xanewokehuss
andcommitted
Set CFG_RELEASE for tools in bootstrap/tool.rs
Since rustc-ap-* v659 we now need to set CFG_RELEASE for rustc-ap-rustc_attr for `#[cfg(version(...))]` to work. Co-authored-by: Eric Huss <[email protected]>
1 parent 3e37320 commit 32c23a1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/bootstrap/tool.rs

+4
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,10 @@ pub fn prepare_tool_cargo(
252252
// own copy
253253
cargo.env("LZMA_API_STATIC", "1");
254254

255+
// CFG_RELEASE is needed by rustfmt (and possibly other tools) which
256+
// import rustc-ap-rustc_attr which requires this to be set for the
257+
// `#[cfg(version(...))]` attribute.
258+
cargo.env("CFG_RELEASE", builder.rust_release());
255259
cargo.env("CFG_RELEASE_CHANNEL", &builder.config.channel);
256260
cargo.env("CFG_VERSION", builder.rust_version());
257261
cargo.env("CFG_RELEASE_NUM", channel::CFG_RELEASE_NUM);

0 commit comments

Comments
 (0)