-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Fix stat module compilation for Redox OS #5857
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
Conversation
WalkthroughThe conditional compilation logic for the Changes
Sequence Diagram(s)sequenceDiagram
participant RustPython
participant OS
RustPython->>OS: Detect target_os
alt Unix and not Android and not Redox
RustPython->>stat.rs: Use libc S_IWRITE/S_IEXEC
else Android or not Unix or Redox
RustPython->>stat.rs: Use fallback octal values (0o0200, 0o0100)
end
Assessment against linked issues
Assessment against linked issues: Out-of-scope changesNo out-of-scope changes were found. Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (2)📓 Common learnings
vm/src/stdlib/stat.rs (3)
🔇 Additional comments (2)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
We probably need to fix S_IREAD as well. I'm not entirely sure why S_IWRITE and S_IEXEC would be needed, but I think you should avoid them if you can. And why are S_IRUSR, S_IWUSR and S_IXUSR all defined numerically (no libc::) but S_IREAD, S_IWRITE and S_IEXEC are defined using libc:: which will break on many Unixes. Why not define them in terms of S_IRUSR, S_IWUSR, and S_IXUSR? |
I'm not quite understand about The python constants is already using |
Yes, I reviewed the original code a little more, and I think a better fix would be to just define S_IREAD, S_IWRITE and S_IEXEC either in terms of S_IRUSR, S_IWUSR and S_IXUSR, or define them numerically always, as was done for the S_I{R,W,X}USR constants. |
Thank you! We currently disabled redox CI due to broken github action https://github.com/RustPython/RustPython/blob/main/.github/workflows/ci.yaml#L226-L232 Could someone help to fix it? Then this kind of breakage will be prevented |
I wish I can but currently redoxer itself is broken against recent kernel and the current CI always uses the new kernel. We'll figure out a way to fix it. Thanks for mentioning the CI 👍 |
Fixes #5856
The replacement constants is exist for redox and should be working: https://github.com/rust-lang/libc/blob/main/src/unix/redox/mod.rs
Summary by CodeRabbit