-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[v2/Mac] Add Apple Silicon
hardware detection to wails doctor
#3129
Conversation
WalkthroughThe Changes
Poem
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 X ? TipsChat with CodeRabbit Bot (
|
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.
Review Status
Actionable comments generated: 1
Configuration used: CodeRabbit UI
Files selected for processing (1)
- v2/cmd/wails/doctor.go (3 hunks)
Additional comments: 5
v2/cmd/wails/doctor.go (5)
5-5: The addition of the
shell
package is consistent with the PR's objective to enhance hardware detection on macOS.97-104: The new logic to fetch CPU information using
sysctl
for macOS is in line with the PR's objective to improve hardware detection on Apple Silicon Macs.123-147: The implementation for retrieving GPU information using
system_profiler
for macOS is consistent with the PR's goal to display detailed hardware information on Apple Silicon Macs.154-163: The updated logic to retrieve memory information using
sysctl
for macOS aligns with the PR's aim to enhance thewails doctor
command for better hardware detection on Apple Silicon Macs.97-97: Ensure that the assumption that a nil return value from
ghw.CPU()
orghw.GPU()
implies a macOS system is valid. If not, an explicit check for macOS should be performed before running macOS-specific commands.Also applies to: 123-123, 154-154
cpuInfo := "Unknown" | ||
if runtime.GOOS == "darwin" { | ||
// Try to get CPU info from sysctl | ||
if stdout, _, err := shell.RunCommand("", "sysctl", "-n", "machdep.cpu.brand_string"); err == nil { |
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.
Consider adding error logging or user notification if the shell commands fail to execute, to improve the user experience by providing feedback on what went wrong.
Also applies to: 126-126, 157-157
wails doctor
Apple Silicon
hardware detection to wails doctor
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.
Review Status
Actionable comments generated: 1
Configuration used: CodeRabbit UI
Files selected for processing (1)
- website/src/pages/changelog.mdx (1 hunks)
Additional comments: 1
website/src/pages/changelog.mdx (1)
- 17-19: The changelog entry for the addition of Apple Silicon hardware detection to
wails doctor
is correctly placed and well-described, providing a clear link to the associated PR.
### Changed | ||
|
||
- Add Apple Silicon hardware detection to `wails doctor`. Changed by @almas1992 in [PR](https://github.com/wailsapp/wails/pull/3129) |
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.
Duplicate entry for the addition of hardware detection to wails doctor
found. The entry under "Added" for a previous version should be removed to maintain an accurate changelog.
- - Added CPU/GPU/Memory detection for `wails doctor`. Added by @leaanthony in #d51268b8d0680430f3a614775b13e6cd2b906d1c
Committable suggestion
❗ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
### Changed | |
- Add Apple Silicon hardware detection to `wails doctor`. Changed by @almas1992 in [PR](https://github.com/wailsapp/wails/pull/3129) |
Thanks @almas1992 ! |
Description
wails doctor
support detect Apple Silicon hardware infoBefore :
After:
Fixes # (issue)
Type of change
Please delete options that are not 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
.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
New Features
Refactor