-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Display logo on windows executable #5790
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
Warning Rate limit exceeded@arihant2math has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 6 minutes and 27 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
""" WalkthroughA build script ( Changes
Sequence Diagram(s)sequenceDiagram
participant Cargo Build
participant build.rs
participant winresource
Cargo Build->>build.rs: Execute build script
build.rs->>build.rs: Check CARGO_CFG_TARGET_OS
alt Target is Windows
build.rs->>winresource: Create Windows resource object
build.rs->>build.rs: Check for logo.ico existence
alt logo.ico exists
build.rs->>winresource: Set icon to logo.ico
build.rs->>winresource: Compile resource
winresource-->>build.rs: Compilation result
else logo.ico missing
build.rs-->>Cargo Build: Print warning, skip icon embedding
end
alt Compilation error
build.rs-->>Cargo Build: Print warning with error
end
else Not Windows
build.rs-->>Cargo Build: Skip resource embedding
end
Poem
✨ 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 (
|
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.
Actionable comments posted: 5
🧹 Nitpick comments (1)
build.rs (1)
1-7
: Consider using cfg attribute for better platform targeting.While the current implementation works, using Rust's cfg attribute would be more idiomatic and potentially more efficient.
fn main() { - if std::env::var("CARGO_CFG_TARGET_OS").unwrap() == "windows" { + #[cfg(target_os = "windows")] + { let mut res = winresource::WindowsResource::new(); - res.set_icon("logo.ico"); - res.compile().unwrap(); + if std::path::Path::new("logo.ico").exists() { + res.set_icon("logo.ico"); + if let Err(e) = res.compile() { + println!("cargo:warning=Failed to compile Windows resources: {}", e); + } + } else { + println!("cargo:warning=logo.ico not found, skipping icon embedding"); + } } }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
Cargo.lock
is excluded by!**/*.lock
logo.ico
is excluded by!**/*.ico
📒 Files selected for processing (2)
Cargo.toml
(1 hunks)build.rs
(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
PR: RustPython/RustPython#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-26T12:52:11.138Z
Learning: For documentation, generate it with 'cargo doc --no-deps --all' and refer to the architecture and development guide documents for project structure and setup.
build.rs (1)
Learnt from: CR
PR: RustPython/RustPython#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-26T12:52:11.138Z
Learning: For documentation, generate it with 'cargo doc --no-deps --all' and refer to the architecture and development guide documents for project structure and setup.
🪛 GitHub Actions: CI
build.rs
[error] 5-5: cargo fmt --check failed due to formatting differences. Please run 'cargo fmt' to fix code style issues.
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.
👍
Uses winresource to embed the logo and other information into the windows executable.
Summary by CodeRabbit