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

Add warning when user is running in ARM translation mode #1560

Merged
merged 11 commits into from
Dec 19, 2024

Conversation

esimkowitz
Copy link
Member

@esimkowitz esimkowitz commented Dec 18, 2024

Adds warning and docs to let users know when they're running in ARM translation mode. Also lets them configure to always dismiss if they don't care.

Summary by CodeRabbit

  • New Features

    • Added a configuration option to dismiss architecture warnings during application startup.
    • Introduced new FAQs addressing ARM64 translation warnings and instructions for joining beta builds.
    • Added platform-specific requirements for macOS, Windows, and Linux in the getting started documentation.
  • Bug Fixes

    • Enhanced build command flexibility by allowing dynamic command-line arguments during the build process.
  • Documentation

    • Updated configuration documentation to include the new dismiss architecture warning key.
    • Minor formatting adjustments in FAQs and getting started documentation.
    • Clarified platform compatibility details in the README.
  • Chores

    • Added a new constant for the dismiss architecture warning configuration key.
    • Introduced a new field for managing architecture warning settings in the application configuration.

Copy link

coderabbitai bot commented Dec 18, 2024

Walkthrough

This pull request introduces enhancements related to ARM64 architecture support and configuration flexibility. The changes span multiple files, adding a new configuration option to dismiss architecture warnings, implementing a warning mechanism for ARM64 translation, and updating documentation to provide more detailed platform requirements and guidance. The modifications aim to improve user experience and provide clearer information about application compatibility across different hardware architectures.

Changes

File Change Summary
Taskfile.yml Added {{.CLI_ARGS}} to package task for more flexible build command
docs/docs/config.mdx Added new configuration key app:dismissarchitecturewarning
docs/docs/faq.mdx Added FAQs about ARM64 translation warnings and beta builds
docs/docs/gettingstarted.mdx Added platform requirements section with detailed architecture support
emain/emain.ts Added call to checkIfRunningUnderARM64Translation function
emain/platform.ts Implemented checkIfRunningUnderARM64Translation function with user dialog
frontend/types/gotypes.d.ts Added optional app:dismissarchitecturewarning property to SettingsType
pkg/wconfig/metaconsts.go Added ConfigKey_AppDismissArchitectureWarning constant
pkg/wconfig/settingsconfig.go Added AppDismissArchitectureWarning field to SettingsType

Poem

🐰 A Rabbit's Build Adventure
With CLI_ARGS now in sight,
Taskfile dances with delight!
ARM64 warnings take their stance,
Giving users a configurable chance
To build and run with pure might! 🚀


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

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.

Copy link

@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

🧹 Nitpick comments (3)
docs/docs/faq.mdx (2)

40-40: Improve sentence structure

The sentence using "however" should be restructured for better readability.

-macOS and Windows both have compatibility layers that allow x64 applications to run on ARM computers. This helps more apps run on these systems while developers work to add native ARM support to their applications, however it comes with significant performance tradeoffs.
+macOS and Windows both have compatibility layers that allow x64 applications to run on ARM computers. This helps more apps run on these systems while developers work to add native ARM support to their applications. However, it comes with significant performance tradeoffs.
🧰 Tools
🪛 LanguageTool

[typographical] ~40-~40: The word “however” is an adverb that can’t be used like a conjunction, and therefore needs to be separated from the sentence.
Context: ...native ARM support to their applications, however it comes with significant performance t...

(HOWEVER_SENTENCE)


42-42: Fix hyphenation in compound modifier

Remove the hyphen from "natively-compiled" as it's redundant with the -ly adverb.

-To get the best experience using Wave, it is recommended that you uninstall Wave and reinstall the version that is natively-compiled for your computer.
+To get the best experience using Wave, it is recommended that you uninstall Wave and reinstall the version that is natively compiled for your computer.
🧰 Tools
🪛 LanguageTool

[uncategorized] ~42-~42: The hyphen in natively-compiled is redundant.
Context: ... Wave and reinstall the version that is natively-compiled for your computer. You can find the rig...

(ADVERB_LY_HYPHEN_FIX)

emain/platform.ts (1)

44-63: Consider enhancing the warning dialog with more specific guidance

The implementation is solid, but the warning message could be more actionable:

  1. The message could specify which native version to download based on the architecture
  2. Consider adding a "Don't show again" button directly in the dialog

Consider this enhanced dialog implementation:

 const dialogOpts: Electron.MessageBoxOptions = {
   type: "warning",
-  buttons: ["See documentation", "Dismiss"],
+  buttons: ["See documentation", "Don't show again", "Dismiss"],
   title: "Wave has detected a performance issue",
-  message: `Wave has detected that it is running in ARM64 translation mode.\n\nThis may cause performance issues.\n\nPlease download the native version of Wave for your architecture (${unameArch})`,
+  message: `Wave is running in ARM64 translation mode which may impact performance.\n\nRecommendation: Download the native ${unameArch} version from our website for optimal performance.\n\nWould you like to learn more or disable this warning?`,
 };

 const choice = dialog.showMessageBoxSync(null, dialogOpts);
 if (choice === 0) {
   console.log("Opening documentation URL");
   fireAndForget(() => shell.openExternal("https://docs.waveterm.dev"));
-} else {
+} else if (choice === 1) {
+  console.log("User chose to disable the warning");
+  // Update the configuration to disable future warnings
+  fireAndForget(() => SetBaseConfigValue({ "app:dismissarchitecturewarning": true }));
+} else {
   console.log("User dismissed the dialog");
 }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cc6da28 and c4d1c0c.

