Repository navigation
fix(colima): Upgrade Colima/Lima and repair M4+ SVE without data loss #236
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
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
2efd88b
fix(colima): Upgrade the VM kernel when it misreports SVE on M4+
vaind d18aa32
fix(colima): Make the kernel upgrade's output readable when piped
vaind 82c092e
fix(doctor): Only report the SVE fix as done once it took
vaind 089b214
test(colima): format the context stub for ruff
joshuarli 4435dcd
fix(colima): install the SVE kernel before the one restart
joshuarli cd0c481
fix(colima): report the kernel after a restart boots it
joshuarli 1e03c6f
fix(colima): preserve VM data across runtime upgrades
joshuarli b99a92f
docs(colima): explain runtime and VM upgrade behavior
joshuarli 9a5474e
fix(lima): preserve the installed runtime during repair
joshuarli 53e4447
fix(lima): verify versions through bundled limactl
joshuarli 0bee0bf
fix(colima): scope disk probes to Colima Lima home
joshuarli 4af284c
Merge remote-tracking branch 'origin/main' into ivan/colima-sve-kerne…
joshuarli e3d92cf
fix(colima): persist fresh Docker store
joshuarli 9e61371
test(colima): format fresh store lifecycle assertion
joshuarli f70c0c0
up
joshuarli aab1634
fix(colima): treat follow-up starts as existing instances
joshuarli 5c1a81f
chore(colima): satisfy configured formatter
joshuarli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| from __future__ import annotations | ||
|
|
||
| from devenv.lib import colima | ||
| from devenv.lib_check.types import checker | ||
| from devenv.lib_check.types import fixer | ||
|
|
||
| tags: set[str] = {"builtin", "colima"} | ||
| name = "colima's VM shouldn't report SVE support on CPUs without SVE" | ||
|
|
||
|
|
||
| @checker | ||
| def check() -> tuple[bool, str]: | ||
| try: | ||
| misreported = colima.vm_misreports_sve() | ||
| except RuntimeError: | ||
| # colima isn't running, which another check covers | ||
| return True, "" | ||
|
|
||
| if misreported: | ||
| return ( | ||
| False, | ||
| "colima's VM kernel reports SVE2, but this CPU has no SVE. " | ||
| "Programs that use it crash with 'Illegal instruction'.", | ||
| ) | ||
|
|
||
| return True, "" | ||
|
|
||
|
|
||
| @fixer | ||
| def fix() -> tuple[bool, str]: | ||
| # upgrades the VM's kernel and restarts colima to boot it | ||
| status = colima.start(restart=True) | ||
| if status != colima.ColimaStatus.UP: | ||
| return False, "colima is unhealthy" | ||
|
|
||
| # start only warns if it couldn't upgrade the kernel | ||
| try: | ||
| misreported = colima.vm_misreports_sve() | ||
| except RuntimeError as e: | ||
| return False, f"{e}" | ||
| if misreported: | ||
| return False, "colima's VM still misreports SVE, see above" | ||
|
|
||
| return True, "" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.