about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2016-11-14 12:50:38 -0800
committerAlex Crichton <alex@alexcrichton.com>2016-11-14 12:52:06 -0800
commit7cd8a497cce5f85670fb5736e9064f22c0f4da99 (patch)
treeb005a5ae4e13b4f99367680384f57411aa77a732 /src/bootstrap
parent766f6e4782994ff9f0b0cad9af9cd63b5a2d0f0d (diff)
downloadrust-7cd8a497cce5f85670fb5736e9064f22c0f4da99.tar.gz
rust-7cd8a497cce5f85670fb5736e9064f22c0f4da99.zip
rustbuild: Tweak default rule inclusion
If a rule is flagged with `default(true)` then the pseudo-rule `default:foo`
will include that. If a rule is also flagged with `.host(true)`, however, then
the rule shouldn't be included for targets that aren't in the host array. This
adds a filter to ensure we don't pull in host rules for targets by accident.
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/step.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/bootstrap/step.rs b/src/bootstrap/step.rs
index 190a4cc67f9..56be2ccb235 100644
--- a/src/bootstrap/step.rs
+++ b/src/bootstrap/step.rs
@@ -565,7 +565,8 @@ impl<'a> Rules<'a> {
             for dep in rule.deps.iter() {
                 let dep = dep(&self.sbuild.name(rule.name));
                 if self.rules.contains_key(&dep.name) || dep.name.starts_with("default:") {
-                    continue }
+                    continue
+                }
                 panic!("\
 
 invalid rule dependency graph detected, was a rule added and maybe typo'd?
@@ -686,8 +687,9 @@ invalid rule dependency graph detected, was a rule added and maybe typo'd?
                     "dist" => Kind::Dist,
                     kind => panic!("unknown kind: `{}`", kind),
                 };
+                let host = self.build.config.host.iter().any(|h| h == dep.target);
                 let rules = self.rules.values().filter(|r| r.default);
-                for rule in rules.filter(|r| r.kind == kind) {
+                for rule in rules.filter(|r| r.kind == kind && (!r.host || host)) {
                     self.fill(dep.name(rule.name), order, added);
                 }
             } else {