📒 Files selected for processing (9)
  • Taskfile.yml (1 hunks)
  • docs/docs/config.mdx (1 hunks)
  • docs/docs/faq.mdx (1 hunks)
  • docs/docs/gettingstarted.mdx (1 hunks)
  • emain/emain.ts (2 hunks)
  • emain/platform.ts (2 hunks)
  • frontend/types/gotypes.d.ts (1 hunks)
  • pkg/wconfig/metaconsts.go (1 hunks)
  • pkg/wconfig/settingsconfig.go (1 hunks)
🧰 Additional context used
🪛 LanguageTool
docs/docs/faq.mdx

[style] ~36-~36: This phrase is redundant. Consider using “outside”.
Context: ...d by Wave to work and will not function outside of the app. ## Why does Wave warn me abou...

(OUTSIDE_OF)


[typographical] ~40-~40: The word “however” is an adverb that can’t be used like a conjunction, and therefore needs to be separated from the sentence.
Context: ...native ARM support to their applications, however it comes with significant performance t...

(HOWEVER_SENTENCE)


[uncategorized] ~42-~42: The hyphen in natively-compiled is redundant.
Context: ... Wave and reinstall the version that is natively-compiled for your computer. You can find the rig...

(ADVERB_LY_HYPHEN_FIX)

🔇 Additional comments (12)
docs/docs/faq.mdx (2)

38-44: LGTM! Clear explanation of ARM translation warning

The new FAQ section effectively explains:

  • Why the warning appears
  • The performance implications
  • The recommended solution
  • How to disable the warning
🧰 Tools
🪛 LanguageTool

[typographical] ~40-~40: The word “however” is an adverb that can’t be used like a conjunction, and therefore needs to be separated from the sentence.
Context: ...native ARM support to their applications, however it comes with significant performance t...

(HOWEVER_SENTENCE)


[uncategorized] ~42-~42: The hyphen in natively-compiled is redundant.
Context: ... Wave and reinstall the version that is natively-compiled for your computer. You can find the rig...

(ADVERB_LY_HYPHEN_FIX)


46-59: LGTM! Well-structured beta builds instructions

The instructions for joining beta builds are clear and cover both package manager and Snap installation methods.

pkg/wconfig/metaconsts.go (1)

11-11: LGTM! Well-placed configuration constant

The new configuration constant follows the established naming pattern and is appropriately placed in the app configuration section.

docs/docs/gettingstarted.mdx (2)

17-45: LGTM! Comprehensive platform requirements section

The new platform requirements section effectively:

  • Lists supported architectures per platform
  • Specifies OS version requirements
  • Includes relevant notes about ARM support

33-33: Verify the issue link is accurate

Please ensure the referenced GitHub issue for Windows ARM Support is the correct and most up-to-date issue.

✅ Verification successful

Issue link is accurate and relevant

The referenced GitHub issue #928 exists in the wavetermdev/waveterm repository, is currently open, and specifically addresses Windows ARM support, which aligns perfectly with the documentation's context about ARM64 support being blocked by upstream dependencies.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the GitHub issue exists and is relevant
gh issue view 928 --repo wavetermdev/waveterm

Length of output: 502

emain/platform.ts (1)

4-5: LGTM: Clean import statements

The imports are correctly organized, bringing in necessary Electron modules and utility functions.

Taskfile.yml (1)

99-99: LGTM: Enhanced build flexibility

The addition of {{.CLI_ARGS}} to the electron-builder command enables passing platform-specific build arguments, which is essential for ARM architecture support.

pkg/wconfig/settingsconfig.go (1)

36-38: LGTM: Well-structured configuration addition

The new configuration field follows the established patterns:

  • Consistent field alignment
  • Proper JSON tag naming
  • Appropriate use of omitempty for optional setting
emain/emain.ts (2)

50-50: LGTM: Clean import of the architecture check function.

The function is imported alongside other related platform utilities.


592-592: LGTM: Appropriate placement of architecture check.

The function is called at the right time in the startup sequence:

  1. After full configuration is loaded (needed for checking dismissal settings)
  2. Before UI initialization (allows for early warning)
docs/docs/config.mdx (1)

29-29: LGTM: Well-documented configuration option.

The new configuration key is:

  • Properly formatted and consistent with other entries
  • Includes clear type specification
  • Contains helpful description
  • Links to FAQ for detailed information
