-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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 10 pull requests #83279
Rollup of 10 pull requests #83279
Commits on Dec 14, 2020
-
Configuration menu - View commit details
-
Copy full SHA for ab154fd - Browse repository at this point
Copy the full SHA ab154fdView 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 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 -
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 0ef2b5e - Browse repository at this point
Copy the full SHA 0ef2b5eView commit details -
Rollup merge of rust-lang#79986 - GuillaumeGomez:build-help-when-need…
…ed, r=Nemo157 Only build help popup when it's really needed When working on rust-lang#79985, I realized that the help popup was built even when it wasn't needed. This PR only makes the help popup to be built when required. r? `@jyn514`
Configuration menu - View commit details
-
Copy full SHA for c28d8d2 - Browse repository at this point
Copy the full SHA c28d8d2View 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 717b6c4 - Browse repository at this point
Copy the full SHA 717b6c4View 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 0531012 - Browse repository at this point
Copy the full SHA 0531012View 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 6f5015a - Browse repository at this point
Copy the full SHA 6f5015aView 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 aea804f - Browse repository at this point
Copy the full SHA aea804fView 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 482d7bc - Browse repository at this point
Copy the full SHA 482d7bcView 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 138c057 - Browse repository at this point
Copy the full SHA 138c057View 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 3721111 - Browse repository at this point
Copy the full SHA 3721111View 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 6f61327 - Browse repository at this point
Copy the full SHA 6f61327View commit details