-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rollup of 12 pull requests #83286
Rollup of 12 pull requests #83286
Commits on Feb 21, 2021
-
Configuration menu - View commit details
-
Copy full SHA for f45fe94 - Browse repository at this point
Copy the full SHA f45fe94View commit details
Commits on Feb 24, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 2cbea9f - Browse repository at this point
Copy the full SHA 2cbea9fView commit details
Commits on Mar 4, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 8c718bd - Browse repository at this point
Copy the full SHA 8c718bdView commit details
Commits on Mar 5, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 0201e2b - Browse repository at this point
Copy the full SHA 0201e2bView commit details -
Configuration menu - View commit details
-
Copy full SHA for a2571cf - Browse repository at this point
Copy the full SHA a2571cfView commit details
Commits on Mar 11, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 302867c - Browse repository at this point
Copy the full SHA 302867cView commit details
Commits on Mar 15, 2021
-
Add Linux-specific pidfd process extensions
Background: Over the last year, pidfd support was added to the Linux kernel. This allows interacting with other processes. In particular, this allows waiting on a child process with a timeout in a race-free way, bypassing all of the awful signal-handler tricks that are usually required. Pidfds can be obtained for a child process (as well as any other process) via the `pidfd_open` syscall. Unfortunately, this requires several conditions to hold in order to be race-free (i.e. the pid is not reused). Per `man pidfd_open`: ``` · the disposition of SIGCHLD has not been explicitly set to SIG_IGN (see sigaction(2)); · the SA_NOCLDWAIT flag was not specified while establishing a han‐ dler for SIGCHLD or while setting the disposition of that signal to SIG_DFL (see sigaction(2)); and · the zombie process was not reaped elsewhere in the program (e.g., either by an asynchronously executed signal handler or by wait(2) or similar in another thread). If any of these conditions does not hold, then the child process (along with a PID file descriptor that refers to it) should instead be created using clone(2) with the CLONE_PIDFD flag. ``` Sadly, these conditions are impossible to guarantee once any libraries are used. For example, C code runnng in a different thread could call `wait()`, which is impossible to detect from Rust code trying to open a pidfd. While pid reuse issues should (hopefully) be rare in practice, we can do better. By passing the `CLONE_PIDFD` flag to `clone()` or `clone3()`, we can obtain a pidfd for the child process in a guaranteed race-free manner. This PR: This PR adds Linux-specific process extension methods to allow obtaining pidfds for processes spawned via the standard `Command` API. Other than being made available to user code, the standard library does not make use of these pidfds in any way. In particular, the implementation of `Child::wait` is completely unchanged. Two Linux-specific helper methods are added: `CommandExt::create_pidfd` and `ChildExt::pidfd`. These methods are intended to serve as a building block for libraries to build higher-level abstractions - in particular, waiting on a process with a timeout. I've included a basic test, which verifies that pidfds are created iff the `create_pidfd` method is used. This test is somewhat special - it should always succeed on systems with the `clone3` system call available, and always fail on systems without `clone3` available. I'm not sure how to best ensure this programatically. This PR relies on the newer `clone3` system call to pass the `CLONE_FD`, rather than the older `clone` system call. `clone3` was added to Linux in the same release as pidfds, so this shouldn't unnecessarily limit the kernel versions that this code supports. Unresolved questions: * What should the name of the feature gate be for these newly added methods? * Should the `pidfd` method distinguish between an error occurring and `create_pidfd` not being called?
Configuration menu - View commit details
-
Copy full SHA for 5e788f2 - Browse repository at this point
Copy the full SHA 5e788f2View commit details -
Co-authored-by: bjorn3 <bjorn3@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for 3426bf7 - Browse repository at this point
Copy the full SHA 3426bf7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 704d6c5 - Browse repository at this point
Copy the full SHA 704d6c5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 766cc25 - Browse repository at this point
Copy the full SHA 766cc25View commit details -
Configuration menu - View commit details
-
Copy full SHA for d850f6b - Browse repository at this point
Copy the full SHA d850f6bView commit details
Commits on Mar 16, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 5ac8a31 - Browse repository at this point
Copy the full SHA 5ac8a31View commit details -
Configuration menu - View commit details
-
Copy full SHA for a266bd8 - Browse repository at this point
Copy the full SHA a266bd8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 22f2548 - Browse repository at this point
Copy the full SHA 22f2548View commit details -
Configuration menu - View commit details
-
Copy full SHA for cfb2d72 - Browse repository at this point
Copy the full SHA cfb2d72View commit details
Commits on Mar 17, 2021
-
Move some test-only code to test files
This also relaxes the bounds on some structs and moves them to the impl block instead.
Configuration menu - View commit details
-
Copy full SHA for 620ecc0 - Browse repository at this point
Copy the full SHA 620ecc0View commit details -
Fix gitattibutes for old git versions
Jethro Beekman committedMar 17, 2021 Configuration menu - View commit details
-
Copy full SHA for b1de9d4 - Browse repository at this point
Copy the full SHA b1de9d4View commit details
Commits on Mar 18, 2021
-
Configuration menu - View commit details
-
Copy full SHA for cfb4ad4 - Browse repository at this point
Copy the full SHA cfb4ad4View commit details -
Extend
proc_macro_back_compat
lint toactix-web
Unlike the other cases of this lint, there's no simple way to detect if an old version of the relevant crate (`syn`) is in use. The `actix-web` crate only depends on `pin-project` v1.0.0, so checking the version of `actix-web` does not guarantee that a new enough version of `pin-project` (and therefore `syn`) is in use. Instead, we rely on the fact that virtually all of the regressed crates are pinned to a pre-1.0 version of `pin-project`. When this is the case, bumping the `actix-web` dependency will pull in the *latest* version of `pin-project`, which has an explicit dependency on a newer v dependency on a newer version of `syn`. The lint message tells users to update `actix-web`, since that's what they're most likely to have control over. We could potentially tell them to run `cargo update -p syn`, but I think it's more straightforward to suggest an explicit change to the `Cargo.toml` The `actori-web` fork had its last commit over a year ago, and appears to just be a renamed fork of `actix-web`. Therefore, I've removed the `actori-web` check entirely - any crates that actually get broken can simply update `syn` themselves.
Configuration menu - View commit details
-
Copy full SHA for 390d1ef - Browse repository at this point
Copy the full SHA 390d1efView commit details -
Fix typo/inaccuracy in the documentation of Iterator::skip_while
One of the examples used to say “this leads to a possibly confusing situation, where the type of the closure is a double reference” while _actually_ referring to the type of the closure _argument_.
Configuration menu - View commit details
-
Copy full SHA for 99b2054 - Browse repository at this point
Copy the full SHA 99b2054View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9dfda62 - Browse repository at this point
Copy the full SHA 9dfda62View commit details
Commits on Mar 19, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 4238a8f - Browse repository at this point
Copy the full SHA 4238a8fView commit details -
Rollup merge of rust-lang#71780 - jcotton42:string_remove_matches, r=…
…joshtriplett Implement String::remove_matches Closes rust-lang#50206. I lifted the function help from `@frewsxcv's` original PR (rust-lang#50015), hope they don't mind. I'm also wondering whether it would be useful for `remove_matches` to collect up the removed substrings into a `Vec` and return them, right now they're just overwritten by the copy and lost.
Configuration menu - View commit details
-
Copy full SHA for 2523b66 - Browse repository at this point
Copy the full SHA 2523b66View commit details -
Rollup merge of rust-lang#81825 - voidc:pidfd, r=joshtriplett
Add Linux-specific pidfd process extensions (take 2) Continuation of rust-lang#77168. I addressed the following concerns from the original PR: - make `CommandExt` and `ChildExt` sealed traits - wrap file descriptors in `PidFd` struct representing ownership over the fd - add `take_pidfd` to take the fd out of `Child` - close fd when dropped Tracking Issue: rust-lang#82971
Configuration menu - View commit details
-
Copy full SHA for 7c079e0 - Browse repository at this point
Copy the full SHA 7c079e0View commit details -
Rollup merge of rust-lang#82374 - clehner:licenses, r=joshtriplett
Add license metadata for std dependencies These five crates are in the dependency tree of `std` but lack license metadata: - `alloc` - `core` - `panic_abort` - `panic_unwind` - `unwind` Querying the dependency tree of `std` is a useful thing to be able to do, since these crates will typically be linked into Rust binaries. Tools show the license fields missing, as seen in rust-lang#67014 (comment). This PR adds the license field for the five crates, based on the license of the `std` package and this repo as a whole. I also added the `repository` and `descriptions` fields, since those seem useful. For `description`, I copied text from top-level comments for the respective modules - except for `unwind` which has none. I also note that rust-lang#73530 attempted to add license metadata for all crates in this repo, but was rejected because there was question about some of them. I hope that this smaller change, focusing only on the runtime dependencies, will be easier to review. cc ``@Mark-Simulacrum`` ``@Lokathor``
Configuration menu - View commit details
-
Copy full SHA for ad8c628 - Browse repository at this point
Copy the full SHA ad8c628View commit details -
Rollup merge of rust-lang#82500 - CDirkx:hermit-pipe, r=joshtriplett
Reuse `std::sys::unsupported::pipe` on `hermit` Pipes are not supported on `hermit` and `hermit/pipe.rs` is identical to `unsupported/pipe.rs`. This PR reduces duplication between the two by doing the following on `hermit`: ```rust #[path = "../unsupported/pipe.rs"] pub mod pipe; ```
Configuration menu - View commit details
-
Copy full SHA for b567cd1 - Browse repository at this point
Copy the full SHA b567cd1View commit details -
Rollup merge of rust-lang#82754 - rylev:rusage-windows, r=pnkfelix
Attempt to gather similar stats as rusage on Windows A follow up to rust-lang#82532. This is a bit hacked in because I think we need to discuss this before merging, but this is an attempt to gather similar metrics as `libc::rusage` on Windows. Some comments on differences: * Currently, we're passing `RUSAGE_CHILDREN` to `rusage` which collects statistics on all children that have been waited on and terminated. I believe this is currently just the invocation of the real `rustc` that the shim is wrapping. Does `rustc` itself spawn children processes? The windows version gets the child processes handle when spawning it, and uses that to collect the statistics. For maxrss, `rusage` will return "the resident set size of the largest child, not the maximum resident set size of the process tree.", the Windows version will only collect statistics on the wrapped `rustc` child process directly even if some theoretical sub process has a larger memory footprint. * There might be subtle differences between `rusage`'s "resident set" and Window's "working set". The "working set" and "resident set" should both be the number of pages that are in memory and which would not cause a page fault when accessed. * I'm not yet sure how best to get the same information that `ru_minflt`, `ru_inblock`, `ru_oublock`, `ru_nivcsw ` and `ru_nvcsw` provide. r? ```@pnkfelix```
Configuration menu - View commit details
-
Copy full SHA for 3ce28b6 - Browse repository at this point
Copy the full SHA 3ce28b6View commit details -
Rollup merge of rust-lang#82759 - m-ou-se:remove-unwrap-none, r=petro…
…chenkov Remove unwrap_none/expect_none from compiler/. We're not going to stabilize `Option::{unwrap_none, expect_none}`. (See rust-lang#62633.) This removes the usage of those unstable methods from `compiler/`.
Configuration menu - View commit details
-
Copy full SHA for 25fc5f0 - Browse repository at this point
Copy the full SHA 25fc5f0View commit details -
Rollup merge of rust-lang#82892 - jix:clarify-read-read, r=joshtriplett
Clarify docs for Read::read's return value Right now the docs for `Read::read`'s return value are phrased in a way that makes it easy for the reader to assume that the return value is never larger than the passed buffer. This PR clarifies that this is a requirement for implementations of the trait, but that callers have to expect a buggy yet safe implementation failing to do so, especially if unchecked accesses to the buffer are done afterwards. I fell into this trap recently, and when I noticed, I looked at the docs again and had the feeling that I might not have been the first one to miss this. The same issue of trusting the return value of `read` was also present in std itself for about 2.5 years and only fixed recently, see rust-lang#80895. I hope that clarifying the docs might help others to avoid this issue.
Configuration menu - View commit details
-
Copy full SHA for fc30f2b - Browse repository at this point
Copy the full SHA fc30f2bView commit details -
Rollup merge of rust-lang#83179 - Aaron1011:actix-web-lint, r=petroch…
…enkov Extend `proc_macro_back_compat` lint to `actix-web` Unlike the other cases of this lint, there's no simple way to detect if an old version of the relevant crate (`syn`) is in use. The `actix-web` crate only depends on `pin-project` v1.0.0, so checking the version of `actix-web` does not guarantee that a new enough version of `pin-project` (and therefore `syn`) is in use. Instead, we rely on the fact that virtually all of the regressed crates are pinned to a pre-1.0 version of `pin-project`. When this is the case, bumping the `actix-web` dependency will pull in the *latest* version of `pin-project`, which has an explicit dependency on a newer v dependency on a newer version of `syn`. The lint message tells users to update `actix-web`, since that's what they're most likely to have control over. We could potentially tell them to run `cargo update -p syn`, but I think it's more straightforward to suggest an explicit change to the `Cargo.toml` The `actori-web` fork had its last commit over a year ago, and appears to just be a renamed fork of `actix-web`. Therefore, I've removed the `actori-web` check entirely - any crates that actually get broken can simply update `syn` themselves.
Configuration menu - View commit details
-
Copy full SHA for c1b8cb2 - Browse repository at this point
Copy the full SHA c1b8cb2View commit details -
Rollup merge of rust-lang#83197 - jyn514:cfg-test-dead-code, r=joshtr…
…iplett Move some test-only code to test files Split out from rust-lang#83185.
Configuration menu - View commit details
-
Copy full SHA for e62250b - Browse repository at this point
Copy the full SHA e62250bView commit details -
Rollup merge of rust-lang#83201 - klensy:checkout-v2, r=pietroalbini
use checkout@v2 in CI for master Updates CI workflow to use checkout@v2 from v1 (as other parts of CI) for master, plus slightly faster checkout as result compare v2 https://github.com/rust-lang-ci/rust/commit/2ccf06302c08d7d4911aad40e66a9a3ee731c6f9/checks/2113902859/logs and v1 logs https://github.com/rust-lang-ci/rust/commit/2ccf06302c08d7d4911aad40e66a9a3ee731c6f9/checks/2115229351/logs
Configuration menu - View commit details
-
Copy full SHA for 682eace - Browse repository at this point
Copy the full SHA 682eaceView commit details -
Rollup merge of rust-lang#83208 - jethrogb:jb/gitignore, r=Xanewok
Fix gitattibutes for old git versions
Configuration menu - View commit details
-
Copy full SHA for d503b69 - Browse repository at this point
Copy the full SHA d503b69View commit details -
Rollup merge of rust-lang#83270 - steffahn:missing_word_in_skip_while…
…_doc, r=joshtriplett Fix typo/inaccuracy in the documentation of Iterator::skip_while One of the examples used to say “this leads to a possibly confusing situation, where the type of the closure is a double reference” while _actually_ referring to the type of the closure _argument_. This PR just changes a single word in documentation. `@rustbot` modify labels: A-iterators, T-doc, T-lang
Configuration menu - View commit details
-
Copy full SHA for 810db68 - Browse repository at this point
Copy the full SHA 810db68View commit details