Skip to content
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

Fix AMD64 appimage generation #3898

Merged
merged 2 commits into from
Nov 22, 2024

Conversation

atterpac
Copy link
Member

@atterpac atterpac commented Nov 21, 2024

#3854 introduced a bug for compiling appimage for amd64 CPUs this PR adds the amd64 to the archdeatilas map to remedy the issue.

# System
┌──────────────────────────────────────────────────────────────────────────────────────────┐
| Name         | Ubuntu                                                                    |
| Version      | 24.04                                                                     |
| ID           | ubuntu                                                                    |
| Branding     | 24.04.1 LTS (Noble Numbat)                                                |
| Platform     | linux                                                                     |
| Architecture | amd64                                                                     |
| CPU          | 12th Gen Intel(R) Core(TM) i5-1235U                                       |
| GPU 1        | Alder Lake-UP3 GT2 [Iris Xe Graphics] (Intel Corporation) - Driver: i915  |
| Memory       | 7GB                                                                       |
└──────────────────────────────────────────────────────────────────────────────────────────┘

# Build Environment
┌─────────────────────────────────────────────────────────┐
| Wails CLI    | v3.0.0-alpha.7                           |
| Go Version   | go1.22.4                                 |
| Revision     | 699743dbe2e247a6c7e9bdfd08f3c4f48809e8a8 |
| Modified     | false                                    |
| -buildmode   | exe                                      |
| -compiler    | gc                                       |
| CGO_CFLAGS   |                                          |
| CGO_CPPFLAGS |                                          |
| CGO_CXXFLAGS |                                          |
| CGO_ENABLED  | 1                                        |
| CGO_LDFLAGS  |                                          |
| GOAMD64      | v1                                       |
| GOARCH       | amd64                                    |
| GOOS         | linux                                    |
| vcs          | git                                      |
| vcs.modified | false                                    |
| vcs.revision | 699743dbe2e247a6c7e9bdfd08f3c4f48809e8a8 |
| vcs.time     | 2024-11-21T16:11:02Z                     |
└─────────────────────────────────────────────────────────┘

# Dependencies
┌──────────────────────────────────────┐
| gtk3       | 3.24.41-4ubuntu1.2      |
| npm        | 10.5.1                  |
| pkg-config | 1.8.1-2build1           |
| webkit2gtk | 2.46.3-0ubuntu0.24.04.1 |
| gcc        | 12.10ubuntu1            |
└────── * - Optional Dependency ───────┘

Summary by CodeRabbit

  • New Features

    • Added documentation for events on the mkdocs website.
    • Introduced new templates for SvelteKit.
    • Added wails3 update build-assets and wails3 generate runtime commands.
    • New InitialPosition option for window positioning.
    • Added options for autofill and password autosave on Windows.
    • Introduced new methods Path and Paths in the application package.
    • Added ability to retrieve the window calling a service method.
  • Bug Fixes

    • Resolved issues with amd64 AppImage compilation and Linux systray handling.
    • Fixed AlwaysOnTop functionality on macOS and various platform-specific issues.

Copy link
Contributor

coderabbitai bot commented Nov 21, 2024

Walkthrough

The pull request includes significant updates to the changelog, documenting new features, changes, and bug fixes. Key additions are the wails3 update build-assets and wails3 generate runtime commands, new SvelteKit templates, and enhancements to window options and application methods. The GenerateAppImage functionality has been modified to support the "amd64" architecture. Various bugs affecting Linux and macOS have been addressed, and asset embedding has been refined to accommodate frameworks with subfolders.

Changes

File Path Change Summary
mkdocs-website/docs/en/changelog.md Updated to include new features, changes, and fixes; added documentation for events, new templates, and commands; refined existing functionalities and fixed bugs.
v3/internal/commands/appimage.go Modified GenerateAppImage to include "amd64" architecture support; error handling and control flow remain unchanged.

Possibly related PRs

