Support installing specific AtomVM releases - #79
Conversation
|
Just nitpicks: PR Review: Support installing specific AtomVM releasesReviewed commit VerdictApprove with one Low-severity fix recommended. I found no blocking correctness, security, or compatibility issues in the change. The new FindingsLow — A nonexistent version fails late with a generic HTTP error
Ideally, fetch and validate the release metadata before esptool setup/device selection, then select the chip-specific asset after the device is known. At minimum, distinguish a missing requested tag from other GitHub failures: diff --git a/lib/mix/tasks/esp32.install.ex b/lib/mix/tasks/esp32.install.ex
@@
else
{:error, reason} ->
raise "Failed to fetch release: #{inspect(reason)}"
+ %{status: 404} when is_binary(version) ->
+ Mix.raise("AtomVM release not found: #{inspect(version)}")
+
%{status: status} ->
raise "GitHub API returned status #{status}"This minimum fix makes the error actionable, but it does not fix the ordering: the API request would still occur after device selection. Splitting release metadata retrieval from chip-specific asset selection is necessary if invalid tags must be diagnosed independently of connected hardware. The current ordering does not risk erasing or flashing the device because both destructive operations occur only after Non-blocking suggestionMake a missing asset error identify the requested releaseIf a valid release does not contain an Elixir image for the detected chip, the current error only says diff --git a/lib/mix/tasks/esp32.install.ex b/lib/mix/tasks/esp32.install.ex
@@
nil ->
- raise "No matching release found for #{chip_family}"
+ release = version || "the latest release"
+ raise "No matching Elixir image found for #{chip_family} in #{release}"
end
endThis is a user-experience improvement only and should not block merging. Oracle cross-checkOracle independently reviewed the commit and this document. It confirmed the invalid-version finding and safety analysis, including that a 404 occurs before erase/flash, and found no additional actionable regressions. It also confirmed that the existing tests do not exercise HTTP error handling. Verification
|
Summary
Add a
--versionoption tomix atomvm.esp32.installfor installing a specific AtomVM release, including prereleases.When omitted, the task continues to install the latest stable release.
Testing
mix testv0.7.0-alpha.1on an ESP32-C5 and verified it boots successfullyNotes
mix testreports an existing failure unrelated to this change. The tests covering the new--versionbehavior pass.Closes #78