Skip to content
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

Merged
merged 1 commit into from
Sep 16, 2020

Conversation

adamlesinski
Copy link

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.

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.
@rust-highfive
Copy link
Collaborator

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.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 15, 2020
@@ -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
Copy link
Member

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"?

Copy link
Author

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.

@Mark-Simulacrum
Copy link
Member

r? @tmandry perhaps?

@tmandry
Copy link
Member

tmandry commented Sep 15, 2020

Looks good, thanks!

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Sep 15, 2020

📌 Commit fafb2e9 has been approved by tmandry

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 15, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 16, 2020
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`
@adamlesinski
Copy link
Author

I see the "Merging is blocked" message due to unauthorized users. How to proceed?

@Mark-Simulacrum
Copy link
Member

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).

@bors bors merged commit ab20774 into rust-lang:master Sep 16, 2020
@rustbot rustbot added this to the 1.48.0 milestone Sep 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants