-
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
[fuchsia] Propagate the userspace UTC clock #76758
Conversation
On Fuchsia, spawning a subprocess does not automatically clone all of the parent process' capabilities. UTC time on Fuchsia is managed by a top-level userspace clock capability that is cloned and passed to subprocesses. This change ensures that any Rust subprocess gets access to the UTC clock, if the parent had access to it. This is critical for tests, which on Fuchsia, use panic=abort and spawn subprocesses per test.
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Mark-Simulacrum (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
@@ -118,7 +118,8 @@ impl Command { | |||
FDIO_SPAWN_CLONE_JOB | |||
| FDIO_SPAWN_CLONE_LDSVC | |||
| FDIO_SPAWN_CLONE_NAMESPACE | |||
| FDIO_SPAWN_CLONE_ENVIRON, // this is ignored when envp is non-null | |||
| FDIO_SPAWN_CLONE_ENVIRON // this is ignored when envp is non-null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pre-existing, but is this comment perhaps wrong and should say "ignored when null"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the comment as-is is accurate. The flag is ignored if envp is set, meaning that an explicit environment is passed in. Otherwise, the FDIO_SPAWN_CLONE_ENVIRON flag clones the current process' environment.
r? @tmandry perhaps? |
Looks good, thanks! @bors r+ rollup |
📌 Commit fafb2e9 has been approved by |
Rollup of 16 pull requests Successful merges: - rust-lang#75026 (Add array_windows fn) - rust-lang#76642 (Do not lint ignored private doc tests) - rust-lang#76719 (Change error message for ty param in const) - rust-lang#76721 (Use intra-doc links in `core::mem`) - rust-lang#76728 (Add a comment why `extern crate` is necessary for rustdoc) - rust-lang#76735 (Remove unnecessary `clone()`s in bootstrap) - rust-lang#76741 (Avoid printing dry run timings) - rust-lang#76747 (Add missing code examples in libcore) - rust-lang#76756 (fix a couple of stylistic clippy warnings) - rust-lang#76758 ([fuchsia] Propagate the userspace UTC clock) - rust-lang#76759 (Fix stabilization marker for future_readiness_fns) - rust-lang#76760 (don't lazily evaluate some trivial values for Option::None replacements (clippy::unnecessary_lazy_evaluations)) - rust-lang#76764 (Update books) - rust-lang#76775 (Strip a single leading tab when rendering dataflow diffs) - rust-lang#76778 (Simplify iter fuse struct doc) - rust-lang#76794 (Make graphviz font configurable) Failed merges: r? `@ghost`
I see the "Merging is blocked" message due to unauthorized users. How to proceed? |
This is in queue to be merged -- see https://bors.rust-lang.org/homu/queue/rust -- and will do so automatically by our automation (unless tests or build fails). |
On Fuchsia, spawning a subprocess does not automatically
clone all of the parent process' capabilities. UTC time on
Fuchsia is managed by a top-level userspace clock capability
that is cloned and passed to subprocesses.
This change ensures that any Rust subprocess gets access to the
UTC clock, if the parent had access to it. This is critical for
tests, which on Fuchsia, use panic=abort and spawn subprocesses
per test.