Skip to content

Commit bdfe875

Browse files
committed
Apply small fixes to sync main and libc-0.2 build and test
Just check out a few hunks of these files from `main` now that we aren't limited by the old MSRV.
1 parent 7c64d5d commit bdfe875

File tree

4 files changed

+11
-27
lines changed

4 files changed

+11
-27
lines changed

build.rs

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ fn rustc_version_cmd(is_clippy_driver: bool) -> Output {
132132

133133
cmd.arg("--version");
134134

135-
let output = cmd.output().ok().expect("Failed to get rustc version");
135+
let output = cmd.output().expect("Failed to get rustc version");
136136

137137
if !output.status.success() {
138138
panic!(
@@ -187,20 +187,14 @@ fn rustc_minor_nightly() -> (u32, bool) {
187187
}
188188

189189
fn which_freebsd() -> Option<i32> {
190-
let output = std::process::Command::new("freebsd-version").output().ok();
191-
if output.is_none() {
192-
return None;
193-
}
194-
let output = output.unwrap();
190+
let output = std::process::Command::new("freebsd-version")
191+
.output()
192+
.ok()?;
195193
if !output.status.success() {
196194
return None;
197195
}
198196

199-
let stdout = String::from_utf8(output.stdout).ok();
200-
if stdout.is_none() {
201-
return None;
202-
}
203-
let stdout = stdout.unwrap();
197+
let stdout = String::from_utf8(output.stdout).ok()?;
204198

205199
match &stdout {
206200
s if s.starts_with("10") => Some(10),
@@ -217,24 +211,16 @@ fn emcc_version_code() -> Option<u64> {
217211
let output = std::process::Command::new("emcc")
218212
.arg("-dumpversion")
219213
.output()
220-
.ok();
221-
if output.is_none() {
222-
return None;
223-
}
224-
let output = output.unwrap();
214+
.ok()?;
225215
if !output.status.success() {
226216
return None;
227217
}
228218

229-
let stdout = String::from_utf8(output.stdout).ok();
230-
if stdout.is_none() {
231-
return None;
232-
}
233-
let version = stdout.unwrap();
219+
let version = String::from_utf8(output.stdout).ok()?;
234220

235221
// Some Emscripten versions come with `-git` attached, so split the
236222
// version string also on the `-` char.
237-
let mut pieces = version.trim().split(|c| c == '.' || c == '-');
223+
let mut pieces = version.trim().split(['.', '-']);
238224

239225
let major = pieces.next().and_then(|x| x.parse().ok()).unwrap_or(0);
240226
let minor = pieces.next().and_then(|x| x.parse().ok()).unwrap_or(0);

ci/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ about above), and then shut down.
161161
poweroff
162162

163163
1. Exit the post install shell: `exit`
164-
1. Back in in the installer choose Reboot
164+
1. Back in the installer choose Reboot
165165
1. If all went well the machine should reboot and show a login prompt. If you
166166
switch to the serial console by choosing View > serial0 in the qemu menu,
167167
you should be logged in as root.

libc-test/build.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1858,6 +1858,7 @@ fn test_android(target: &str) {
18581858

18591859
// These are tested in the `linux_elf.rs` file.
18601860
"Elf64_Phdr" | "Elf32_Phdr" => true,
1861+
18611862
// These are intended to be opaque
18621863
"posix_spawn_file_actions_t" => true,
18631864
"posix_spawnattr_t" => true,
@@ -2463,7 +2464,7 @@ fn test_freebsd(target: &str) {
24632464
true
24642465
}
24652466

2466-
// Added in in FreeBSD 13.0 (r367776 and r367287)
2467+
// Added in FreeBSD 13.0 (r367776 and r367287)
24672468
"SCM_CREDS2" | "LOCAL_CREDS_PERSISTENT" if Some(13) > freebsd_ver => true,
24682469

24692470
// Added in FreeBSD 14

libc-test/semver/android.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
2-
3-
41
ABS_CNT
52
ABS_MAX
63
ADDR_COMPAT_LAYOUT

0 commit comments

Comments
 (0)