Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

changes for vxworks #146073

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

Open
Anupamvashistha2002 wants to merge 1 commit into rust-lang:master
base: master
Choose a base branch
Loading
from Anupamvashistha2002:av_stdlib_changes

Conversation

Copy link

@Anupamvashistha2002 Anupamvashistha2002 commented Sep 1, 2025
edited
Loading

Summary

This PR improves support for the vxworks target in the Rust standard library by fixing platform-specific issues and ensuring better compatibility with VxWorks.

These changes are isolated to vxworks and do not affect other platforms.

Notes

Tested manually on a VxWorks environment. Feedback on potential edge cases or additional tests would be appreciated.

Copy link
Collaborator

rustbot commented Sep 1, 2025

r? @ibraheemdev

rustbot has assigned @ibraheemdev.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added O-unix Operating system: Unix-like S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Sep 1, 2025
Copy link
Collaborator

The job tidy failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
##[endgroup]
[TIMING:end] tool::ToolBuild { build_compiler: Compiler { stage: 0, host: x86_64-unknown-linux-gnu, forced_compiler: false }, target: x86_64-unknown-linux-gnu, tool: "tidy", path: "src/tools/tidy", mode: ToolBootstrap, source_type: InTree, extra_features: [], allow_features: "", cargo_args: [], artifact_kind: Binary } -- 11.121
[TIMING:end] tool::Tidy { compiler: Compiler { stage: 0, host: x86_64-unknown-linux-gnu, forced_compiler: false }, target: x86_64-unknown-linux-gnu } -- 0.000
fmt check
Diff in /checkout/library/std/src/fs/tests.rs:802:
 let canary = tmpdir.join("do_not_delete");
 check!(check!(File::create(&canary)).write(b"foo"));
 let result = fs::remove_dir_all(&canary);
- #[cfg(all(not(target_os = "vxworks"),unix))]
+ #[cfg(all(not(target_os = "vxworks"), unix))]
 error!(result, "Not a directory");
 #[cfg(target_os = "vxworks")]
 error!(result, "not a directory");
fmt: checked 6344 files
Bootstrap failed while executing `test src/tools/tidy tidyselftest --extra-checks=py,cpp,js,spellcheck`
Build completed unsuccessfully in 0:00:48
 local time: Mon Sep 1 05:22:38 UTC 2025
 network time: 2025年9月01日 05:22:38 GMT

@@ -21,7 +21,7 @@ macro_rules! or_panic {
}

#[test]
#[cfg_attr(target_os = "android", ignore)] // Android SELinux rules prevent creating Unix sockets
#[cfg_attr(any(target_os = "vxworks", target_os = "android"), ignore)]
Copy link
Contributor

@folkertdev folkertdev Sep 1, 2025

Choose a reason for hiding this comment

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

Can you make these look like this, with some reasoning for why this test is ignored on vxworks (is there a fundamental reason, is it just not implemented yet, etc)?

Suggested change
#[cfg_attr(any(target_os = "vxworks", target_os = "android"), ignore)]
#[cfg_attr(target_os = "android", ignore = "Android SELinux rules prevent creating Unix sockets")]
#[cfg_attr(target_os = "vxworks", ignore = "...")]

Comment on lines +805 to +808
#[cfg(all(not(target_os = "vxworks"),unix))]
error!(result, "Not a directory");
#[cfg(target_os = "vxworks")]
error!(result, "not a directory");
Copy link
Contributor

@folkertdev folkertdev Sep 1, 2025

Choose a reason for hiding this comment

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

This is cleaner as a cfg_select!, e.g.

Suggested change
#[cfg(all(not(target_os = "vxworks"),unix))]
error!(result, "Not a directory");
#[cfg(target_os = "vxworks")]
error!(result, "not a directory");
cfg_select! {
target_os = "vxworks" => {
error!(result, "not a directory");
}
unix => {
error!(result, "Not a directory");
}
windows => {
error!(result, 267); // ERROR_DIRECTORY - The directory name is invalid.
}
_ => {
// all good.
}
}

Copy link
Contributor

tgross35 commented Sep 1, 2025

changes for vxworks

This PR improves support for the vxworks target in the Rust standard library by fixing platform-specific issues and ensuring better compatibility with VxWorks.

These changes are isolated to vxworks and do not affect other platforms

This description restates in four different ways that it improves vxworks support, but gives no indication of what it changes or why that is. Please make sure it’s easy for reviewers to understand what is going on, even "Ignore X-related tests that currently fail on VxWorks" is more useful.

Pinging target maintainer @biabbas for review

Copy link
Contributor

@biabbas biabbas left a comment
edited
Loading

Choose a reason for hiding this comment

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

  1. The change to the error string in concurrent recursive mkdir test is a valid change. But it is better done in the suggested way.
  2. Af_unix mechanism is not supported on vxworks. Hence the Unix datagram tests should be ignored. Specifying this reason in the cfg attribute as suggested would be better. Also, Don't remove the comments specified for the android selinux target.

View changes since this review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@folkertdev folkertdev folkertdev left review comments

+1 more reviewer

@biabbas biabbas biabbas requested changes

Reviewers whose approvals may not affect merge requirements
Labels
O-unix Operating system: Unix-like S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /