Skip to content

Commit 50dad3f

Browse files
Skip binary tidy check when on Windows Linux Subsystem
While it's possible that other linux systems will include "Microsoft" in their /proc/version, this is deemed unlikely, and since this is a tidy check, will likely be caught by buildbot/travis either way.
1 parent 05c2fdd commit 50dad3f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/tools/tidy/src/bins.rs

+11
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,20 @@ pub fn check(_path: &Path, _bad: &mut bool) {}
2424
#[cfg(unix)]
2525
pub fn check(path: &Path, bad: &mut bool) {
2626
use std::fs;
27+
use std::io::Read;
2728
use std::process::{Command, Stdio};
2829
use std::os::unix::prelude::*;
2930

31+
if let Ok(mut file) = fs::File::open("/proc/version") {
32+
let mut contents = String::new();
33+
file.read_to_string(&mut contents).unwrap();
34+
// Probably on Windows Linux Subsystem, all files will be marked as
35+
// executable, so skip checking.
36+
if contents.contains("Microsoft") {
37+
return;
38+
}
39+
}
40+
3041
super::walk(path,
3142
&mut |path| super::filter_dirs(path) || path.ends_with("src/etc"),
3243
&mut |file| {

0 commit comments

Comments
 (0)