From ab29baffc69499a3c46e7b8c0e6e485466f498e3 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Sat, 5 Dec 2026 11:59:07 -0600 Subject: [PATCH] Bootstrap(fix): Select Linux ARM64 tools MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit why: Linux ARM64 contributors need native editor and language-server tools to run the same bootstrap checks as CI. what: - Select and verify the archive for the machine’s architecture, including Neovim releases with different asset names. --- .github/CONTRIBUTING.md | 17 +++++--- scripts/bootstrap/hosts.lua | 50 ++++++++++++++-------- scripts/bootstrap/luals.lua | 4 ++ scripts/bootstrap/tests/test_bootstrap.lua | 17 +++++++- 4 files changed, 63 insertions(+), 25 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index a4b6ff5c..c1d570a8 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -69,7 +69,8 @@ $ mise exec -- lua scripts/bootstrap/bootstrap.lua rocks \ --lua=.cache/toolchains/lua-5.4.9/bin/lua ``` -Install LuaLS 3.19.1 into the ignored local cache: +Install LuaLS 3.19.1 into the ignored local cache on Linux x86_64, Linux ARM64 +or macOS ARM64. ```console $ mise exec -- lua scripts/bootstrap/bootstrap.lua luals @@ -81,16 +82,22 @@ scripts keep LuaJIT and PUC Lua 5.1 rocks in separate cache trees, even though both report the Lua 5.1 ABI. LuaJIT uses the same absolute prefix during build and installation, following its [installation guide](https://luajit.org/install.html). -Install the accepted Neovim hosts into separate local cache directories: +Install the accepted Neovim hosts into separate local cache directories. Use +all four pinned versions on Linux x86_64. ```console $ luajit scripts/bootstrap/bootstrap.lua hosts \ 0.10.0 0.10.4 0.11.7 0.12.5 ``` -The host bootstrap supports Linux x86_64. It verifies pinned official archive -hashes, each executable and its embedded runtime. Existing installations stay -unchanged. `--check` verifies the cached hosts without network access. +On Linux ARM64, use the pinned Neovim 0.12.5 archive. + +```console +$ luajit scripts/bootstrap/bootstrap.lua hosts 0.12.5 +``` + +The bootstrap verifies each official archive's pinned hash, the executable +and its embedded runtime. `--check` verifies cached hosts offline. ## Validation diff --git a/scripts/bootstrap/hosts.lua b/scripts/bootstrap/hosts.lua index d67e5b80..0228ced8 100644 --- a/scripts/bootstrap/hosts.lua +++ b/scripts/bootstrap/hosts.lua @@ -8,23 +8,35 @@ local shell = require("support.shell") local M = {} --- v0.10.x checksum assets and v0.11+ release asset digests, all for Linux x86_64. +-- v0.10.x checksum assets and v0.11+ release asset digests. M.RELEASES = { ["0.10.0"] = { - "nvim-linux64", - "be1f0988d0de71c375982b87b86cd28d2bab35ece8285abe3b0aac57604dfc5a", + ["Linux x86_64"] = { + "nvim-linux64", + "be1f0988d0de71c375982b87b86cd28d2bab35ece8285abe3b0aac57604dfc5a", + }, }, ["0.10.4"] = { - "nvim-linux-x86_64", - "95aaa8e89473f5421114f2787c13ae0ec6e11ebbd1a13a1bd6fcf63420f8073f", + ["Linux x86_64"] = { + "nvim-linux-x86_64", + "95aaa8e89473f5421114f2787c13ae0ec6e11ebbd1a13a1bd6fcf63420f8073f", + }, }, ["0.11.7"] = { - "nvim-linux-x86_64", - "38a7c6317f94503841096c00e8fde05ef04b9472fc9d7d62b6e033cecd6f7991", + ["Linux x86_64"] = { + "nvim-linux-x86_64", + "38a7c6317f94503841096c00e8fde05ef04b9472fc9d7d62b6e033cecd6f7991", + }, }, ["0.12.5"] = { - "nvim-linux-x86_64", - "bce0f56eda1f1b1db6eee8f4133d7a38813ea07933837dd1777411ca384c6875", + ["Linux x86_64"] = { + "nvim-linux-x86_64", + "bce0f56eda1f1b1db6eee8f4133d7a38813ea07933837dd1777411ca384c6875", + }, + ["Linux aarch64"] = { + "nvim-linux-arm64", + "1aa5ca085249580ae0f91eb14f27ec0919773ff2d99a163d03f3d6c21ac29725", + }, }, } @@ -97,8 +109,13 @@ end ---@param version string ---@param check_only boolean -function M.bootstrap(version, check_only) - local flavor, checksum = M.RELEASES[version][1], M.RELEASES[version][2] +---@param host string +function M.bootstrap(version, check_only, host) + local artifact = M.RELEASES[version][host] + if not artifact then + error(("No pinned Neovim %s bootstrap artifact for %s"):format(version, host), 0) + end + local flavor, checksum = artifact[1], artifact[2] local asset = flavor .. ".tar.gz" local url = ("https://github.com/neovim/neovim/releases/download/v%s/%s"):format(version, asset) local source = repo.root .. "/.cache/source/nvim-" .. version @@ -124,7 +141,7 @@ function M.bootstrap(version, check_only) end local expected = { version = version, - platform = "Linux-x86_64", + platform = host:gsub(" ", "-"), artifact_url = url, artifact_sha256 = checksum, } @@ -158,7 +175,7 @@ function M.bootstrap(version, check_only) error("Neovim " .. version .. " executable changed since installation", 0) end end - local host = M.probe(executable, version) + local report = M.probe(executable, version) local result = json.object({ "version", "platform", @@ -172,7 +189,7 @@ function M.bootstrap(version, check_only) artifact_url = url, artifact_sha256 = checksum, executable_sha256 = executable_hash, - host = host, + host = report, }) if installed then files.write(receipt, json.encode(result, 2) .. "\n") @@ -202,13 +219,10 @@ function M.main(versions, check_only) end end local host = shell.check({ "uname", "-sm" }):match("^(.-)%s*$") - if host ~= "Linux x86_64" then - error("No pinned Neovim bootstrap artifact for this host; matrix cell remains untested", 0) - end local failures, started = 0, os.time() for _, version in ipairs(versions) do local cell_started = os.time() - local ok, report = pcall(M.bootstrap, version, check_only) + local ok, report = pcall(M.bootstrap, version, check_only, host) if ok then report.executable = repo.root .. "/.cache/toolchains/nvim-" .. version .. "/bin/nvim" report.status = "READY" diff --git a/scripts/bootstrap/luals.lua b/scripts/bootstrap/luals.lua index 7c19ed11..d9aab176 100644 --- a/scripts/bootstrap/luals.lua +++ b/scripts/bootstrap/luals.lua @@ -13,6 +13,10 @@ M.ARTIFACTS = { "linux-x64", "e9235d2d72ef55bc41cf8c99cda2ed64777682024b4bb81f5dea425060c5cbb8", }, + ["Linux aarch64"] = { + "linux-arm64", + "abd2572e8fc929dc838a81ffb8473c5bce0bf39bfe8edb4b120b3b623176ce83", + }, ["Darwin arm64"] = { "darwin-arm64", "0bc077f4447f076b4c92c14e9fd303f5b569eda2ec74b4dca2b55f75fae2e90c", diff --git a/scripts/bootstrap/tests/test_bootstrap.lua b/scripts/bootstrap/tests/test_bootstrap.lua index 9c5ed79d..5688e51d 100644 --- a/scripts/bootstrap/tests/test_bootstrap.lua +++ b/scripts/bootstrap/tests/test_bootstrap.lua @@ -41,8 +41,11 @@ function M.test_every_pin_is_a_full_digest_or_revision() test.assertEquals(#digest, 64, version) end test.assertEquals(#runtimes.LUAJIT_REVISION, 40) - for version, pin in pairs(hosts.RELEASES) do - test.assertEquals(#pin[2], 64, version) + for _, artifacts in pairs(hosts.RELEASES) do + for _, pin in pairs(artifacts) do + test.assertStrMatches(pin[2], "%x+") + test.assertEquals(#pin[2], 64) + end end for host, pin in pairs(luals.ARTIFACTS) do test.assertEquals(#pin[2], 64, host) @@ -130,6 +133,16 @@ function M.test_an_unknown_request_is_refused_before_anything_runs() test.assertErrorMsgContains("Unknown Neovim version", hosts.main, { "0.0.1" }, true) end +function M.test_a_known_neovim_release_requires_an_artifact_for_the_requested_host() + test.assertErrorMsgContains( + "No pinned Neovim 0.10.0 bootstrap artifact for Linux aarch64", + hosts.bootstrap, + "0.10.0", + true, + "Linux aarch64" + ) +end + function M.test_the_job_lua_is_mises_for_the_provided_version_and_a_built_one_otherwise() test.assertEquals( select_lua.built_path("5.4.9", "/work"),