summary refs log tree commit diff
path: root/src/libstd/run.rs
AgeCommit message (Collapse)AuthorLines
2014-01-07stdtest: Fix all leaked trait importsAlex Crichton-3/+2
2013-12-29auto merge of #11134 : lucab/rust/lucab/libstd-doc, r=cmrbors-1/+1
Uniform the short title of modules provided by libstd, in order to make their roles more explicit when glancing at the index.
2013-12-27Bring native process bindings up to dateAlex Crichton-1/+1
Move the tests into libstd, use the `iotest!` macro to test both native and uv bindings, and use the cloexec trick to figure out when the child process fails in exec.
2013-12-27std: uniform modules titles for docLuca Bruno-1/+1
This commit uniforms the short title of modules provided by libstd, in order to make their roles more explicit when glancing at the index. Signed-off-by: Luca Bruno <lucab@debian.org>
2013-12-24std: Get stdtest all passing againAlex Crichton-2/+2
This commit brings the library up-to-date in order to get all tests passing again
2013-12-24green: Rip the bandaid off, introduce libgreenAlex Crichton-4/+4
This extracts everything related to green scheduling from libstd and introduces a new libgreen crate. This mostly involves deleting most of std::rt and moving it to libgreen. Along with the movement of code, this commit rearchitects many functions in the scheduler in order to adapt to the fact that Local::take now *only* works on a Task, not a scheduler. This mostly just involved threading the current green task through in a few locations, but there were one or two spots where things got hairy. There are a few repercussions of this commit: * tube/rc have been removed (the runtime implementation of rc) * There is no longer a "single threaded" spawning mode for tasks. This is now encompassed by 1:1 scheduling + communication. Convenience methods have been introduced that are specific to libgreen to assist in the spawning of pools of schedulers.
2013-12-20std: silence warnings when compiling test.Huon Wilson-1/+1
2013-12-18Upgrade libuv to fix a leak on OSXAlex Crichton-2/+1
I haven't landed this fix upstream just yet, but it's opened as joyent/libuv#1048. For now, I've locally merged it into my fork, and I've upgraded our repo to point to the new revision. Closes #11027
2013-12-17auto merge of #10863 : cadencemarseille/rust/patch-handle-ENOENT, r=alexcrichtonbors-2/+7
Translate ENOENT to IoErrorKind::FileNotFound.
2013-12-17Handle ENOENTCadence Marseille-2/+7
Translate ENOENT to IoErrorKind::FileNotFound.
2013-12-16Fallout of rewriting std::commAlex Crichton-3/+2
2013-12-14Fix #10754 - `std::run` functions fail after io_errorCadence Marseille-27/+52
The problem was that std::run::Process::new() was unwrap()ing the result of std::io::process::Process::new(), which returns None in the case where the io_error condition is raised to signal failure to start the process. Have std::run::Process::new() similarly return an Option<run::Process> to reflect the fact that a subprocess might have failed to start. Update utility functions run::process_status() and run::process_output() to return Option<ProcessExit> and Option<ProcessOutput>, respectively. Various parts of librustc and librustpkg needed to be updated to reflect these API changes. closes #10754
2013-12-11Make 'self lifetime illegal.Erik Price-3/+3
Also remove all instances of 'self within the codebase. This fixes #10889.
2013-12-10librustpkg: Make `io::ignore_io_error()` use RAII; remove a few morePatrick Walton-15/+14
cells.
2013-12-08Remove dead codesKiet Tran-1/+4
2013-12-04Revert "libstd: Change `Path::new` to `Path::init`."Kevin Ballard-2/+2
This reverts commit c54427ddfbbab41a39d14f2b1dc4f080cbc2d41b. Leave the #[ignores] in that were added to rustpkg tests. Conflicts: src/librustc/driver/driver.rs src/librustc/metadata/creader.rs
2013-12-04std::str: remove from_utf8.Huon Wilson-8/+8
This function had type &[u8] -> ~str, i.e. it allocates a string internally, even though the non-allocating version that take &[u8] -> &str and ~[u8] -> ~str are all that is necessary in most circumstances.
2013-11-29libstd: Change `Path::new` to `Path::init`.Patrick Walton-2/+2
2013-11-26libstd: Remove all non-`proc` uses of `do` from libstdPatrick Walton-4/+4
2013-11-24Remove linked failure from the runtimeAlex Crichton-9/+2
The reasons for doing this are: * The model on which linked failure is based is inherently complex * The implementation is also very complex, and there are few remaining who fully understand the implementation * There are existing race conditions in the core context switching function of the scheduler, and possibly others. * It's unclear whether this model of linked failure maps well to a 1:1 threading model Linked failure is often a desired aspect of tasks, but we would like to take a much more conservative approach in re-implementing linked failure if at all. Closes #8674 Closes #8318 Closes #8863
2013-11-11Move std::rt::io to std::ioAlex Crichton-6/+6
2013-11-12Implemented a ProcessExit enum and helper methods to std::rt::io::process ↵Matthew Iselin-13/+17
for getting process termination status, or the signal that terminated a process. A test has been added to rtio-processes.rs to ensure signal termination is picked up correctly.
2013-11-11Remove #[fixed_stack_segment] and #[rust_stack]Alex Crichton-1/+0
These two attributes are no longer useful now that Rust has decided to leave segmented stacks behind. It is assumed that the rust task's stack is always large enough to make an FFI call (due to the stack being very large). There's always the case of stack overflow, however, to consider. This does not change the behavior of stack overflow in Rust. This is still normally triggered by the __morestack function and aborts the whole process. C stack overflow will continue to corrupt the stack, however (as it did before this commit as well). The future improvement of a guard page at the end of every rust stack is still unimplemented and is intended to be the mechanism through which we attempt to detect C stack overflow. Closes #8822 Closes #10155
2013-11-11auto merge of #10394 : yichoi/rust/make_check_pass_android, r=brsonbors-99/+7
To enable test on android bot #9120 some tests are disabled and can be fixed further.
2013-11-10Another round of test fixes from previous commitsAlex Crichton-2/+2
2013-11-10temporarily disable tests on android and tagging issue number #10380Young-il Choi-99/+7
2013-11-04Move io::file to io::fs and fns out of FileAlex Crichton-4/+4
This renames the `file` module to `fs` because that more accurately describes its current purpose (manipulating the filesystem, not just files). Additionally, this adds an UnstableFileStat structure as a nested structure of FileStat to signify that the fields should not be depended on. The structure is currently flagged with #[unstable], but it's unlikely that it has much meaning. Closes #10241
2013-11-03Remove all blocking std::os blocking functionsAlex Crichton-4/+4
This commit moves all thread-blocking I/O functions from the std::os module. Their replacements can be found in either std::rt::io::file or in a hidden "old_os" module inside of native::file. I didn't want to outright delete these functions because they have a lot of special casing learned over time for each OS/platform, and I imagine that these will someday get integrated into a blocking implementation of IoFactory. For now, they're moved to a private module to prevent bitrot and still have tests to ensure that they work. I've also expanded the extensions to a few more methods defined on Path, most of which were previously defined in std::os but now have non-thread-blocking implementations as part of using the current IoFactory. The api of io::file is in flux, but I plan on changing it in the next commit as well. Closes #10057
2013-10-29librustc: Implement the `proc` type as sugar for `~once fn` and `proc`Patrick Walton-2/+2
notation for closures, and disable the feature gate for `once fn` if used with the `~` sigil.
2013-10-28Remove the extension traits for Readers/WritersAlex Crichton-1/+1
These methods are all excellent candidates for default methods, so there's no need to require extra imports of various traits.
2013-10-28Allow fail messages to be caught, and introduce the Any traitMarvin Löbel-1/+1
Some code cleanup, sorting of import blocks Removed std::unstable::UnsafeArc's use of Either Added run-fail tests for the new FailWithCause impls Changed future_result and try to return Result<(), ~Any>. - Internally, there is an enum of possible fail messages passend around. - In case of linked failure or a string message, the ~Any gets lazyly allocated in future_results recv method. - For that, future result now returns a wrapper around a Port. - Moved and renamed task::TaskResult into rt::task::UnwindResult and made it an internal enum. - Introduced a replacement typedef `type TaskResult = Result<(), ~Any>`.
2013-10-24Another round of test fixes and merge conflictsAlex Crichton-8/+19
2013-10-24Fixing some tests, adding some pipesAlex Crichton-3/+6
This adds constructors to pipe streams in the new runtime to take ownership of file descriptors, and also fixes a few tests relating to the std::run changes (new errors are raised on io_error and one test is xfail'd).
2013-10-24Migrate std::run to libuv processesAlex Crichton-12/+34
2013-10-24Test fixes and merge conflictsAlex Crichton-14/+3
2013-10-23Merge remote-tracking branch 'upstream/master'Ziad Hatahet-2/+0
2013-10-22Remove thread-blocking call to `libc::stat` in `Path::stat`Ziad Hatahet-4/+4
Fixes #9958
2013-10-23Removed Unnecessary comments and white spaces #4386reedlepee-3/+0
2013-10-23Making fields in std and extra : private #4386reedlepee-2/+3
2013-10-22Drop the '2' suffix from logging macrosAlex Crichton-1/+1
Who doesn't like a massive renaming?
2013-10-15path2: Adjust the API to remove all the _str mutation methodsKevin Ballard-2/+2
Add a new trait BytesContainer that is implemented for both byte vectors and strings. Convert Path::from_vec and ::from_str to one function, Path::new(). Remove all the _str-suffixed mutation methods (push, join, with_*, set_*) and modify the non-suffixed versions to use BytesContainer.
2013-10-15path2: Replace the path module outrightKevin Ballard-4/+4
Remove the old path. Rename path2 to path. Update all clients for the new path. Also make some miscellaneous changes to the Path APIs to help the adoption process.
2013-10-10Remove usage of io::FILE_writerAlex Crichton-12/+13
2013-10-10Move std::run off of std::ioAlex Crichton-769/+65
This changes the implementation to instead use rt::io::native::process as well as an example of using those bindings.
2013-09-30std: Remove usage of fmt!Alex Crichton-26/+26
2013-09-18auto merge of #9280 : alexcrichton/rust/less-c++, r=brsonbors-4/+17
Some of the functions could be converted to rust, but the functions dealing with signals were moved to rust_builtin.cpp instead (no reason to keep the original file around for one function). Closes #2674 Because less C++ is better C++!
2013-09-18Remove rust_run_program.cppAlex Crichton-4/+17
Some of the functions could be converted to rust, but the functions dealing with signals were moved to rust_builtin.cpp instead (no reason to keep the original file around for one function). Closes #2674
2013-09-18Register new snapshotsAlex Crichton-2/+0
2013-09-16switch Drop to `&mut self`Daniel Micay-6/+3
2013-09-05Rename str::from_bytes to str::from_utf8, closes #8985Florian Hahn-12/+12