File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,15 @@ fn main() {
3636 println ! ( "cargo:rustc-cfg=has_coverage_attribute" ) ;
3737 }
3838 println ! ( "cargo:rustc-check-cfg=cfg(has_coverage_attribute)" ) ;
39+
40+ if std:: env:: var ( "RUSTFLAGS" )
41+ . unwrap_or_default ( )
42+ . contains ( "-Cprofile-use=" )
43+ {
44+ println ! ( "cargo:rustc-cfg=specified_profile_use" ) ;
45+ }
46+ println ! ( "cargo:rustc-check-cfg=cfg(specified_profile_use)" ) ;
47+
3948 generate_self_schema ( ) ;
4049 println ! ( "cargo:rustc-env=PROFILE={}" , std:: env:: var( "PROFILE" ) . unwrap( ) ) ;
4150}
Original file line number Diff line number Diff line change @@ -98,7 +98,10 @@ pub fn build_info() -> String {
9898 format ! (
9999 "profile={} pgo={}" ,
100100 env!( "PROFILE" ) ,
101- option_env!( "RUSTFLAGS" ) . unwrap_or( "" ) . contains( "-Cprofile-use=" ) ,
101+ // We use a `cfg!` here not `env!`/`option_env!` as those would
102+ // embed `RUSTFLAGS` into the generated binary which causes problems
103+ // with reproducable builds.
104+ cfg!( specified_profile_use) ,
102105 )
103106}
104107
You can’t perform that action at this time.
0 commit comments