neovim-require-check-hook: remove $out from rtp (#529637)

This commit is contained in:
Austin Horstman
2026-06-08 21:01:49 +00:00
committed by GitHub
2 changed files with 24 additions and 3 deletions
@@ -558,4 +558,25 @@ pkgs.lib.recurseIntoAttrs rec {
EOF
'';
};
nvim_require_check_rtp_no_duplicate = vimUtils.buildVimPlugin {
pname = "neovim-require-check-rtp-no-duplicate-test";
version = "0";
src = runCommandLocal "neovim-require-check-rtp-no-duplicate-src" { } ''
mkdir -p "$out/lua/require-check-rtp-dedup"
cat > "$out/lua/require-check-rtp-dedup/init.lua" <<'EOF'
local target = "lua/require-check-rtp-dedup/init.lua"
local matches = vim.api.nvim_get_runtime_file(target, true)
if #matches ~= 1 then
error(
("expected plugin on runtimepath exactly once, found %d:\n%s"):format(
#matches,
table.concat(matches, "\n")
)
)
end
return {}
EOF
'';
};
}
@@ -98,9 +98,9 @@ run_require_checks() {
if [ "$skip" = false ]; then
echo "Attempting to require module: $name"
if @nvimBinary@ -es --headless -n -u NONE -i NONE --clean -V1 \
--cmd "set rtp+=$out,${deps// /,}" \
--cmd "set rtp+=$out,${nativeCheckInputs// /,}" \
--cmd "set rtp+=$out,${checkInputs// /,}" \
--cmd "set rtp+=${deps// /,}" \
--cmd "set rtp+=${nativeCheckInputs// /,}" \
--cmd "set rtp+=${checkInputs// /,}" \
"${luaPathArgs[@]}" \
--cmd "set packpath^=$packPathDir" \
--cmd "packadd testPlugin" \