about summary refs log tree commit diff
path: root/src/libstd/process.rs
AgeCommit message (Collapse)AuthorLines
2015-12-17Add a debug implementation to process::OutputEd Clarke-0/+27
2015-12-01Fix typo in src/libstd/process.rsAdam Badawy-1/+1
2015-11-23skip check for DYLD envars in child procJosh Austin-0/+1
2015-11-22test_inherit_env: Don't look for hidden environment variables on WindowsTobias Bucher-2/+4
Fixes #29972.
2015-11-17std: Use join() in Process::wait_with_outputAlex Crichton-20/+14
Previously this function used channels but this isn't necessary any more now that threads have return values. This also has the added bonus of appropriately waiting for the thread to exit to ensure that the function doesn't still have running threads once it returns.
2015-10-20Rollup merge of #29158 - arcnmx:process-test, r=alexcrichtonSteve Klabnik-1/+1
This test was mysteriously messed with as part of #28500 r? @alexcrichton
2015-10-19Correct spelling in docsAndrew Paseltiner-2/+2
2015-10-19Add missing #[test] attribute to testarcnmx-1/+1
2015-10-13Correct spelling in docsAndrew Paseltiner-1/+1
2015-09-29Tweak Travis to use GCEAlex Crichton-5/+8
Travis CI has new infrastructure using the Google Compute Engine which has both faster CPUs and more memory, and we've been encouraged to switch as it should help our build times! The only downside currently, however, is that IPv6 is disabled, causing a number of standard library tests to fail. Consequently this commit tweaks our travis config in a few ways: * ccache is disabled as it's not working on GCE just yet * Docker is used to run tests inside which reportedly will get IPv6 working * A system LLVM installation is used instead of building LLVM itself. This is primarily done to reduce build times, but we want automation for this sort of behavior anyway and we can extend this in the future with building from source as well if needed. * gcc-specific logic is removed as the docker image for Ubuntu gives us a recent-enough gcc by default.
2015-09-11std: Internalize almost all of `std::rt`Alex Crichton-1/+1
This commit does some refactoring to make almost all of the `std::rt` private. Specifically, the following items are no longer part of its API: * DEFAULT_ERROR_CODE * backtrace * unwind * args * at_exit * cleanup * heap (this is just alloc::heap) * min_stack * util The module is now tagged as `#[doc(hidden)]` as the only purpose it's serve is an entry point for the `panic!` macro via the `begin_unwind` and `begin_unwind_fmt` reexports.
2015-09-02std: Run at_exit cleanup on process::exitAlex Crichton-0/+1
This adds a call to `rt::cleanup` on `process::exit` to make sure we clean up after ourselves on the way out from Rust. Closes #28065
2015-08-04syntax: Don't assume `std` exists for testsAlex Crichton-1/+1
This commit removes the injection of `std::env::args()` from `--test` expanded code, relying on the test runner itself to call this funciton. This is more hygienic because we can't assume that `std` exists at the top layer all the time, and it meaks the injected test module entirely self contained.
2015-07-31Auto merge of #27370 - alexcrichton:stabilize-easy, r=brsonbors-1/+1
The following APIs were all marked with a `#[stable]` tag: * process::Child::id * error::Error::is * error::Error::downcast * error::Error::downcast_ref * error::Error::downcast_mut * io::Error::get_ref * io::Error::get_mut * io::Error::into_inner * hash::Hash::hash_slice * hash::Hasher::write_{i,u}{8,16,32,64,size}
2015-07-29std: Remove the curious inner moduleAlex Crichton-1/+1
This isn't actually necessary any more with the advent of `$crate` and changes in the compiler to expand macros to `::core::$foo` in the context of a `#![no_std]` crate. The libcore inner module was also trimmed down a bit to the bare bones.
2015-07-28std: Stabilize a number of small APIsAlex Crichton-1/+1
The following APIs were all marked with a `#[stable]` tag: * process::Child::id * error::Error::is * error::Error::downcast * error::Error::downcast_ref * error::Error::downcast_mut * io::Error::get_ref * io::Error::get_mut * io::Error::into_inner * hash::Hash::hash_slice * hash::Hasher::write_{i,u}{8,16,32,64,size}
2015-07-27std: Remove msvc/valgrind headersAlex Crichton-11/+2
These aren't really used for anything any more, so there doesn't seem to be much reason to leave them around in the `rt` directory. There was some limiting of threads spawned or tests when run under valgrind, but very little is run under valgrind nowadays so there's also no real use keeping these around.
2015-07-20std: Add IntoRaw{Fd,Handle,Socket} traitsAlex Crichton-1/+17
This commit is an implementation of [RFC 1174][rfc] which adds three new traits to the standard library: * `IntoRawFd` - implemented on Unix for all I/O types (files, sockets, etc) * `IntoRawHandle` - implemented on Windows for files, processes, etc * `IntoRawSocket` - implemented on Windows for networking types [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/1174-into-raw-fd-socket-handle-traits.md Closes #27062
2015-06-22std::process: Remove helper function pwd_cmd from test moduleGeoffrey Thomas-18/+0
The test that used it was removed in 700e627cf727873a472b1876238aac10b932258b.
2015-06-09std: Tweak process raising/lowering implementationsAlex Crichton-13/+28
* Slate these features to be stable in 1.2 instead of 1.1 (not being backported) * Have the `FromRawFd` implementations follow the contract of the `FromRawFd` trait by taking ownership of the primitive specified. * Refactor the implementations slightly to remove the `unreachable!` blocks as well as separating the stdio representation of `std::process` from `std::sys::process`.
2015-06-05Another small grammar fix for process.rsMartin Pool-1/+1
2015-06-05Doc fix for process.rsMartin Pool-1/+1
File handles are inherited from, not by, the parent process
2015-05-29Auto merge of #25494 - alexcrichton:stdio-from-raw, r=aturonbors-41/+58
This commit implements a number of standard traits for the standard library's process I/O handles. The `FromRaw{Fd,Handle}` traits are now implemented for the `Stdio` type and the `AsRaw{Fd,Handle}` traits are now implemented for the `Child{Stdout,Stdin,Stderr}` types. The stability markers for these implementations mention that they are stable for 1.1 as I will nominate this commit for cherry-picking to beta.
2015-05-16std: Implement lowering and raising for process IOAlex Crichton-41/+58
This commit implements a number of standard traits for the standard library's process I/O handles. The `FromRaw{Fd,Handle}` traits are now implemented for the `Stdio` type and the `AsRaw{Fd,Handle}` traits are now implemented for the `Child{Stdout,Stdin,Stderr}` types. Additionally this implements the `AsRawHandle` trait for `Child` on Windows. The stability markers for these implementations mention that they are stable for 1.1 as I will nominate this commit for cherry-picking to beta.
2015-05-16std: Add an unstable method Child::idAlex Crichton-0/+6
This commits adds a method to the `std::process` module to get the process identifier of the child as a `u32`. On Windows the underlying identifier is already a `u32`, and on Unix the type is typically defined as `c_int` (`i32` for almost all our supported platforms), but the actually pid is normally a small positive number. Eventually we may add functions to load information about a process based on its identifier or the ability to terminate a process based on its identifier, but for now this function should enable this sort of functionality to exist outside the standard library.
2015-05-07std: Rename sys::foo2 modules to sys::fooAlex Crichton-6/+6
Now that `std::old_io` has been removed for quite some time the naming real estate here has opened up to allow these modules to move back to their proper names.
2015-04-29Update process.rstynopex-8/+8
Make whitespace consistent
2015-04-29std: Fixup docs for std::processtynopex-13/+16
2015-04-14rollup merge of #24377: apasel422/docsAlex Crichton-4/+4
Conflicts: src/libstd/net/ip.rs src/libstd/sys/unix/fs.rs src/libstd/sys/unix/mod.rs src/libstd/sys/windows/mod.rs
2015-04-14test: Fixup many library unit testsAlex Crichton-39/+0
2015-04-13pluralize doc comment verbs and add missing periodsAndrew Paseltiner-4/+4
2015-04-10Auto merge of #24177 - alexcrichton:rustdoc, r=aturonbors-6/+1
This commit series starts out with more official test harness support for rustdoc tests, and then each commit afterwards adds a test (where appropriate). Each commit should also test and finish independently of all others (they're all pretty separable). I've uploaded a [copy of the documentation](http://people.mozilla.org/~acrichton/doc/std/) generated after all these commits were applied, and a double check on issues being closed would be greatly appreciated! I'll also browse the docs a bit and make sure nothing regressed too horribly.
2015-04-10std: Unconditionally close all file descriptorsAlex Crichton-14/+10
The logic for only closing file descriptors >= 3 was inherited from quite some time ago and ends up meaning that some internal APIs are less consistent than they should be. By unconditionally closing everything entering a `FileDesc` we ensure that we're consistent in our behavior as well as robustly handling the stdio case.
2015-04-09std: Clean up process spawn impl on unixAlex Crichton-1/+1
* De-indent quite a bit by removing usage of FnOnce closures * Clearly separate code for the parent/child after the fork * Use `fs2::{File, OpenOptions}` instead of calling `open` manually * Use RAII to close I/O objects wherever possible * Remove loop for closing all file descriptors, all our own ones are now `CLOEXEC` by default so they cannot be inherited
2015-04-07std: Deny most warnings in doctestsAlex Crichton-6/+1
Allow a few specific ones but otherwise this helps ensure that our examples are squeaky clean! Closes #18199
2015-04-01Update android tests to reflect API switch from `os::env` to `env::vars`.Felix S. Klock II-3/+2
2015-03-31Test fixes and rebase conflicts, round 3Alex Crichton-1/+1
2015-03-31rollup merge of #23919: alexcrichton/stabilize-io-errorAlex Crichton-1/+0
Conflicts: src/libstd/fs/tempdir.rs src/libstd/io/error.rs
2015-03-31std: Stabilize last bits of io::ErrorAlex Crichton-1/+0
This commit stabilizes a few remaining bits of the `io::Error` type: * The `Error::new` method is now stable. The last `detail` parameter was removed and the second `desc` parameter was generalized to `E: Into<Box<Error>>` to allow creating an I/O error from any form of error. Currently there is no form of downcasting, but this will be added in time. * An implementation of `From<&str> for Box<Error>` was added to liballoc to allow construction of errors from raw strings. * The `Error::raw_os_error` method was stabilized as-is. * Trait impls for `Clone`, `Eq`, and `PartialEq` were removed from `Error` as it is not possible to use them with trait objects. This is a breaking change due to the modification of the `new` method as well as the removal of the trait implementations for the `Error` type. [breaking-change]
2015-03-31rollup merge of #23907: alexcrichton/impl-exitAlex Crichton-0/+16
This commit is an implementation of [RFC #1011][rfc] which adds an `exit` function to the standard library for immediately terminating the current process with a specified exit code. [rfc]: https://github.com/rust-lang/rfcs/pull/1011 Closes #23914
2015-03-31std: Clean out #[deprecated] APIsAlex Crichton-28/+24
This commit cleans out a large amount of deprecated APIs from the standard library and some of the facade crates as well, updating all users in the compiler and in tests as it goes along.
2015-03-31std: Add a process::exit functionAlex Crichton-0/+16
This commit is an implementation of [RFC #1011][rfc] which adds an `exit` function to the standard library for immediately terminating the current process with a specified exit code. [rfc]: https://github.com/rust-lang/rfcs/pull/1011
2015-03-26syntax: Remove support for #[should_fail]Alex Crichton-1/+1
This attribute has been deprecated in favor of #[should_panic]. This also updates rustdoc to no longer accept the `should_fail` directive and instead renames it to `should_panic`.
2015-03-25Ignore some tests on aarch64Sae-bom Kim-0/+1
2015-03-23Test fixes and rebase conflicts, round 2Alex Crichton-1/+1
2015-03-23Add generic conversion traitsAaron Turon-3/+3
This commit: * Introduces `std::convert`, providing an implementation of RFC 529. * Deprecates the `AsPath`, `AsOsStr`, and `IntoBytes` traits, all in favor of the corresponding generic conversion traits. Consequently, various IO APIs now take `AsRef<Path>` rather than `AsPath`, and so on. Since the types provided by `std` implement both traits, this should cause relatively little breakage. * Deprecates many `from_foo` constructors in favor of `from`. * Changes `PathBuf::new` to take no argument (creating an empty buffer, as per convention). The previous behavior is now available as `PathBuf::from`. * De-stabilizes `IntoCow`. It's not clear whether we need this separate trait. Closes #22751 Closes #14433 [breaking-change]
2015-03-20std: Remove old_io/old_path from the preludeAlex Crichton-2/+2
This commit removes the reexports of `old_io` traits as well as `old_path` types and traits from the prelude. This functionality is now all deprecated and needs to be removed to make way for other functionality like `Seek` in the `std::io` module (currently reexported as `NewSeek` in the io prelude). Closes #23377 Closes #23378
2015-03-19std: Stablize io::ErrorKindAlex Crichton-1/+1
This commit stabilizes the `ErrorKind` enumeration which is consumed by and generated by the `io::Error` type. The purpose of this type is to serve as a cross-platform namespace to categorize errors into. Two specific issues are addressed as part of this stablization: * The naming of each variant was scrutinized and some were tweaked. An example is how `FileNotFound` was renamed to simply `NotFound`. These names should not show either a Unix or Windows bias and the set of names is intended to grow over time. For now the names will likely largely consist of those errors generated by the I/O APIs in the standard library. * The mapping of OS error codes onto kinds has been altered. Coalescing no longer occurs (multiple error codes become one kind). It is intended that each OS error code, if bound, corresponds to only one `ErrorKind`. The current set of error kinds was expanded slightly to include some networking errors. This commit also adds a `raw_os_error` function which returns an `Option<i32>` to extract the underlying raw error code from the `Error`.
2015-03-16remove importsJorge Aparicio-1/+1
2015-03-16impl strJorge Aparicio-1/+1