From c71174f1c20c2b57265a5cedfdccda559445e55c Mon Sep 17 00:00:00 2001 From: Luau Date: Mon, 24 Feb 2025 19:52:57 -0300 Subject: fix: allow Lua C modules to be uninstalled on MSYS2 (#1756) Fixes #1755. Changes: * the idea applied as a fix was mirrored from the changes of #1616, by setting ``` defaults.fs_use_modules = false ``` in a suitable place for MSYS2. * the line ``` if platforms.windows and not platforms.msys2_mingw_w64 and hardcoded.WIN_TOOLS then ``` is meant to follow a MSYS2 patch https://github.com/msys2/MINGW-packages/blob/343eeab4f185847981c6b644d775ee98717b6231/mingw-w64-lua-luarocks/0001-luarocks_msys2_mingw_w64.patch#L57 that fixes previous issues for them. --- src/luarocks/core/cfg.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/luarocks/core/cfg.lua b/src/luarocks/core/cfg.lua index e9139a4e..8c2d7d79 100644 --- a/src/luarocks/core/cfg.lua +++ b/src/luarocks/core/cfg.lua @@ -813,11 +813,13 @@ function cfg.init(detected, warning) local defaults = make_defaults(cfg.lua_version, processor, platforms, cfg.home) - if platforms.windows and hardcoded.WIN_TOOLS then + if platforms.windows and not platforms.msys2_mingw_w64 and hardcoded.WIN_TOOLS then local tools = { "SEVENZ", "CP", "FIND", "LS", "MD5SUM", "WGET", } for _, tool in ipairs(tools) do defaults.variables[tool] = '"' .. dir.path(hardcoded.WIN_TOOLS, defaults.variables[tool] .. '.exe') .. '"' end + elseif platforms.msys2_mingw_w64 then + defaults.fs_use_modules = false else defaults.fs_use_modules = true end -- cgit v1.2.3-55-g6feb