Skip to content

Skip binary tidy check when on Windows Linux Subsystem #36709

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 25, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/tools/tidy/src/bins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,20 @@ pub fn check(_path: &Path, _bad: &mut bool) {}
#[cfg(unix)]
pub fn check(path: &Path, bad: &mut bool) {
use std::fs;
use std::io::Read;
use std::process::{Command, Stdio};
use std::os::unix::prelude::*;

if let Ok(mut file) = fs::File::open("/proc/version") {
let mut contents = String::new();
file.read_to_string(&mut contents).unwrap();
// Probably on Windows Linux Subsystem, all files will be marked as
// executable, so skip checking.
if contents.contains("Microsoft") {
return;
}
}

super::walk(path,
&mut |path| super::filter_dirs(path) || path.ends_with("src/etc"),
&mut |file| {
Expand Down