File tree Expand file tree Collapse file tree 6 files changed +49
-0
lines changed Expand file tree Collapse file tree 6 files changed +49
-0
lines changed Original file line number Diff line number Diff line change @@ -4379,6 +4379,10 @@ fn optional_build_script_dep() {
4379
4379
4380
4380
#[ cargo_test]
4381
4381
fn optional_build_dep_and_required_normal_dep ( ) {
4382
+ // Note: `dev` and `dev.build-override` have different defaults. `bar` would
4383
+ // be built twice in the general case: once without debuginfo and once with
4384
+ // debuginfo = 2. Setting `debug = 2` in `dev.build-override` ensures it's
4385
+ // only built once in this test.
4382
4386
let p = project ( )
4383
4387
. file (
4384
4388
"Cargo.toml" ,
@@ -4393,6 +4397,9 @@ fn optional_build_dep_and_required_normal_dep() {
4393
4397
4394
4398
[build-dependencies]
4395
4399
bar = { path = "./bar" }
4400
+
4401
+ [profile.dev.build-override]
4402
+ debug = 2 # see note above
4396
4403
"# ,
4397
4404
)
4398
4405
. file ( "build.rs" , "extern crate bar; fn main() { bar::bar(); }" )
Original file line number Diff line number Diff line change @@ -238,6 +238,11 @@ fn relative_depinfo_paths_ws() {
238
238
239
239
// Test relative dep-info paths in a workspace with --target with
240
240
// proc-macros and other dependency kinds.
241
+ //
242
+ // Note: `dev` and `dev.build-override` have different defaults. `pmdep`
243
+ // would be built twice in the general case: once without debuginfo and once
244
+ // with debuginfo = 2. Setting `debug = 2` in `dev.build-override` ensures
245
+ // it will only create a single dep-info file.
241
246
Package :: new ( "regdep" , "0.1.0" )
242
247
. file ( "src/lib.rs" , "pub fn f() {}" )
243
248
. publish ( ) ;
@@ -255,6 +260,9 @@ fn relative_depinfo_paths_ws() {
255
260
r#"
256
261
[workspace]
257
262
members = ["foo"]
263
+
264
+ [profile.dev.build-override]
265
+ debug = 2 # see note above
258
266
"# ,
259
267
)
260
268
/*********** Main Project ***********/
Original file line number Diff line number Diff line change @@ -1050,13 +1050,21 @@ fn decouple_proc_macro() {
1050
1050
#[ cargo_test]
1051
1051
fn proc_macro_ws ( ) {
1052
1052
// Checks for bug with proc-macro in a workspace with dependency (shouldn't panic).
1053
+ //
1054
+ // Note, `dev` and `dev.build-override` have different defaults. `pm` would
1055
+ // be built twice in the general case: once without debuginfo and once with
1056
+ // debuginfo = 2. Setting `debug = 2` in `dev.build-override` ensures it's
1057
+ // only built once and `foo` remains fresh during the second check build.
1053
1058
let p = project ( )
1054
1059
. file (
1055
1060
"Cargo.toml" ,
1056
1061
r#"
1057
1062
[workspace]
1058
1063
members = ["foo", "pm"]
1059
1064
resolver = "2"
1065
+
1066
+ [profile.dev.build-override]
1067
+ debug = 2 # see note above
1060
1068
"# ,
1061
1069
)
1062
1070
. file (
@@ -2161,13 +2169,21 @@ fn pm_with_int_shared() {
2161
2169
// with `--workspace`, see https://github.com/rust-lang/cargo/issues/8312.
2162
2170
//
2163
2171
// This uses a const-eval hack to do compile-time feature checking.
2172
+ //
2173
+ // Note, `dev` and `dev.build-override` have different defaults. `pm` would
2174
+ // be built twice in the general case: once without debuginfo and once with
2175
+ // debuginfo = 2. Setting `debug = 2` in `dev.build-override` ensures it's
2176
+ // only built once in this test.
2164
2177
let p = project ( )
2165
2178
. file (
2166
2179
"Cargo.toml" ,
2167
2180
r#"
2168
2181
[workspace]
2169
2182
members = ["foo", "pm", "shared"]
2170
2183
resolver = "2"
2184
+
2185
+ [profile.dev.build-override]
2186
+ debug = 2 # see note above
2171
2187
"# ,
2172
2188
)
2173
2189
. file (
Original file line number Diff line number Diff line change @@ -1344,6 +1344,10 @@ fn fingerprint_cleaner_does_not_rebuild() {
1344
1344
1345
1345
#[ cargo_test]
1346
1346
fn reuse_panic_build_dep_test ( ) {
1347
+ // Note: `dev` and `dev.build-override` have different defaults. `bar` would
1348
+ // be built twice in the general case: once without debuginfo and once with
1349
+ // debuginfo = 2. Setting `debug = 2` in `dev.build-override` ensures it's
1350
+ // only built once in this test.
1347
1351
let p = project ( )
1348
1352
. file (
1349
1353
"Cargo.toml" ,
@@ -1360,6 +1364,9 @@ fn reuse_panic_build_dep_test() {
1360
1364
1361
1365
[profile.dev]
1362
1366
panic = "abort"
1367
+
1368
+ [profile.dev.build-override]
1369
+ debug = 2 # see note above
1363
1370
"# ,
1364
1371
)
1365
1372
. file ( "src/lib.rs" , "" )
Original file line number Diff line number Diff line change @@ -498,13 +498,20 @@ fn proc_macro_extern_prelude() {
498
498
499
499
#[ cargo_test]
500
500
fn proc_macro_built_once ( ) {
501
+ // Note: `dev` and `dev.build-override` have different defaults. `the-macro`
502
+ // would be built twice in the general case: once without debuginfo and once
503
+ // with debuginfo = 2. Setting `debug = 2` in `dev.build-override` ensures
504
+ // it's only built once in this test.
501
505
let p = project ( )
502
506
. file (
503
507
"Cargo.toml" ,
504
508
r#"
505
509
[workspace]
506
510
members = ['a', 'b']
507
511
resolver = "2"
512
+
513
+ [profile.dev.build-override]
514
+ debug = 2 # see note above
508
515
"# ,
509
516
)
510
517
. file (
Original file line number Diff line number Diff line change @@ -135,6 +135,9 @@ fn profile_override_bad_settings() {
135
135
#[ cargo_test]
136
136
fn profile_override_hierarchy ( ) {
137
137
// Test that the precedence rules are correct for different types.
138
+ // Note, `dev` and `dev.build-override` have different defaults. `dep` would be built twice in
139
+ // the general case: once without debuginfo and once with debuginfo = 2. Setting `debug = 2` in
140
+ // `dev.build-override` ensures it's only built once in this test.
138
141
let p = project ( )
139
142
. file (
140
143
"Cargo.toml" ,
@@ -153,6 +156,7 @@ fn profile_override_hierarchy() {
153
156
154
157
[profile.dev.build-override]
155
158
codegen-units = 4
159
+ debug = 2 # see note above
156
160
"# ,
157
161
)
158
162
// m1
You can’t perform that action at this time.
0 commit comments