From fda838be98a94f8c1fed30030c986c112032b3dd Mon Sep 17 00:00:00 2001 From: Andrea Arturo Venti Fuentes Date: Mon, 21 Apr 2025 12:57:32 -0400 Subject: [PATCH 1/6] fix(pack.lua): skip selene install on aarch64 platforms selene is not compatible with aarch64 (e.g., Raspberry Pi 5). This adds architecture detection to avoid installing selene where unsupported, while preserving all other functionality. This prevents startup errors and failed installs. --- lua/astrocommunity/pack/lua/init.lua | 67 ++++++++++++++++++++-------- 1 file changed, 49 insertions(+), 18 deletions(-) diff --git a/lua/astrocommunity/pack/lua/init.lua b/lua/astrocommunity/pack/lua/init.lua index db9eee282..29e0148f0 100644 --- a/lua/astrocommunity/pack/lua/init.lua +++ b/lua/astrocommunity/pack/lua/init.lua @@ -2,13 +2,24 @@ local function selene_configured(path) return #vim.fs.find("selene.toml", { path = path, upward = true, type = "file" }) > 0 end +local is_aarch64 = vim.loop.os_uname().machine == "aarch64" + return { { "AstroNvim/astrolsp", optional = true, opts = { config = { - lua_ls = { settings = { Lua = { hint = { enable = true, arrayIndex = "Disable" } } } }, + lua_ls = { + settings = { + Lua = { + hint = { + enable = true, + arrayIndex = "Disable", + }, + }, + }, + }, }, }, }, @@ -32,14 +43,24 @@ return { "jay-babu/mason-null-ls.nvim", optional = true, opts = function(_, opts) - opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "stylua", "selene" }) + opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { + "stylua", + -- only include selene if not aarch64 + (not is_aarch64 and "selene") or nil, + }) + if not opts.handlers then opts.handlers = {} end - opts.handlers.selene = function(source_name, methods) - local null_ls = require "null-ls" - for _, method in ipairs(methods) do - null_ls.register(null_ls.builtins[method][source_name].with { - runtime_condition = function(params) return selene_configured(params.bufname) end, - }) + + if not is_aarch64 then + opts.handlers.selene = function(source_name, methods) + local null_ls = require "null-ls" + for _, method in ipairs(methods) do + null_ls.register(null_ls.builtins[method][source_name].with { + runtime_condition = function(params) + return selene_configured(params.bufname) + end, + }) + end end end end, @@ -48,8 +69,12 @@ return { "WhoIsSethDaniel/mason-tool-installer.nvim", optional = true, opts = function(_, opts) - opts.ensure_installed = - require("astrocore").list_insert_unique(opts.ensure_installed, { "lua-language-server", "stylua", "selene" }) + opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { + "lua-language-server", + "stylua", + -- only install selene if not on aarch64 + (not is_aarch64 and "selene") or nil, + }) end, }, { @@ -64,13 +89,19 @@ return { { "mfussenegger/nvim-lint", optional = true, - opts = { - linters_by_ft = { - lua = { "selene" }, - }, - linters = { - selene = { condition = function(ctx) return selene_configured(ctx.filename) end }, - }, - }, + opts = function(_, opts) + opts.linters_by_ft = { + lua = is_aarch64 and {} or { "selene" }, + } + + if not is_aarch64 then + opts.linters = opts.linters or {} + opts.linters.selene = { + condition = function(ctx) + return selene_configured(ctx.filename) + end, + } + end + end, }, } From 5a09a86e59eeb3af16bb296edcfe3c47d306c335 Mon Sep 17 00:00:00 2001 From: Andrea Arturo Venti Fuentes Date: Mon, 21 Apr 2025 13:07:03 -0400 Subject: [PATCH 2/6] style(lua-pack): fix stylua formatting for CI compliance --- lua/astrocommunity/pack/lua/init.lua | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/lua/astrocommunity/pack/lua/init.lua b/lua/astrocommunity/pack/lua/init.lua index 29e0148f0..9c60a0c23 100644 --- a/lua/astrocommunity/pack/lua/init.lua +++ b/lua/astrocommunity/pack/lua/init.lua @@ -45,7 +45,6 @@ return { opts = function(_, opts) opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "stylua", - -- only include selene if not aarch64 (not is_aarch64 and "selene") or nil, }) @@ -56,9 +55,7 @@ return { local null_ls = require "null-ls" for _, method in ipairs(methods) do null_ls.register(null_ls.builtins[method][source_name].with { - runtime_condition = function(params) - return selene_configured(params.bufname) - end, + runtime_condition = function(params) return selene_configured(params.bufname) end, }) end end @@ -72,7 +69,6 @@ return { opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "lua-language-server", "stylua", - -- only install selene if not on aarch64 (not is_aarch64 and "selene") or nil, }) end, @@ -97,9 +93,7 @@ return { if not is_aarch64 then opts.linters = opts.linters or {} opts.linters.selene = { - condition = function(ctx) - return selene_configured(ctx.filename) - end, + condition = function(ctx) return selene_configured(ctx.filename) end, } end end, From bc73e2a49147920922272886c9578af303988b7c Mon Sep 17 00:00:00 2001 From: Uzair Aftab <48220549+Uzaaft@users.noreply.github.com> Date: Thu, 15 May 2025 14:12:12 +0200 Subject: [PATCH 3/6] Update README.md --- lua/astrocommunity/pack/lua/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/astrocommunity/pack/lua/README.md b/lua/astrocommunity/pack/lua/README.md index f50255014..51e3a70c3 100644 --- a/lua/astrocommunity/pack/lua/README.md +++ b/lua/astrocommunity/pack/lua/README.md @@ -6,3 +6,4 @@ This plugin pack does the following: - Adds `lua_ls` language server - Adds `stylua` formatter - Adds `selene` linter + - On `aarch64` machines this is skipped. From 54783134a1c6246a6984d5ccac57e20c828ae20b Mon Sep 17 00:00:00 2001 From: Andrea Arturo Venti Fuentes Date: Thu, 15 May 2025 13:43:30 -0400 Subject: [PATCH 4/6] refactor(nvim-lint): group selene config under single if block --- lua/astrocommunity/pack/lua/init.lua | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lua/astrocommunity/pack/lua/init.lua b/lua/astrocommunity/pack/lua/init.lua index 9c60a0c23..c6e406000 100644 --- a/lua/astrocommunity/pack/lua/init.lua +++ b/lua/astrocommunity/pack/lua/init.lua @@ -86,15 +86,18 @@ return { "mfussenegger/nvim-lint", optional = true, opts = function(_, opts) - opts.linters_by_ft = { - lua = is_aarch64 and {} or { "selene" }, - } - if not is_aarch64 then + opts.linters_by_ft = { + lua = { "selene" }, + } opts.linters = opts.linters or {} opts.linters.selene = { condition = function(ctx) return selene_configured(ctx.filename) end, } + else + opts.linters_by_ft = { + lua = {}, + } end end, }, From 323484ff8a0834412242396de8666a56974ec700 Mon Sep 17 00:00:00 2001 From: Uzair Aftab <48220549+Uzaaft@users.noreply.github.com> Date: Sat, 17 May 2025 16:50:59 +0200 Subject: [PATCH 5/6] Update init.lua --- lua/astrocommunity/pack/lua/init.lua | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lua/astrocommunity/pack/lua/init.lua b/lua/astrocommunity/pack/lua/init.lua index c6e406000..c32c35c82 100644 --- a/lua/astrocommunity/pack/lua/init.lua +++ b/lua/astrocommunity/pack/lua/init.lua @@ -94,11 +94,6 @@ return { opts.linters.selene = { condition = function(ctx) return selene_configured(ctx.filename) end, } - else - opts.linters_by_ft = { - lua = {}, - } - end end, }, } From f695282ce69f92fe6e78c2df6044fc02a59976eb Mon Sep 17 00:00:00 2001 From: Uzair Aftab <48220549+Uzaaft@users.noreply.github.com> Date: Sat, 17 May 2025 16:51:19 +0200 Subject: [PATCH 6/6] Update init.lua --- lua/astrocommunity/pack/lua/init.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/astrocommunity/pack/lua/init.lua b/lua/astrocommunity/pack/lua/init.lua index c32c35c82..001a09e4d 100644 --- a/lua/astrocommunity/pack/lua/init.lua +++ b/lua/astrocommunity/pack/lua/init.lua @@ -94,6 +94,7 @@ return { opts.linters.selene = { condition = function(ctx) return selene_configured(ctx.filename) end, } + end end, }, }