fix(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 constant failed installs on Nvim start when using Lua pack.
📑 Description
This pull request introduces conditional support for the selene linter based on the system architecture, specifically excluding it on aarch64 systems. It also refactors related configurations to ensure compatibility and maintainability.
Conditional selene Support:
- Added a check for the system architecture (
aarch64) usingvim.loop.os_uname().machineand stored the result in a newis_aarch64variable. (lua/astrocommunity/pack/lua/init.lua, lua/astrocommunity/pack/lua/init.luaR5-R22) - Modified
mason-null-ls.nvimandmason-tool-installer.nvimconfigurations to conditionally includeselenein theensure_installedlist only if not onaarch64. (lua/astrocommunity/pack/lua/init.lua, lua/astrocommunity/pack/lua/init.luaL35-R77) - Updated
nvim-lintconfiguration to excludeselenefromlinters_by_ftandlintersonaarch64systems. (lua/astrocommunity/pack/lua/init.lua, lua/astrocommunity/pack/lua/init.luaL67-R105)
Review Checklist
Does this PR follow the [Contribution Guidelines](development guidelines)? Following is a partial checklist:
Proper conventional commit scoping:
-
If you are adding a new plugin, the scope would be the name of the category it is being added into. ex.
feat(utility): added noice.nvim plugin -
If you are modifying a pre-existing plugin or pack, the scope would be the name of the plugin folder. ex.
fix(noice-nvim): fix LSP handler error -
[x] Pull request title has the appropriate conventional commit type and scope where the scope is the name of the pre-existing directory in the project as described above
-
[x]
READMEis properly formatted and uses fenced in links with<url>unless they are inside a[title](url) -
[x] Entry returns a single plugin spec with the new plugin as the only top level spec (not applicable for recipes or packs).
-
[x] Proper usage of
optstable rather than setting things up with theconfigfunction. -
[x] Proper usage of
specstable for all specs that are not dependencies of a given plugin (not applicable for recipes or packs).
Selene actually supports and releases arm64/aarch64 binaries. Is it an issue with mason perhaps?
Yeah, when the Lua pack is enabled, Mason does not like it.
{ import = "astrocommunity.pack.lua" },
Mason says on each start:
Failed
✗ selene
▼ Displaying full log
The current platform is unsupported.
I used to have a workaround in mason.lua, but because a lot has changed recently in Mason and Nvim 0.11, my workaround does not work anymore.
lets try and upstream it to mason instead. What does the mason logs say?
:MasonLog gives the following, related to selene:
[INFO Mon 21 Apr 2025 14:51:20 EDT] ...Executing installer for Package(name=selene) {}
[ERROR Mon 21 Apr 2025 14:51:20 EDT] ...Installation failed for Package(name=selene) error="The current platform is unsupported."
[INFO Mon 21 Apr 2025 14:51:27 EDT] ...Executing installer for Package(name=selene) {}
[ERROR Mon 21 Apr 2025 14:51:27 EDT] ...Installation failed for Package(name=selene) error="The current platform is unsupported."
[INFO Mon 21 Apr 2025 15:38:03 EDT] ...Executing installer for Package(name=selene) {}
[ERROR Mon 21 Apr 2025 15:38:03 EDT] ...Installation failed for Package(name=selene) error="The current platform is unsupported."
[INFO Mon 21 Apr 2025 15:42:57 EDT] ...Executing installer for Package(name=selene) {}
[ERROR Mon 21 Apr 2025 15:42:57 EDT] ...Installation failed for Package(name=selene) error="The current platform is unsupported."
lets try and upstream it to mason instead. What does the mason logs say?
I went ahead and upstreamed it directly to Mason with a fix, as suggested. Here’s the PR: https://github.com/Kampfkarren/selene/pull/638
Lets get this merged in some point in the future. Left a comment.
Thank you! :)