🐇 In the meadow, changes bloom,
New features sprout, dispelling gloom.
Commands to build, and templates bright,
Bug fixes dance in the soft moonlight.
With every hop, our project grows,
A joyful leap, as progress flows! 🌼


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between b3d678e and 1f6f477.

📒 Files selected for processing (1)
  • mkdocs-website/docs/en/changelog.md (1 hunks)
🔇 Additional comments (2)
mkdocs-website/docs/en/changelog.md (2)

Line range hint 1-24: LGTM! The changelog follows the Keep a Changelog format.

The file properly adheres to:

  • Keep a Changelog format
  • Semantic Versioning
  • Standard sections (Added, Changed, Deprecated, Removed, Fixed, Security)
🧰 Tools
🪛 LanguageTool

[duplication] ~43-~43: Possible typo: you repeated a word
Context: ...ny](https://github.com/leaanthony) ### Fixed - Fixed amd64 appimage compile by @atterpac in ...

(ENGLISH_WORD_REPEAT_RULE)


44-44: Verify the connection between PR #3898 and PR #3854

The changelog entry correctly documents the AMD64 appimage compilation fix. However, it would be helpful to reference PR #3854 which introduced the original issue.

Let's verify the connection between these PRs:

Consider updating the entry to:

-Fixed amd64 appimage compile by @atterpac in [#3898](https://github.com/wailsapp/wails/pull/3898)
+Fixed amd64 appimage compile (regression from [#3854](https://github.com/wailsapp/wails/pull/3854)) by @atterpac in [#3898](https://github.com/wailsapp/wails/pull/3898)
✅ Verification successful

Add reference to PR #3854 in the changelog entry

Based on the PR description from #3898 which states "#3854 introduced a bug for compiling appimage for amd64 CPUs", and the fact that both PRs modify the same files, particularly v3/internal/commands/appimage.go, the suggested changelog update would provide valuable context about the regression fix.

Consider updating to:

-Fixed amd64 appimage compile by @atterpac in [#3898](https://github.com/wailsapp/wails/pull/3898)
+Fixed amd64 appimage compile (regression from [#3854](https://github.com/wailsapp/wails/pull/3854)) by @atterpac in [#3898](https://github.com/wailsapp/wails/pull/3898)
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the relationship between PR #3898 and PR #3854
# Expected: Find references to AMD64/amd64 architecture in PR #3854

# Check PR #3854 for AMD64/amd64 related changes
gh pr view 3854 --json body,comments | jq -r '.body, .comments[].body' | grep -i "amd64\|amd64"

Length of output: 97


Script:

#!/bin/bash
# Let's try a different approach to find the connection between these PRs
# First, let's check the PR description and comments of #3898 to see if it mentions #3854
gh pr view 3898 --json body,comments | jq -r '.body, .comments[].body'

# Also, let's check for any appimage-related changes in both PRs
gh pr view 3898 --json files | jq -r '.files[].path'
gh pr view 3854 --json files | jq -r '.files[].path'

Length of output: 16048


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?

❤️ Share
🪧 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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

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.

@atterpac atterpac force-pushed the v3/fix-appimage-packaging branch from 699743d to b3d678e Compare November 21, 2024 16:18
@atterpac atterpac marked this pull request as ready for review November 21, 2024 16:18
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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/appimage.go (1)

78-81: Consider adding a comment explaining the architecture mappings.

While the implementation is correct, it would be helpful to add a comment explaining that these mappings align AppImage's expected architecture names with Go's runtime.GOARCH values.

 // Architecture-specific variables using a map
+// Maps Go's runtime.GOARCH values to AppImage's architecture naming convention
 archDetails := map[string]string{
 	"arm64":  "aarch64",
 	"amd64":  "x86_64",
 	"x86_64": "x86_64",
 }
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between eccfd34 and b3d678e.

📒 Files selected for processing (2)
  • mkdocs-website/docs/en/changelog.md (1 hunks)
  • v3/internal/commands/appimage.go (1 hunks)
🔇 Additional comments (3)
v3/internal/commands/appimage.go (1)

79-79: LGTM! The AMD64 architecture mapping is correct.

The addition of "amd64" mapping to "x86_64" is the right fix as these are equivalent architecture names, with "x86_64" being the standard notation used in AppImage filenames.

Let's verify the architecture handling across the codebase:

✅ Verification successful

Let me generate new shell scripts to verify the architecture handling across the codebase:


The AMD64 architecture mapping is correct and consistent across the codebase

The mapping of "amd64" to "x86_64" in the AppImage generation is correct and consistent with the rest of the codebase. The search results confirm:

  • The mapping is used correctly for AppImage generation where "amd64" needs to be translated to "x86_64" for Linux compatibility
  • The codebase consistently uses "amd64" internally as the architecture identifier
  • The architecture handling is properly implemented across different build targets (Windows NSIS installers, macOS universal binaries, Linux AppImages)
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify architecture handling consistency
# Expected: Find any other places where architecture mapping might need to be updated

# Check for other architecture mappings or constants
rg -g '!*.md' -i '(amd64|x86_64).*=|const.*(amd64|x86_64)'

# Check for architecture-specific logic
ast-grep --pattern 'if $_ == "amd64" { $$$ }'

Length of output: 100194


Script:

#!/bin/bash
# Search for architecture-related mappings and constants
rg -g '!*.md' -i '(amd64|x86_64).*=|const.*(amd64|x86_64)|map\[string\]string.*amd64'

# Search for architecture-specific build logic
ast-grep --pattern 'if $_.Arch == "amd64" { $$$ }'

Length of output: 27805

mkdocs-website/docs/en/changelog.md (2)

Line range hint 1-24: LGTM: Changelog follows proper formatting guidelines

The changelog properly follows the Keep a Changelog format:

  • Clear sections for different types of changes (Added/Changed/Fixed)
  • Proper attribution with GitHub usernames and PR links
  • Clear version headers with dates
  • Consistent formatting throughout
🧰 Tools
🪛 LanguageTool

[duplication] ~43-~43: Possible typo: you repeated a word
Context: ...ny](https://github.com/leaanthony) ### Fixed - Fixed amd64 appimage compile by @atterpac in ...

(ENGLISH_WORD_REPEAT_RULE)


44-44: Verify changelog entry matches PR objectives

The changelog entry correctly documents the fix for AMD64 appimage compilation, which aligns with the PR objectives. The entry follows the proper format with PR link and author attribution.

Let's verify if there are any related AMD64 appimage issues in the codebase:

✅ Verification successful

Changelog entry accurately reflects the code changes

The changelog entry correctly documents the fix for AMD64 appimage compilation. The code changes in v3/internal/commands/appimage.go show the addition of the "amd64" key to the archDetails map, which maps to "x86_64". This change directly addresses the issue mentioned in PR #3898, where AMD64 AppImage compilation was broken. The PR description confirms this was to fix a bug introduced in #3854.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Search for AMD64/amd64 related appimage code and issues
# Look for appimage-related code files
fd -t f appimage

# Search for AMD64/amd64 related code in appimage files
rg -i "amd64|AMD64" $(fd -t f appimage)

Length of output: 257


Script:

#!/bin/bash
# Let's check the specific changes in the PR related to AMD64 appimage
rg -A 5 -B 5 "amd64" v3/internal/commands/appimage.go

# Also check the test file for any related changes
cat v3/internal/commands/appimage_test.go

# Let's also check recent commits or PRs mentioning appimage and amd64
gh pr view 3898

Length of output: 5750

@leaanthony leaanthony merged commit 76e7654 into wailsapp:v3-alpha Nov 22, 2024
4 of 6 checks passed
@leaanthony
Copy link
Member

Nice catch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants