Skip to content

Commit 3bf1860

Browse files
committed
---
yaml --- r: 136870 b: refs/heads/dist-snap c: 2883b76 h: refs/heads/master v: v3
1 parent 7190e29 commit 3bf1860

File tree

7 files changed

+76
-2
lines changed

7 files changed

+76
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: 189b7332968972f34cdbbbd9b62d97ababf53059
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: 8dab56ea9d5f10924ef980f705bc864567d5b72a
9+
refs/heads/dist-snap: 2883b7682a06e19dcf8b669db1e34d0f4a83dc02
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/librustc/driver/driver.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,12 @@ pub fn stop_after_phase_5(sess: &Session) -> bool {
615615
return false;
616616
}
617617

618+
fn escape_dep_filename(filename: &str) -> String {
619+
// Apparently clang and gcc *only* escape spaces:
620+
// http://llvm.org/klaus/clang/commit/9d50634cfc268ecc9a7250226dd5ca0e945240d4
621+
filename.replace(" ", "\\ ")
622+
}
623+
618624
fn write_out_deps(sess: &Session,
619625
input: &Input,
620626
outputs: &OutputFilenames,
@@ -658,7 +664,7 @@ fn write_out_deps(sess: &Session,
658664
// write Makefile-compatible dependency rules
659665
let files: Vec<String> = sess.codemap().files.borrow()
660666
.iter().filter(|fmap| fmap.is_real_file())
661-
.map(|fmap| fmap.name.to_string())
667+
.map(|fmap| escape_dep_filename(fmap.name.as_slice()))
662668
.collect();
663669
let mut file = try!(io::File::create(&deps_filename));
664670
for path in out_filenames.iter() {
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
-include ../tools.mk
2+
3+
# FIXME: ignore freebsd/windows
4+
# (windows: see `../dep-info/Makefile`)
5+
ifneq ($(shell uname),FreeBSD)
6+
ifndef IS_WINDOWS
7+
all:
8+
$(RUSTC) --dep-info $(TMPDIR)/custom-deps-file.d --crate-type=lib lib.rs
9+
sleep 1
10+
touch 'foo foo.rs'
11+
-rm -f $(TMPDIR)/done
12+
$(MAKE) -drf Makefile.foo
13+
rm $(TMPDIR)/done
14+
pwd
15+
$(MAKE) -drf Makefile.foo
16+
rm $(TMPDIR)/done && exit 1 || exit 0
17+
else
18+
all:
19+
20+
endif
21+
22+
else
23+
all:
24+
25+
endif
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
LIB := $(shell $(RUSTC) --print-file-name --crate-type=lib lib.rs)
2+
3+
$(TMPDIR)/$(LIB):
4+
$(RUSTC) --dep-info $(TMPDIR)/custom-deps-file.d --crate-type=lib lib.rs
5+
touch $(TMPDIR)/done
6+
7+
-include $(TMPDIR)/custom-deps-file.d
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
pub fn bar() {}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
pub fn foo() {}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
#[path="foo foo.rs"]
12+
pub mod foo;
13+
14+
pub mod bar;

0 commit comments

Comments
 (0)