From 609b8b61bedee03bbcdd5f26266636e3706afdb5 Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Sat, 15 Mar 2025 09:12:55 -0500 Subject: [PATCH 1/4] tests/lua-5: fix checkPropogatedBuildInputs test Dependencies changed in https://github.com/NixOS/nixpkgs/pull/342196 --- .../development/interpreters/lua-5/tests/default.nix | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pkgs/development/interpreters/lua-5/tests/default.nix b/pkgs/development/interpreters/lua-5/tests/default.nix index b97266bcf83e..92c6b69e5fcb 100644 --- a/pkgs/development/interpreters/lua-5/tests/default.nix +++ b/pkgs/development/interpreters/lua-5/tests/default.nix @@ -123,12 +123,14 @@ pkgs.recurseIntoAttrs ({ checkPropagatedBuildInputs = pkgs.runCommandLocal "test-${lua.name}-setup-hook" ({ - # lua-curl is a propagatedBuildInput of rest-nvim has buildInputs = [ lua.pkgs.rest-nvim ]; }) - ('' - ${lua}/bin/lua -e "require'cURL'" - touch $out - ''); + # `xml2lua` is a propagatedBuildInput of rest-nvim + ( + '' + ${lua}/bin/lua -e "require'xml2lua'" + touch $out + '' + ); }) From 4249106f2e8e819c6bcff94a619a40c8e75e5586 Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Sat, 15 Mar 2025 09:25:45 -0500 Subject: [PATCH 2/4] tests/lua-5: fix lint errors Unnecessary parenthesis --- .../interpreters/lua-5/tests/default.nix | 46 +++++++++---------- 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/pkgs/development/interpreters/lua-5/tests/default.nix b/pkgs/development/interpreters/lua-5/tests/default.nix index 92c6b69e5fcb..6d879ce43292 100644 --- a/pkgs/development/interpreters/lua-5/tests/default.nix +++ b/pkgs/development/interpreters/lua-5/tests/default.nix @@ -10,10 +10,10 @@ let lua: { name, command }: pkgs.runCommandLocal "test-${lua.name}-${name}" - ({ + { nativeBuildInputs = [ lua ]; meta.platforms = lua.meta.platforms; - }) + } ( '' source ${./assert.sh} @@ -58,7 +58,7 @@ let ";./?.lua;${lua}/share/luajit-2.1/?.lua;/usr/local/share/lua/5.1/?.lua;/usr/local/share/lua/5.1/?/init.lua;${lua}/share/lua/5.1/?.lua;${lua}/share/lua/5.1/?/init.lua;"; }; in -pkgs.recurseIntoAttrs ({ +pkgs.recurseIntoAttrs { checkInterpreterPatch = let @@ -75,12 +75,12 @@ pkgs.recurseIntoAttrs ({ checkWrapping = pkgs.runCommandLocal "test-${lua.name}-wrapping" - ({ - }) - ('' + { + } + '' grep -- 'LUA_PATH=' ${wrappedHello}/bin/hello touch $out - ''); + ''; # checks that lua's setup-hook adds dependencies to LUA_PATH # Prevents the following regressions @@ -90,21 +90,21 @@ pkgs.recurseIntoAttrs ({ # stdin:1: module 'http.request' not found: checkSetupHook = pkgs.runCommandLocal "test-${lua.name}-setup-hook" - ({ + { nativeBuildInputs = [ lua ]; buildInputs = [ lua.pkgs.http ]; meta.platforms = lua.meta.platforms; - }) - ('' + } + '' ${lua}/bin/lua -e "require'http.request'" touch $out - ''); + ''; checkRelativeImports = pkgs.runCommandLocal "test-${lua.name}-relative-imports" - ({ - }) - ('' + { + } + '' source ${./assert.sh} lua_vanilla_package_path="$(${lua}/bin/lua -e "print(package.path)")" @@ -117,20 +117,18 @@ pkgs.recurseIntoAttrs ({ assertStringContains "$lua_with_module_package_path" "./?/init.lua" touch $out - ''); + ''; # Check that a lua package's propagatedBuildInputs end up in LUA_PATH checkPropagatedBuildInputs = pkgs.runCommandLocal "test-${lua.name}-setup-hook" - ({ + { buildInputs = [ lua.pkgs.rest-nvim ]; - }) + } # `xml2lua` is a propagatedBuildInput of rest-nvim - ( - '' - ${lua}/bin/lua -e "require'xml2lua'" - touch $out - '' - ); + '' + ${lua}/bin/lua -e "require'xml2lua'" + touch $out + ''; -}) +} From e3864d7d8988652b939e9217cbd122edb2bdc57b Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Sat, 15 Mar 2025 09:29:14 -0500 Subject: [PATCH 3/4] tests/lua-5: fix `checkInterpreterPath` test name Checking a path location, not a patch. --- pkgs/development/interpreters/lua-5/tests/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/interpreters/lua-5/tests/default.nix b/pkgs/development/interpreters/lua-5/tests/default.nix index 6d879ce43292..19146fdeb06e 100644 --- a/pkgs/development/interpreters/lua-5/tests/default.nix +++ b/pkgs/development/interpreters/lua-5/tests/default.nix @@ -60,7 +60,7 @@ let in pkgs.recurseIntoAttrs { - checkInterpreterPatch = + checkInterpreterPath = let golden_LUA_PATH = golden_LUA_PATHS.${lib.versions.majorMinor lua.version}; in From 25e5402a49642b302eefda7e1eda4f3848be5de4 Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Sun, 16 Mar 2025 10:34:51 -0500 Subject: [PATCH 4/4] tests/lua-5: format tweak --- .../interpreters/lua-5/tests/default.nix | 36 ++++++++----------- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/pkgs/development/interpreters/lua-5/tests/default.nix b/pkgs/development/interpreters/lua-5/tests/default.nix index 19146fdeb06e..69cd8532d738 100644 --- a/pkgs/development/interpreters/lua-5/tests/default.nix +++ b/pkgs/development/interpreters/lua-5/tests/default.nix @@ -73,14 +73,10 @@ pkgs.recurseIntoAttrs { ''; }; - checkWrapping = - pkgs.runCommandLocal "test-${lua.name}-wrapping" - { - } - '' - grep -- 'LUA_PATH=' ${wrappedHello}/bin/hello - touch $out - ''; + checkWrapping = pkgs.runCommandLocal "test-${lua.name}-wrapping" { } '' + grep -- 'LUA_PATH=' ${wrappedHello}/bin/hello + touch $out + ''; # checks that lua's setup-hook adds dependencies to LUA_PATH # Prevents the following regressions @@ -100,24 +96,20 @@ pkgs.recurseIntoAttrs { touch $out ''; - checkRelativeImports = - pkgs.runCommandLocal "test-${lua.name}-relative-imports" - { - } - '' - source ${./assert.sh} + checkRelativeImports = pkgs.runCommandLocal "test-${lua.name}-relative-imports" { } '' + source ${./assert.sh} - lua_vanilla_package_path="$(${lua}/bin/lua -e "print(package.path)")" - lua_with_module_package_path="$(${luaWithModule}/bin/lua -e "print(package.path)")" + lua_vanilla_package_path="$(${lua}/bin/lua -e "print(package.path)")" + lua_with_module_package_path="$(${luaWithModule}/bin/lua -e "print(package.path)")" - assertStringContains "$lua_vanilla_package_path" "./?.lua" - assertStringContains "$lua_vanilla_package_path" "./?/init.lua" + assertStringContains "$lua_vanilla_package_path" "./?.lua" + assertStringContains "$lua_vanilla_package_path" "./?/init.lua" - assertStringContains "$lua_with_module_package_path" "./?.lua" - assertStringContains "$lua_with_module_package_path" "./?/init.lua" + assertStringContains "$lua_with_module_package_path" "./?.lua" + assertStringContains "$lua_with_module_package_path" "./?/init.lua" - touch $out - ''; + touch $out + ''; # Check that a lua package's propagatedBuildInputs end up in LUA_PATH checkPropagatedBuildInputs =