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

Vxworks / Unix deduplication #77666

Merged
merged 18 commits into from
Oct 16, 2020

Conversation

m-ou-se
Copy link
Member

@m-ou-se m-ou-se commented Oct 7, 2020

sys/vxworks was almost entirely an (outdated) copy of sys/unix. I went through every file to check the differences and tried to figure out if they were simply outdated or intentional differences between unix and vxworks. Most of them did not have any vxworks-specific changes, so are deleted. I've added some minor cfg(target_os = "vxworks")-specific things to sys/unix to allow for deduplication.

Before this change, the vxworks target didn't compile because its outdated process implementation did not match the expected interface anymore. This also fixes that: std compiles again for x86_64-wrs-vxworks.

It's probably good to merge sys/vxworks entirely into sys/unix, but it might be better to to that in a follow-up PR.

@rustbot modify labels: +T-libs +C-cleanup

@rustbot rustbot added C-cleanup Category: PRs that clean code up or issues documenting cleanup. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Oct 7, 2020
@rust-highfive
Copy link
Collaborator

r? @dtolnay

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 7, 2020
@m-ou-se
Copy link
Member Author

m-ou-se commented Oct 7, 2020

Cc @BaoshanPang

@tesuji
Copy link
Contributor

tesuji commented Oct 8, 2020

This is nice, however there is no CI for Vxworks (tier 3).

@m-ou-se
Copy link
Member Author

m-ou-se commented Oct 8, 2020

there is no CI for Vxworks (tier 3)

Yup, I noticed. std didn't even build for vxworks before this PR. At least it builds now.

Keeping an oudated copy of sys/unix around is pretty annoying, as changes to sys now need to be applied to two slightly different copies of sys/unix. For example, #77674, #76651, etc. (Or not, but then the problem just becomes bigger over time as it becomes more outdated.)

@bors
Copy link
Contributor

bors commented Oct 9, 2020

☔ The latest upstream changes (presumably #77674) made this pull request unmergeable. Please resolve the merge conflicts.

Note that reviewers usually do not review pull requests until merge conflicts are resolved! Once you resolve the conflicts, you should change the labels applied by bors to indicate that your PR is ready for review. Post this as a comment to change the labels:

@rustbot modify labels: +S-waiting-on-review -S-waiting-on-author

@m-ou-se m-ou-se force-pushed the vxworks-cleanup branch 2 times, most recently from 618340e to 7592d97 Compare October 9, 2020 22:22
@m-ou-se m-ou-se mentioned this pull request Oct 12, 2020
Copy link
Member

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Accepting without particular scrutiny beyond confirming that every thing changed in the PR is gated with target_os = "vxworks".

@dtolnay
Copy link
Member

dtolnay commented Oct 15, 2020

@bors r+

@bors
Copy link
Contributor

bors commented Oct 15, 2020

📌 Commit 7592d97c1213273b80337324049082cd3c9315ca has been approved by dtolnay

@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 Oct 15, 2020
@bors
Copy link
Contributor

bors commented Oct 16, 2020

☔ The latest upstream changes (presumably #78001) made this pull request unmergeable. Please resolve the merge conflicts.

Note that reviewers usually do not review pull requests until merge conflicts are resolved! Once you resolve the conflicts, you should change the labels applied by bors to indicate that your PR is ready for review. Post this as a comment to change the labels:

@rustbot modify labels: +S-waiting-on-review -S-waiting-on-author

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 16, 2020
@m-ou-se
Copy link
Member Author

m-ou-se commented Oct 16, 2020

@rustbot modify labels: +S-waiting-on-review -S-waiting-on-author

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 16, 2020
@dtolnay
Copy link
Member

dtolnay commented Oct 16, 2020

@bors r+

@bors
Copy link
Contributor

bors commented Oct 16, 2020

📌 Commit 0f0257b has been approved by dtolnay

@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 Oct 16, 2020
@bors
Copy link
Contributor

bors commented Oct 16, 2020

⌛ Testing commit 0f0257b with merge 95b4a4f...

@bors
Copy link
Contributor

bors commented Oct 16, 2020

☀️ Test successful - checks-actions, checks-azure
Approved by: dtolnay
Pushing 95b4a4f to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Oct 16, 2020
@bors bors merged commit 95b4a4f into rust-lang:master Oct 16, 2020
@rustbot rustbot added this to the 1.49.0 milestone Oct 16, 2020
@m-ou-se m-ou-se deleted the vxworks-cleanup branch April 12, 2021 14:38
m-ou-se added a commit to m-ou-se/rust that referenced this pull request Apr 21, 2021
Move `sys::vxworks` code to `sys::unix`

Follow-up to rust-lang#77666, `sys::vxworks` is almost identical to `sys::unix`, the only differences are the `rand`, `thread_local_dtor`, and `process` implementation. Since `vxworks` is `target_family = unix` anyway, there is no reason for the code not to live inside of `sys::unix` like all the other unix-OSes.

https://github.com/rust-lang/rust/blob/e41f378f825488a537b024fc3ed599d9c12fda96/compiler/rustc_target/src/spec/vxworks_base.rs#L12

`@rustbot` label: +T-libs-impl
m-ou-se added a commit to m-ou-se/rust that referenced this pull request Apr 21, 2021
Move `sys::vxworks` code to `sys::unix`

Follow-up to rust-lang#77666, `sys::vxworks` is almost identical to `sys::unix`, the only differences are the `rand`, `thread_local_dtor`, and `process` implementation. Since `vxworks` is `target_family = unix` anyway, there is no reason for the code not to live inside of `sys::unix` like all the other unix-OSes.

https://github.com/rust-lang/rust/blob/e41f378f825488a537b024fc3ed599d9c12fda96/compiler/rustc_target/src/spec/vxworks_base.rs#L12

``@rustbot`` label: +T-libs-impl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup. merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants