-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[v3] fix: Add cross-platform cleanup for .syso files during Windows build #3924
[v3] fix: Add cross-platform cleanup for .syso files during Windows build #3924
Conversation
WalkthroughThe changes in this pull request update the Changes
Possibly related PRs
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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
Documentation and Community
|
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: 0
🧹 Outside diff range and nitpick comments (1)
v3/internal/commands/build_assets/Taskfile.windows.yml (1)
16-19
: LGTM! Platform-specific cleanup implementation looks good.The implementation correctly handles .syso file cleanup across different platforms using appropriate commands for each OS.
Consider these improvements:
- Add error handling by using the
ignore_error: true
option to prevent task failure if files don't exist:- cmd: powershell Remove-item *.syso platforms: [windows] + ignore_error: true - cmd: rm -f *.syso platforms: [linux, darwin] + ignore_error: true
- Consider moving the cleanup to a separate task for better organization:
cleanup:syso: cmds: - cmd: powershell Remove-item *.syso platforms: [windows] ignore_error: true - cmd: rm -f *.syso platforms: [linux, darwin] ignore_error: true build: # ... other configurations ... deps: # ... existing deps ... cmds: - go build {{.BUILD_FLAGS}} -o {{.BIN_DIR}}/{{.APP_NAME}}.exe - task: cleanup:syso
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (1)
v3/internal/commands/build_assets/Taskfile.windows.yml
(1 hunks)
🔇 Additional comments (1)
v3/internal/commands/build_assets/Taskfile.windows.yml (1)
16-19
: Verify .syso file handling across the codebase
Let's ensure this cleanup mechanism covers all .syso file generation points.
✅ Verification successful
Cleanup mechanism for .syso files is consistent across the codebase
The cleanup implementation in build_assets/Taskfile.windows.yml
follows the established pattern across the codebase. All files that generate .syso files consistently implement the same cleanup mechanism:
- Windows cleanup using
powershell Remove-item *.syso
- Non-Windows cleanup using
rm -f *.syso
The pattern is consistently implemented in:
- Template base (
v3/internal/templates/_base/default/Taskfile.tmpl.yml
) - Example applications (dialogs, dev, file-association, build)
- Build assets
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Check for other .syso file generation points and cleanup mechanisms
echo "Checking for .syso file generation points:"
rg -l "\.syso" --type yaml
echo -e "\nChecking for existing cleanup mechanisms:"
rg -l "Remove-item.*\.syso|rm.*\.syso" --type yaml
echo -e "\nChecking for syso-related build configurations:"
ast-grep --pattern 'generate syso'
Length of output: 939
Script:
#!/bin/bash
# Let's examine the cleanup mechanisms in these files to ensure consistency
echo "=== Checking cleanup mechanisms in Taskfile.tmpl.yml ==="
rg "\.syso" v3/internal/templates/_base/default/Taskfile.tmpl.yml -C 2
echo -e "\n=== Checking cleanup in dialogs/Taskfile.yml ==="
rg "\.syso" v3/examples/dialogs/Taskfile.yml -C 2
echo -e "\n=== Checking cleanup in dev/Taskfile.yml ==="
rg "\.syso" v3/examples/dev/Taskfile.yml -C 2
echo -e "\n=== Checking cleanup in file-association/Taskfile.windows.yml ==="
rg "\.syso" v3/examples/file-association/build/Taskfile.windows.yml -C 2
echo -e "\n=== Checking cleanup in build/Taskfile.yml ==="
rg "\.syso" v3/examples/build/Taskfile.yml -C 2
Length of output: 2426
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: 0
🧹 Outside diff range and nitpick comments (1)
mkdocs-website/docs/en/changelog.md (1)
48-48
: LGTM with a minor suggestion to enhance clarity.The changelog entry correctly documents the fix and follows the proper format. Consider making it more specific by mentioning the actual platforms affected:
-Fixed cross-platform cleanup for .syso files during Windows build by [ansxuman](https://github.com/ansxuman) in [#3924](https://github.com/wailsapp/wails/pull/3924) +Fixed cross-platform cleanup for .syso files during Windows build (Windows/Linux/Darwin) by [ansxuman](https://github.com/ansxuman) in [#3924](https://github.com/wailsapp/wails/pull/3924)
Amazing! Thank you 🙏 |
✌🏻 |
Description
When cross-compiling Windows binaries on macOS, it gives error during cleanup of
.syso
files. The current cleanup command uses PowerShell, which is not available on Unix-based systems.Fixes # (issue)
Type of change
Please select the option that is relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration using
wails doctor
.If you checked Linux, please specify the distro and version.
Test Configuration
Please paste the output of
wails doctor
. If you are unable to run this command, please describe your environment in as much detail as possible.Checklist:
website/src/pages/changelog.mdx
with details of this PRSummary by CodeRabbit
.syso
files in the build process, enhancing compatibility across Windows, Linux, and Darwin environments.