Skip to content

Commit 9d074b5

Browse files
committed
Use +nightly on --bench
1 parent 174d63b commit 9d074b5

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/main.rs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -709,6 +709,7 @@ fn gen_pkg_and_compile(input: &Input, action: &InputAction) -> Result<()> {
709709
"build",
710710
&*mani_path.to_string_lossy(),
711711
action.use_bincache,
712+
action.use_nightly,
712713
&meta,
713714
)?;
714715

@@ -735,6 +736,7 @@ fn gen_pkg_and_compile(input: &Input, action: &InputAction) -> Result<()> {
735736
pkg_path,
736737
&*mani_path.to_string_lossy(),
737738
action.use_bincache,
739+
action.use_nightly,
738740
&meta,
739741
)?;
740742

@@ -794,6 +796,8 @@ struct InputAction {
794796
/// Use shared binary cache?
795797
use_bincache: bool,
796798

799+
use_nightly: bool,
800+
797801
/// The package metadata structure for the current invocation.
798802
metadata: PackageMetadata,
799803

@@ -820,6 +824,7 @@ impl InputAction {
820824
cmd,
821825
&*self.manifest_path().to_string_lossy(),
822826
self.use_bincache,
827+
self.use_nightly,
823828
&self.metadata,
824829
)
825830
}
@@ -941,6 +946,7 @@ fn decide_action_for(
941946
pkg_path,
942947
using_cache,
943948
use_bincache: args.use_bincache.unwrap_or(using_cache),
949+
use_nightly: matches!(args.build_kind, BuildKind::Bench),
944950
metadata: input_meta,
945951
old_metadata: None,
946952
manifest: mani_str,
@@ -1359,9 +1365,13 @@ fn cargo(
13591365
cmd_name: &str,
13601366
manifest: &str,
13611367
use_bincache: bool,
1368+
nightly: bool,
13621369
meta: &PackageMetadata,
13631370
) -> Result<Command> {
13641371
let mut cmd = Command::new("cargo");
1372+
if nightly {
1373+
cmd.arg("+nightly");
1374+
}
13651375
cmd.arg(cmd_name).arg("--manifest-path").arg(manifest);
13661376

13671377
if platform::force_cargo_color() {
@@ -1399,6 +1409,7 @@ fn cargo_target<P>(
13991409
pkg_path: P,
14001410
manifest: &str,
14011411
use_bincache: bool,
1412+
use_nightly: bool,
14021413
meta: &PackageMetadata,
14031414
) -> Result<PathBuf>
14041415
where
@@ -1411,7 +1422,7 @@ where
14111422
use_bincache
14121423
);
14131424

1414-
let exe_path = cargo_target_by_message(input, manifest, use_bincache, meta)?;
1425+
let exe_path = cargo_target_by_message(input, manifest, use_bincache, use_nightly, meta)?;
14151426

14161427
trace!(".. exe_path: {:?}", exe_path);
14171428

@@ -1435,6 +1446,7 @@ fn cargo_target_by_message(
14351446
input: &Input,
14361447
manifest: &str,
14371448
use_bincache: bool,
1449+
use_nightly: bool,
14381450
meta: &PackageMetadata,
14391451
) -> Result<PathBuf> {
14401452
use std::io::{BufRead, BufReader};
@@ -1445,7 +1457,7 @@ fn cargo_target_by_message(
14451457
use_bincache
14461458
);
14471459

1448-
let mut cmd = cargo("build", manifest, use_bincache, meta)?;
1460+
let mut cmd = cargo("build", manifest, use_bincache, use_nightly, meta)?;
14491461
cmd.arg("--message-format=json");
14501462
cmd.stdout(process::Stdio::piped());
14511463
cmd.stderr(process::Stdio::null());

0 commit comments

Comments
 (0)