about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-09-24 22:20:25 -0700
committerGitHub <noreply@github.com>2016-09-24 22:20:25 -0700
commitd6dc33907ab7d86d492eec8e79d0890bdbc8a2a8 (patch)
tree25a4b8f747cf07ec4e0a207391206c9759f48717 /src
parenta0843d7210f41974a0a2bc6876c538718404c268 (diff)
parent50dad3f1fd96cd233dd3b331bff0ef54c9cb7d8a (diff)
downloadrust-d6dc33907ab7d86d492eec8e79d0890bdbc8a2a8.tar.gz
rust-d6dc33907ab7d86d492eec8e79d0890bdbc8a2a8.zip
Auto merge of #36709 - Mark-Simulacrum:fix-wsl-tidy, r=Aatch
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.

Fixes #36706.
Diffstat (limited to 'src')
-rw-r--r--src/tools/tidy/src/bins.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/tools/tidy/src/bins.rs b/src/tools/tidy/src/bins.rs
index 876ae404bba..ea274266f1a 100644
--- a/src/tools/tidy/src/bins.rs
+++ b/src/tools/tidy/src/bins.rs
@@ -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| {