diff options
author | Luau <luau.project@gmail.com> | 2025-02-24 19:52:57 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-24 19:52:57 -0300 |
commit | c71174f1c20c2b57265a5cedfdccda559445e55c (patch) | |
tree | 8e44417b3323186a20f01ec9077201e2f99015d0 /src | |
parent | 41a14ed522d6904ad6bc14dd737a4cdc6142ca82 (diff) | |
download | luarocks-c71174f1c20c2b57265a5cedfdccda559445e55c.tar.gz luarocks-c71174f1c20c2b57265a5cedfdccda559445e55c.tar.bz2 luarocks-c71174f1c20c2b57265a5cedfdccda559445e55c.zip |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/luarocks/core/cfg.lua | 4 |
1 files changed, 3 insertions, 1 deletions
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) | |||
813 | 813 | ||
814 | local defaults = make_defaults(cfg.lua_version, processor, platforms, cfg.home) | 814 | local defaults = make_defaults(cfg.lua_version, processor, platforms, cfg.home) |
815 | 815 | ||
816 | if platforms.windows and hardcoded.WIN_TOOLS then | 816 | if platforms.windows and not platforms.msys2_mingw_w64 and hardcoded.WIN_TOOLS then |
817 | local tools = { "SEVENZ", "CP", "FIND", "LS", "MD5SUM", "WGET", } | 817 | local tools = { "SEVENZ", "CP", "FIND", "LS", "MD5SUM", "WGET", } |
818 | for _, tool in ipairs(tools) do | 818 | for _, tool in ipairs(tools) do |
819 | defaults.variables[tool] = '"' .. dir.path(hardcoded.WIN_TOOLS, defaults.variables[tool] .. '.exe') .. '"' | 819 | defaults.variables[tool] = '"' .. dir.path(hardcoded.WIN_TOOLS, defaults.variables[tool] .. '.exe') .. '"' |
820 | end | 820 | end |
821 | elseif platforms.msys2_mingw_w64 then | ||
822 | defaults.fs_use_modules = false | ||
821 | else | 823 | else |
822 | defaults.fs_use_modules = true | 824 | defaults.fs_use_modules = true |
823 | end | 825 | end |