Skip to content

Commit 0925af5

Browse files
authored
Add warning when user is running in ARM translation mode (#1560)
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. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## 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. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 9f471cf commit 0925af5

File tree

10 files changed

+97
-6
lines changed

10 files changed

+97
-6
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,18 @@ You can also install Wave Terminal directly from: [www.waveterm.dev/download](ht
4141

4242
### Minimum requirements
4343

44-
Wave Terminal and WSH run on the following platforms:
44+
Wave Terminal runs on the following platforms:
4545

4646
- macOS 11 or later (arm64, x64)
4747
- Windows 10 1809 or later (x64)
4848
- Linux based on glibc-2.28 or later (Debian 10, RHEL 8, Ubuntu 20.04, etc.) (arm64, x64)
4949

50+
The WSH helper runs on the following platforms:
51+
52+
- macOS 11 or later (arm64, x64)
53+
- Windows 10 or later (arm64, x64)
54+
- Linux Kernel 2.6.32 or later (x64), Linux Kernel 3.1 or later (arm64)
55+
5056
## Links
5157

5258
- Homepage &mdash; https://www.waveterm.dev

Taskfile.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ tasks:
9696
cmds:
9797
- cmd: '{{.RMRF}} "make"'
9898
ignore_error: true
99-
- yarn build:prod && yarn electron-builder -c electron-builder.config.cjs -p never
99+
- yarn build:prod && yarn electron-builder -c electron-builder.config.cjs -p never {{.CLI_ARGS}}
100100
deps:
101101
- yarn
102102
- docsite:build:embedded

docs/docs/config.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ wsh editconfig
2626
| Key Name | Type | Function |
2727
| ------------------------------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
2828
| app:globalhotkey | string | A systemwide keybinding to open your most recent wave window. This is a set of key names separated by `:`. For more info, see [Customizable Systemwide Global Hotkey](#customizable-systemwide-global-hotkey) |
29+
| app:dismissarchitecturewarning | bool | Disable warnings on app start when you are using a non-native architecture for Wave. For more info, see [Why does Wave warn me about ARM64 translation when it launches?](./faq#why-does-wave-warn-me-about-arm64-translation-when-it-launches). |
2930
| ai:preset | string | the default AI preset to use |
3031
| ai:baseurl | string | Set the AI Base Url (must be OpenAI compatible) |
3132
| ai:apitoken | string | your AI api token |

docs/docs/faq.mdx

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,32 @@ the location of the Git Bash "bash.exe" binary. By default it is located at "C:\
2828
Just remember in JSON, backslashes need to be escaped. So add this to your [settings.json](./config) file:
2929

3030
```json
31-
"term:localshellpath": "C:\\Program Files\\Git\\bin\\bash.exe"
31+
"term:localshellpath": "C:\\Program Files\\Git\\bin\\bash.exe"
3232
```
3333

3434
### Can I use WSH outside of Wave?
3535

3636
`wsh` is an internal CLI for extending control over Wave to the command line, you can learn more about it [here](./wsh). To prevent misuse by other applications, `wsh` requires an access token provided by Wave to work and will not function outside of the app.
37+
38+
## Why does Wave warn me about ARM64 translation when it launches?
39+
40+
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.
41+
42+
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. You can find the right version by consulting our [Installation Instructions](./gettingstarted#installation).
43+
44+
You can disable this warning by setting `app:dismissarchitecturewarning=true` in [your configurations](./config.mdx).
45+
46+
## How do I join the beta builds of Wave?
47+
48+
Wave publishes to two channels, `latest` and `beta`. If you've installed the app for macOS, Windows, or Linux via DEB or RPM, you can set the following configurations in your `settings.json` (see [Configuration](./config) for more info):
49+
50+
```json
51+
"autoupdate:enabled": true,
52+
"autoupdate:channel": "beta"
53+
```
54+
55+
If you've installed via Snap, you can use the following command:
56+
57+
```sh
58+
sudo snap install waveterm --classic --beta
59+
```

docs/docs/gettingstarted.mdx

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,35 @@ Wave Terminal is a modern terminal that includes graphical capabilities like web
1414
<PlatformProvider>
1515
<PlatformSelectorButton />
1616

17+
### Platform requirements
18+
19+
<PlatformItem platforms={["mac"]}>
20+
21+
- Supported architectures: Apple Silicon, x64
22+
- Supported OS version: macOS 11 Big Sur or later
23+
24+
</PlatformItem>
25+
26+
<PlatformItem platforms={["windows"]}>
27+
28+
- Supported architectures: x64
29+
- Supported OS version: Windows 10 1809 or later, Windows 11
30+
31+
:::note
32+
33+
ARM64 is planned, but is currently blocked by upstream dependencies (see [Windows ARM Support](https://github.com/wavetermdev/waveterm/issues/928)).
34+
35+
:::
36+
37+
</PlatformItem>
38+
39+
<PlatformItem platforms={["linux"]}>
40+
41+
- Supported architectures: x64, ARM64
42+
- Supported OS version: must have glibc-2.28 or later (Debian >=10, RHEL >=8, Ubuntu >=20.04, etc.)
43+
44+
</PlatformItem>
45+
1746
### Package managers
1847

1948
<PlatformItem platforms={["mac"]}>

emain/emain.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ import { getLaunchSettings } from "./launchsettings";
4747
import { log } from "./log";
4848
import { makeAppMenu } from "./menu";
4949
import {
50+
checkIfRunningUnderARM64Translation,
5051
getElectronAppBasePath,
5152
getElectronAppUnpackedBasePath,
5253
getWaveConfigDir,
@@ -588,6 +589,7 @@ async function appMain() {
588589
await electronApp.whenReady();
589590
configureAuthKeyRequestInjection(electron.session.defaultSession);
590591
const fullConfig = await services.FileService.GetFullConfig();
592+
checkIfRunningUnderARM64Translation(fullConfig);
591593
ensureHotSpareTab(fullConfig);
592594
await relaunchBrowserWindows();
593595
await initDocsite();

emain/platform.ts

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
// Copyright 2024, Command Line Inc.
22
// SPDX-License-Identifier: Apache-2.0
33

4-
import { app, ipcMain } from "electron";
4+
import { fireAndForget } from "@/util/util";
5+
import { app, dialog, ipcMain, shell } from "electron";
56
import envPaths from "env-paths";
67
import { existsSync, mkdirSync } from "fs";
78
import os from "os";
@@ -40,6 +41,32 @@ const WaveConfigHomeVarName = "WAVETERM_CONFIG_HOME";
4041
const WaveDataHomeVarName = "WAVETERM_DATA_HOME";
4142
const WaveHomeVarName = "WAVETERM_HOME";
4243

44+
export function checkIfRunningUnderARM64Translation(fullConfig: FullConfigType) {
45+
if (!fullConfig.settings["app:dismissarchitecturewarning"] && app.runningUnderARM64Translation) {
46+
console.log("Running under ARM64 translation, alerting user");
47+
const dialogOpts: Electron.MessageBoxOptions = {
48+
type: "warning",
49+
buttons: ["Dismiss", "Learn More"],
50+
title: "Wave has detected a performance issue",
51+
message: `Wave is running in ARM64 translation mode which may impact performance.\n\nRecommendation: Download the native ARM64 version from our website for optimal performance.`,
52+
};
53+
54+
const choice = dialog.showMessageBoxSync(null, dialogOpts);
55+
if (choice === 1) {
56+
// Open the documentation URL
57+
console.log("User chose to learn more");
58+
fireAndForget(() =>
59+
shell.openExternal(
60+
"https://docs.waveterm.dev/faq#why-does-wave-warn-me-about-arm64-translation-when-it-launches"
61+
)
62+
);
63+
throw new Error("User redirected to docsite to learn more about ARM64 translation, exiting");
64+
} else {
65+
console.log("User dismissed the dialog");
66+
}
67+
}
68+
}
69+
4370
/**
4471
* Gets the path to the old Wave home directory (defaults to `~/.waveterm`).
4572
* @returns The path to the directory if it exists and contains valid data for the current app, otherwise null.

frontend/types/gotypes.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,7 @@ declare global {
618618
type SettingsType = {
619619
"app:*"?: boolean;
620620
"app:globalhotkey"?: string;
621+
"app:dismissarchitecturewarning"?: boolean;
621622
"ai:*"?: boolean;
622623
"ai:preset"?: string;
623624
"ai:apitype"?: string;

pkg/wconfig/metaconsts.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ package wconfig
88
const (
99
ConfigKey_AppClear = "app:*"
1010
ConfigKey_AppGlobalHotkey = "app:globalhotkey"
11+
ConfigKey_AppDismissArchitectureWarning = "app:dismissarchitecturewarning"
1112

1213
ConfigKey_AiClear = "ai:*"
1314
ConfigKey_AiPreset = "ai:preset"

pkg/wconfig/settingsconfig.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ const AnySchema = `
3333
`
3434

3535
type SettingsType struct {
36-
AppClear bool `json:"app:*,omitempty"`
37-
AppGlobalHotkey string `json:"app:globalhotkey,omitempty"`
36+
AppClear bool `json:"app:*,omitempty"`
37+
AppGlobalHotkey string `json:"app:globalhotkey,omitempty"`
38+
AppDismissArchitectureWarning bool `json:"app:dismissarchitecturewarning,omitempty"`
3839

3940
AiClear bool `json:"ai:*,omitempty"`
4041
AiPreset string `json:"ai:preset,omitempty"`

0 commit comments

Comments
 (0)