File tree 2 files changed +13
-1
lines changed
2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,15 @@ fn main() {
36
36
println ! ( "cargo:rustc-cfg=has_coverage_attribute" ) ;
37
37
}
38
38
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
+
39
48
generate_self_schema ( ) ;
40
49
println ! ( "cargo:rustc-env=PROFILE={}" , std:: env:: var( "PROFILE" ) . unwrap( ) ) ;
41
50
}
Original file line number Diff line number Diff line change @@ -98,7 +98,10 @@ pub fn build_info() -> String {
98
98
format ! (
99
99
"profile={} pgo={}" ,
100
100
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) ,
102
105
)
103
106
}
104
107
You can’t perform that action at this time.
0 commit comments