Skip to content

Commit f34dd8d

Browse files
committed
---
yaml --- r: 85947 b: refs/heads/dist-snap c: 05bb4c4 h: refs/heads/master i: 85945: b3036e1 85943: 979d1d5 v: v3
1 parent 7565d09 commit f34dd8d

File tree

29 files changed

+1168
-1128
lines changed

29 files changed

+1168
-1128
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: 0983ebe5310d4eb6d289f636f7ed0536c08bbc0e
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: 5ef8cdb8fd1f34fd3ab51ceba7ec286cedc349d8
9+
refs/heads/dist-snap: 05bb4c4e1bea99295f93d9a2382f534d675daee0
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
branch = master
55
[submodule "src/libuv"]
66
path = src/libuv
7-
url = https://github.com/brson/libuv.git
7+
url = https://github.com/alexcrichton/libuv.git
88
branch = master

branches/dist-snap/mk/rt.mk

Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -168,36 +168,58 @@ LIBUV_DEPS := $$(wildcard \
168168
$$(S)src/libuv/*/*/*/*)
169169
endif
170170

171+
LIBUV_GYP := $$(S)src/libuv/build/gyp
172+
LIBUV_MAKEFILE_$(1)_$(2) := $$(CFG_BUILD_DIR)rt/$(1)/stage$(2)/libuv/Makefile
173+
LIBUV_NO_LOAD = run-benchmarks.target.mk run-tests.target.mk \
174+
uv_dtrace_header.target.mk uv_dtrace_provider.target.mk
175+
176+
ifeq ($(OSTYPE_$(1)), linux-androideabi)
177+
$$(LIBUV_MAKEFILE_$(1)_$(2)): $$(LIBUV_GYP)
178+
(cd $(S)src/libuv/ && \
179+
$$(CFG_PYTHON) ./gyp_uv -f make -Dtarget_arch=$$(LIBUV_ARCH_$(1)) -D ninja -DOS=android \
180+
-Goutput_dir=$$(@D) --generator-output $$(@D))
181+
else
182+
$$(LIBUV_MAKEFILE_$(1)_$(2)): $$(LIBUV_GYP)
183+
(cd $(S)src/libuv/ && \
184+
$$(CFG_PYTHON) ./gyp_uv -f make -Dtarget_arch=$$(LIBUV_ARCH_$(1)) -D ninja \
185+
-Goutput_dir=$$(@D) --generator-output $$(@D))
186+
endif
187+
171188
# XXX: Shouldn't need platform-specific conditions here
172189
ifdef CFG_WINDOWSY_$(1)
173190
$$(LIBUV_LIB_$(1)_$(2)): $$(LIBUV_DEPS)
174-
$$(Q)$$(MAKE) -C $$(S)src/libuv/ \
175-
builddir_name="$$(CFG_BUILD_DIR)/rt/$(1)/stage$(2)/libuv" \
176-
OS=mingw \
191+
$$(Q)rm -f $$(S)src/libuv/libuv.a
192+
$$(Q)$$(MAKE) -C $$(S)src/libuv -f Makefile.mingw \
193+
CFLAGS="$$(CFG_GCCISH_CFLAGS) $$(LIBUV_FLAGS_$$(HOST_$(1))) $$(SNAP_DEFINES)" \
194+
AR="$$(AR_$(1))" \
177195
V=$$(VERBOSE)
196+
$$(Q)cp $$(S)src/libuv/libuv.a $$@
178197
else ifeq ($(OSTYPE_$(1)), linux-androideabi)
179-
$$(LIBUV_LIB_$(1)_$(2)): $$(LIBUV_DEPS)
180-
$$(Q)$$(MAKE) -C $$(S)src/libuv/ \
198+
$$(LIBUV_LIB_$(1)_$(2)): $$(LIBUV_DEPS) $$(LIBUV_MAKEFILE_$(1)_$(2))
199+
$$(Q)$$(MAKE) -C $$(@D) \
181200
CFLAGS="$$(CFG_GCCISH_CFLAGS) $$(LIBUV_FLAGS_$$(HOST_$(1))) $$(SNAP_DEFINES)" \
182201
LDFLAGS="$$(CFG_GCCISH_LINK_FLAGS) $$(LIBUV_FLAGS_$$(HOST_$(1)))" \
183202
CC="$$(CC_$(1))" \
184203
CXX="$$(CXX_$(1))" \
185204
LINK="$$(CXX_$(1))" \
186205
AR="$$(AR_$(1))" \
206+
host=android OS=linux \
187207
PLATFORM=android \
208+
builddir="." \
188209
BUILDTYPE=Release \
189-
builddir_name="$$(CFG_BUILD_DIR)/rt/$(1)/stage$(2)/libuv" \
190-
host=android OS=linux \
210+
NO_LOAD="$$(LIBUV_NO_LOAD)" \
191211
V=$$(VERBOSE)
192212
else
193-
$$(LIBUV_LIB_$(1)_$(2)): $$(LIBUV_DEPS)
194-
$$(Q)$$(MAKE) -C $$(S)src/libuv/ \
213+
$$(LIBUV_LIB_$(1)_$(2)): $$(LIBUV_DEPS) $$(LIBUV_MAKEFILE_$(1)_$(2))
214+
$$(Q)$$(MAKE) -C $$(@D) \
195215
CFLAGS="$$(CFG_GCCISH_CFLAGS) $$(LIBUV_FLAGS_$$(HOST_$(1))) $$(SNAP_DEFINES)" \
196216
LDFLAGS="$$(CFG_GCCISH_LINK_FLAGS) $$(LIBUV_FLAGS_$$(HOST_$(1)))" \
197217
CC="$$(CC_$(1))" \
198218
CXX="$$(CXX_$(1))" \
199219
AR="$$(AR_$(1))" \
200-
builddir_name="$$(CFG_BUILD_DIR)/rt/$(1)/stage$(2)/libuv" \
220+
builddir="." \
221+
BUILDTYPE=Release \
222+
NO_LOAD="$$(LIBUV_NO_LOAD)" \
201223
V=$$(VERBOSE)
202224
endif
203225

@@ -261,3 +283,7 @@ endef
261283
$(foreach stage,$(STAGES), \
262284
$(foreach target,$(CFG_TARGET_TRIPLES), \
263285
$(eval $(call DEF_RUNTIME_TARGETS,$(target),$(stage)))))
286+
287+
$(LIBUV_GYP):
288+
mkdir -p $(S)src/libuv/build
289+
git clone https://git.chromium.org/external/gyp.git $(S)src/libuv/build/gyp

branches/dist-snap/src/compiletest/procsrv.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ pub fn run(lib_path: &str,
5454
in_fd: None,
5555
out_fd: None,
5656
err_fd: None
57-
});
57+
}).unwrap();
5858

5959
for input in input.iter() {
60-
proc.input().write_str(*input);
60+
proc.input().write(input.as_bytes());
6161
}
6262
let output = proc.finish_with_output();
6363

branches/dist-snap/src/compiletest/runtest.rs

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -20,41 +20,16 @@ use procsrv;
2020
use util;
2121
use util::logv;
2222

23-
use std::cell::Cell;
2423
use std::io;
2524
use std::os;
2625
use std::str;
27-
use std::task::{spawn_sched, SingleThreaded};
2826
use std::vec;
29-
use std::unstable::running_on_valgrind;
3027

3128
use extra::test::MetricMap;
3229

3330
pub fn run(config: config, testfile: ~str) {
34-
let config = Cell::new(config);
35-
let testfile = Cell::new(testfile);
36-
// FIXME #6436: Creating another thread to run the test because this
37-
// is going to call waitpid. The new scheduler has some strange
38-
// interaction between the blocking tasks and 'friend' schedulers
39-
// that destroys parallelism if we let normal schedulers block.
40-
// It should be possible to remove this spawn once std::run is
41-
// rewritten to be non-blocking.
42-
//
43-
// We do _not_ create another thread if we're running on V because
44-
// it serializes all threads anyways.
45-
if running_on_valgrind() {
46-
let config = config.take();
47-
let testfile = testfile.take();
48-
let mut _mm = MetricMap::new();
49-
run_metrics(config, testfile, &mut _mm);
50-
} else {
51-
do spawn_sched(SingleThreaded) {
52-
let config = config.take();
53-
let testfile = testfile.take();
54-
let mut _mm = MetricMap::new();
55-
run_metrics(config, testfile, &mut _mm);
56-
}
57-
}
31+
let mut _mm = MetricMap::new();
32+
run_metrics(config, testfile, &mut _mm);
5833
}
5934

6035
pub fn run_metrics(config: config, testfile: ~str, mm: &mut MetricMap) {

branches/dist-snap/src/librustdoc/markdown_writer.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,14 @@ fn pandoc_writer(
104104
];
105105
106106
do generic_writer |markdown| {
107-
use std::io::WriterUtil;
108-
109107
debug!("pandoc cmd: %s", pandoc_cmd);
110108
debug!("pandoc args: %s", pandoc_args.connect(" "));
111109

112-
let mut proc = run::Process::new(pandoc_cmd, pandoc_args, run::ProcessOptions::new());
110+
let proc = run::Process::new(pandoc_cmd, pandoc_args,
111+
run::ProcessOptions::new());
112+
let mut proc = proc.unwrap();
113113

114-
proc.input().write_str(markdown);
114+
proc.input().write(markdown.as_bytes());
115115
let output = proc.finish_with_output();
116116

117117
debug!("pandoc result: %i", output.status);

branches/dist-snap/src/librustpkg/source_control.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ pub fn git_clone_general(source: &str, target: &Path, v: &Version) -> bool {
8989

9090
fn process_output_in_cwd(prog: &str, args: &[~str], cwd: &Path) -> ProcessOutput {
9191
let mut prog = Process::new(prog, args, ProcessOptions{ dir: Some(cwd)
92-
,..ProcessOptions::new()});
92+
,..ProcessOptions::new()}).unwrap();
9393
prog.finish_with_output()
9494
}
9595

branches/dist-snap/src/librustpkg/tests.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,14 @@ fn mk_temp_workspace(short_name: &Path, version: &Version) -> Path {
112112

113113
fn run_git(args: &[~str], env: Option<~[(~str, ~str)]>, cwd: &Path, err_msg: &str) {
114114
let cwd = (*cwd).clone();
115-
let mut prog = run::Process::new("git", args, run::ProcessOptions {
115+
let prog = run::Process::new("git", args, run::ProcessOptions {
116116
env: env,
117117
dir: Some(&cwd),
118118
in_fd: None,
119119
out_fd: None,
120120
err_fd: None
121121
});
122+
let mut prog = prog.unwrap();
122123
let rslt = prog.finish_with_output();
123124
if rslt.status != 0 {
124125
fail!("%s [git returned %?, output = %s, error = %s]", err_msg,
@@ -226,7 +227,7 @@ fn command_line_test_with_env(args: &[~str], cwd: &Path, env: Option<~[(~str, ~s
226227
in_fd: None,
227228
out_fd: None,
228229
err_fd: None
229-
});
230+
}).unwrap();
230231
let output = prog.finish_with_output();
231232
debug!("Output from command %s with args %? was %s {%s}[%?]",
232233
cmd, args, str::from_bytes(output.output),
@@ -1027,16 +1028,17 @@ fn test_extern_mod() {
10271028
test_sysroot().to_str(),
10281029
exec_file.to_str());
10291030
1030-
let mut prog = run::Process::new(rustc.to_str(), [main_file.to_str(),
1031-
~"--sysroot", test_sysroot().to_str(),
1032-
~"-o", exec_file.to_str()],
1033-
run::ProcessOptions {
1031+
let prog = run::Process::new(rustc.to_str(), [main_file.to_str(),
1032+
~"--sysroot", test_sysroot().to_str(),
1033+
~"-o", exec_file.to_str()],
1034+
run::ProcessOptions {
10341035
env: env,
10351036
dir: Some(&dir),
10361037
in_fd: None,
10371038
out_fd: None,
10381039
err_fd: None
10391040
});
1041+
let mut prog = prog.unwrap();
10401042
let outp = prog.finish_with_output();
10411043
if outp.status != 0 {
10421044
fail!("output was %s, error was %s",

branches/dist-snap/src/libstd/rt/io/file.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,6 @@ pub struct FileStream {
7171
last_nread: int,
7272
}
7373

74-
impl FileStream {
75-
}
76-
7774
impl Reader for FileStream {
7875
fn read(&mut self, buf: &mut [u8]) -> Option<uint> {
7976
match self.fd.read(buf) {

branches/dist-snap/src/libstd/rt/io/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,9 @@ pub use self::extensions::WriterByteConversions;
268268
/// Synchronous, non-blocking file I/O.
269269
pub mod file;
270270

271+
/// Synchronous, in-memory I/O.
272+
pub mod pipe;
273+
271274
/// Synchronous, non-blocking network I/O.
272275
pub mod net {
273276
pub mod tcp;

branches/dist-snap/src/libstd/rt/io/net/tcp.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use rt::io::{io_error, read_error, EndOfFile};
1616
use rt::rtio::{IoFactory, IoFactoryObject,
1717
RtioSocket, RtioTcpListener,
1818
RtioTcpListenerObject, RtioTcpStream,
19-
RtioTcpStreamObject};
19+
RtioTcpStreamObject, RtioStream};
2020
use rt::local::Local;
2121

2222
pub struct TcpStream(~RtioTcpStreamObject);
@@ -69,7 +69,7 @@ impl TcpStream {
6969

7070
impl Reader for TcpStream {
7171
fn read(&mut self, buf: &mut [u8]) -> Option<uint> {
72-
match (**self).read(buf) {
72+
match (***self).read(buf) {
7373
Ok(read) => Some(read),
7474
Err(ioerr) => {
7575
// EOF is indicated by returning None
@@ -86,7 +86,7 @@ impl Reader for TcpStream {
8686

8787
impl Writer for TcpStream {
8888
fn write(&mut self, buf: &[u8]) {
89-
match (**self).write(buf) {
89+
match (***self).write(buf) {
9090
Ok(_) => (),
9191
Err(ioerr) => io_error::cond.raise(ioerr),
9292
}
@@ -166,7 +166,7 @@ mod test {
166166
do run_in_newsched_task {
167167
let mut called = false;
168168
do io_error::cond.trap(|e| {
169-
assert!(e.kind == ConnectionRefused);
169+
assert_eq!(e.kind, ConnectionRefused);
170170
called = true;
171171
}).inside {
172172
let addr = SocketAddr { ip: Ipv4Addr(0, 0, 0, 0), port: 1 };
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
// Copyright 2013 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+
//! Synchronous, in-memory pipes.
12+
//!
13+
//! Currently these aren't particularly useful, there only exists bindings
14+
//! enough so that pipes can be created to child processes.
15+
16+
use prelude::*;
17+
use super::{Reader, Writer};
18+
use rt::io::{io_error, read_error, EndOfFile};
19+
use rt::local::Local;
20+
use rt::rtio::{RtioPipeObject, RtioStream, IoFactoryObject, IoFactory};
21+
use rt::uv::pipe;
22+
23+
pub struct PipeStream(~RtioPipeObject);
24+
25+
impl PipeStream {
26+
/// Creates a new pipe initialized, but not bound to any particular
27+
/// source/destination
28+
pub fn new() -> Option<PipeStream> {
29+
let pipe = unsafe {
30+
let io: *mut IoFactoryObject = Local::unsafe_borrow();
31+
(*io).pipe_init(false)
32+
};
33+
match pipe {
34+
Ok(p) => Some(PipeStream(p)),
35+
Err(ioerr) => {
36+
io_error::cond.raise(ioerr);
37+
None
38+
}
39+
}
40+
}
41+
42+
/// Extracts the underlying libuv pipe to be bound to another source.
43+
pub fn uv_pipe(&self) -> pipe::Pipe {
44+
// Did someone say multiple layers of indirection?
45+
(**self).uv_pipe()
46+
}
47+
}
48+
49+
impl Reader for PipeStream {
50+
fn read(&mut self, buf: &mut [u8]) -> Option<uint> {
51+
match (***self).read(buf) {
52+
Ok(read) => Some(read),
53+
Err(ioerr) => {
54+
// EOF is indicated by returning None
55+
if ioerr.kind != EndOfFile {
56+
read_error::cond.raise(ioerr);
57+
}
58+
return None;
59+
}
60+
}
61+
}
62+
63+
fn eof(&mut self) -> bool { fail!() }
64+
}
65+
66+
impl Writer for PipeStream {
67+
fn write(&mut self, buf: &[u8]) {
68+
match (***self).write(buf) {
69+
Ok(_) => (),
70+
Err(ioerr) => {
71+
io_error::cond.raise(ioerr);
72+
}
73+
}
74+
}
75+
76+
fn flush(&mut self) { fail!() }
77+
}

0 commit comments

Comments
 (0)