Skip to content

Commit ff04316

Browse files
Remove --target option
1 parent 970b2c7 commit ff04316

File tree

3 files changed

+11
-36
lines changed

3 files changed

+11
-36
lines changed

build_system/src/build.rs

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -43,22 +43,6 @@ impl BuildArg {
4343
Self::usage();
4444
return Ok(None);
4545
}
46-
"--target-triple" => {
47-
if args.next().is_some() {
48-
// Handled in config.rs.
49-
} else {
50-
return Err(
51-
"Expected a value after `--target-triple`, found nothing".to_string()
52-
);
53-
}
54-
}
55-
"--target" => {
56-
if args.next().is_some() {
57-
// Handled in config.rs.
58-
} else {
59-
return Err("Expected a value after `--target`, found nothing".to_string());
60-
}
61-
}
6246
arg => {
6347
if !build_arg.config_info.parse_argument(arg, &mut args)? {
6448
return Err(format!("Unknown argument `{}`", arg));
@@ -152,21 +136,18 @@ fn build_sysroot_inner(
152136
&"cargo",
153137
&"build",
154138
&"--target",
155-
&config.target,
139+
&config.target_triple,
156140
&"--release",
157141
],
158142
Some(start_dir),
159143
Some(&env),
160144
)?;
161145
"release"
162146
} else {
163-
env.insert(
164-
"RUSTFLAGS".to_string(),
165-
rustflags,
166-
);
147+
env.insert("RUSTFLAGS".to_string(), rustflags);
167148

168149
run_command_with_output_and_env(
169-
&[&"cargo", &"build", &"--target", &config.target],
150+
&[&"cargo", &"build", &"--target", &config.target_triple],
170151
Some(start_dir),
171152
Some(&env),
172153
)?;

build_system/src/config.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use std::env as std_env;
44

55
#[derive(Default)]
66
pub struct ConfigInfo {
7-
pub target: String,
87
pub target_triple: String,
98
pub host_triple: String,
109
pub rustc_command: Vec<String>,
@@ -31,10 +30,6 @@ impl ConfigInfo {
3130
)
3231
}
3332
},
34-
"--target" => match args.next() {
35-
Some(arg) if !arg.is_empty() => self.target = arg.to_string(),
36-
_ => return Err("Expected a value after `--target`, found nothing".to_string()),
37-
},
3833
"--out-dir" => match args.next() {
3934
Some(arg) if !arg.is_empty() => {
4035
// env.insert("CARGO_TARGET_DIR".to_string(), arg.to_string());
@@ -83,12 +78,6 @@ impl ConfigInfo {
8378
};
8479
self.host_triple = rustc_version_info(Some(&rustc))?.host.unwrap_or_default();
8580

86-
if !self.target_triple.is_empty() && self.target.is_empty() {
87-
self.target = self.target_triple.clone();
88-
}
89-
if self.target.is_empty() {
90-
self.target = self.host_triple.clone();
91-
}
9281
if self.target_triple.is_empty() {
9382
self.target_triple = self.host_triple.clone();
9483
}
@@ -223,7 +212,6 @@ impl ConfigInfo {
223212
pub fn show_usage() {
224213
println!(
225214
"\
226-
--target [arg] : Set the target to [arg]
227215
--target-triple [arg] : Set the target triple to [arg]
228216
--out-dir : Location where the files will be generated
229217
--release-sysroot : Build sysroot in release mode

build_system/src/test.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,10 @@ fn extended_regex_example_tests(env: &Env, args: &TestArg) -> Result<(), String>
750750
println!("[TEST] rust-lang/regex example shootout-regex-dna");
751751
let mut env = env.clone();
752752
// newer aho_corasick versions throw a deprecation warning
753-
let rustflags = format!("{} --cap-lints warn", env.get("RUSTFLAGS").cloned().unwrap_or_default());
753+
let rustflags = format!(
754+
"{} --cap-lints warn",
755+
env.get("RUSTFLAGS").cloned().unwrap_or_default()
756+
);
754757
env.insert("RUSTFLAGS".to_string(), rustflags);
755758
// Make sure `[codegen mono items] start` doesn't poison the diff
756759
run_cargo_command(
@@ -799,7 +802,10 @@ fn extended_regex_tests(env: &Env, args: &TestArg) -> Result<(), String> {
799802
println!("[TEST] rust-lang/regex tests");
800803
let mut env = env.clone();
801804
// newer aho_corasick versions throw a deprecation warning
802-
let rustflags = format!("{} --cap-lints warn", env.get("RUSTFLAGS").cloned().unwrap_or_default());
805+
let rustflags = format!(
806+
"{} --cap-lints warn",
807+
env.get("RUSTFLAGS").cloned().unwrap_or_default()
808+
);
803809
env.insert("RUSTFLAGS".to_string(), rustflags);
804810
run_cargo_command(
805811
&[

0 commit comments

Comments
 (0)