GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Display logo on windows executable by arihant2math · Pull Request #5790 · RustPython/RustPython

Conversation

@arihant2math

@arihant2math arihant2math commented May 17, 2025 •
edited by coderabbitai Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Uses winresource to embed the logo and other information into the windows executable.

Summary by CodeRabbit

  • New Features
    • Added support for embedding a custom application icon on Windows builds. If a logo file is present, it will be used as the app icon; otherwise, a warning is shown and the build continues without an icon.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@arihant2math
display logo on windows executable
da8971b
@arihant2math arihant2math added C-enhancement New feature or request O-windows labels Jun 28, 2025
@coderabbitai

coderabbitai Bot commented Jun 28, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

📥 Commits

Reviewing files that changed from the base of the PR and between bc564b0 and ca87498.

📒 Files selected for processing (1)
  • build.rs (1 hunks)

"""

Walkthrough

A build script (build.rs) was added to embed an application icon into Windows builds using the winresource crate. The Cargo.toml was updated to include winresource as a build dependency. The script runs only when the target OS is Windows and handles missing icon files or compilation errors gracefully.

Changes

File(s) Change Summary
Cargo.toml Added winresource (version "0.1") to [build-dependencies].
build.rs Added build script that embeds Windows icon (logo.ico) with winresource, handles missing icon and compile errors.

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
Loading

Poem

A bunny hops with code anew,
Now Windows builds show logos too!
With winresource in the mix,
Icons are set—no extra tricks.
So let the build script run its course,
And give your app some visual force!
🐇✨
"""

✨ Finishing Touches
  • 📝 Generate Docstrings

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.

❤️ Share
  • X
  • Mastodon
  • Reddit
  • LinkedIn
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

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

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@arihant2math
formatting
27e83c4
coderabbitai[bot]
coderabbitai Bot reviewed Jun 28, 2025
View reviewed changes

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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

📥 Commits

Reviewing files that changed from the base of the PR and between 5e682e3 and da8971b.

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Cargo.toml Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread build.rs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread build.rs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread build.rs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread build.rs Resolved

Uh oh!

There was an error while loading. Please reload this page.

@arihant2math
apply suggestions
e9edb19
@arihant2math
arihant2math requested a review from youknowone June 28, 2025 16:30
@arihant2math
Make clippy happy
bc564b0
youknowone
youknowone reviewed Jun 28, 2025
View reviewed changes
Comment thread build.rs Resolved

Uh oh!

There was an error while loading. Please reload this page.

@arihant2math
rerun build.rs if logo is changed
ca87498
@arihant2math
arihant2math requested a review from youknowone June 28, 2025 17:19
youknowone
youknowone approved these changes Jun 28, 2025
View reviewed changes

@youknowone youknowone left a comment

Copy link
Copy Markdown
Member

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.

👍

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@youknowone
youknowone merged commit 3a85499 into RustPython:main Jun 28, 2025
@arihant2math
arihant2math deleted the win-icon branch June 28, 2025 17:52
This was referenced Jul 22, 2025
Cleanup vm/src/stdlib/stat.rs #6018
Merged
Resolve libc::RLIM_NLIMITS warning on android #6025
Merged
@coderabbitai coderabbitai Bot mentioned this pull request Jul 29, 2025
Add symtable.py from 3.13.5 #6048
Merged
@coderabbitai coderabbitai Bot mentioned this pull request Nov 10, 2025
test_auto_format 02 #6249
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@coderabbitai coderabbitai[bot] coderabbitai[bot] left review comments
@youknowone youknowone youknowone approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

C-enhancement New feature or request O-windows

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@arihant2math @youknowone
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.