frontend/types/gotypes.d.ts (1)

621-621: LGTM: Properly typed configuration setting.

The type definition is:

  • Correctly marked as optional using ?
  • Properly typed as boolean
  • Consistent with the documented configuration key

Copy link

@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

🧹 Nitpick comments (1)
docs/docs/faq.mdx (1)

44-44: Consider enhancing the configuration instructions.

While the current instructions point to the configuration documentation, it would be more user-friendly to include a complete JSON example, similar to other FAQs in this document.

Consider adding:

-You can disable this warning by setting `app:dismissarchitecturewarning=true` in [your configurations](./config.mdx).
+You can disable this warning by setting `app:dismissarchitecturewarning=true` in [your configurations](./config.mdx):
+
+```json
+{
+  "app:dismissarchitecturewarning": true
+}
+```
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c4d1c0c and 8ad2c5e.

📒 Files selected for processing (2)
  • docs/docs/faq.mdx (1 hunks)
  • emain/platform.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • emain/platform.ts
🧰 Additional context used
🪛 LanguageTool
docs/docs/faq.mdx

[style] ~36-~36: This phrase is redundant. Consider using “outside”.
Context: ...d by Wave to work and will not function outside of the app. ## Why does Wave warn me abou...

(OUTSIDE_OF)

🔇 Additional comments (3)
docs/docs/faq.mdx (3)

31-31: LGTM!

The JSON configuration example is correctly formatted with properly escaped backslashes.


36-36: LGTM!

🧰 Tools
🪛 LanguageTool

[style] ~36-~36: This phrase is redundant. Consider using “outside”.
Context: ...d by Wave to work and will not function outside of the app. ## Why does Wave warn me abou...

(OUTSIDE_OF)


46-59: LGTM!

The beta builds FAQ is well-structured with clear instructions for different installation methods and proper code examples.

Copy link

@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

🧹 Nitpick comments (1)
README.md (1)

44-47: Consider adding a note about ARM translation mode for Windows

Since this PR introduces ARM translation mode warnings, it would be helpful to add a note about Windows on ARM64 running in translation mode. This would provide upfront clarity for ARM-based Windows users.

 Wave Terminal runs on the following platforms:
 
 - macOS 11 or later (arm64, x64)
-- Windows 10 1809 or later (x64)
+- Windows 10 1809 or later (x64, arm64 via translation)
 - Linux based on glibc-2.28 or later (Debian 10, RHEL 8, Ubuntu 20.04, etc.) (arm64, x64)
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8ad2c5e and 9bc340f.

📒 Files selected for processing (1)
  • README.md (1 hunks)
🔇 Additional comments (1)
README.md (1)

50-54: LGTM! Clear separation of WSH helper platform requirements

The addition of separate WSH helper platform requirements provides clear distinction between Wave Terminal and WSH helper architecture support. The detailed Linux kernel version requirements for different architectures are particularly helpful.

Let's verify these platform requirements against the codebase:

✅ Verification successful

Let me gather more information about the build configurations and architecture support.


Let me check the release configurations and build scripts to verify the platform support.


Based on the gathered information, I can now generate the final response:

Platform requirements in README.md are accurate and consistent with codebase

The WSH helper platform requirements are verified through:

  • Build configurations in Taskfile.yml support all listed architectures (arm64, x64)
  • Platform-specific code in pkg/util/shellutil/shellutil.go handles architecture normalization (amd64 → x64)
  • Build constraints in Go files (//go:build) properly handle Windows/Unix separation
  • Runtime checks via runtime.GOOS and runtime.GOARCH support all listed platforms
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify platform requirements are consistent with build configurations

# Check build constraints and platform-specific code
rg -g '*.go' "GOOS|GOARCH" --type go

# Check for WSH helper related platform checks
rg -g '*.go' "runtime.GOOS|runtime.GOARCH" --type go

Length of output: 2265


Script:

#!/bin/bash
# Check build tags and constraints
rg -g '*.go' "^//\s*\+build" --type go

# Check Go files for build constraints
rg -g '*.go' "^//go:build" --type go

# Look for architecture-specific code or build settings
fd -e yaml -e yml | xargs rg "GOARCH|arm64|amd64|x64"

# Check for any build or platform configuration files
fd -e json -e toml | xargs rg "GOARCH|arm64|amd64|x64"

Length of output: 2454


Script:

#!/bin/bash
# Check release configurations and build scripts
fd -e sh -e bash | xargs rg "GOARCH|arm64|amd64|x64"

# Look for platform-specific code in WSH helper
rg -g 'cmd/wsh/**/*.go' "runtime.GOOS|runtime.GOARCH|linux|windows|darwin"

# Check for kernel version checks
rg "kernel|version" -g '*.go' -A 3 -B 3

Length of output: 53973

@esimkowitz esimkowitz merged commit 0925af5 into main Dec 19, 2024
10 checks passed
@esimkowitz esimkowitz deleted the evan/check-arch branch December 19, 2024 03:44
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.

1 participant