From 41a14ed522d6904ad6bc14dd737a4cdc6142ca82 Mon Sep 17 00:00:00 2001 From: Luau Date: Mon, 24 Feb 2025 16:57:28 -0300 Subject: fix: override default C compiler to cc.exe on MSYS2 (#1754) ## Description Fixes #1753. Changes: 1. on each MSYS2 MinGW-w64 environment, there is a `cc.exe` that points to the default C compiler for the environment. 2. the line ```lua defaults.variables.PWD = "cd" ``` is meant to follow a MSYS2 patch ( https://github.com/msys2/MINGW-packages/blob/5fd4997c2508f0949366513f0a2dd4347f9c4e77/mingw-w64-lua-luarocks/0001-luarocks_msys2_mingw_w64.patch#L48 ) that fixes previous issues for them. --- src/luarocks/core/cfg.lua | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/luarocks/core/cfg.lua b/src/luarocks/core/cfg.lua index 6d8fe55b..e9139a4e 100644 --- a/src/luarocks/core/cfg.lua +++ b/src/luarocks/core/cfg.lua @@ -468,6 +468,12 @@ local function make_defaults(lua_version, target_cpu, platforms, home) end end + if platforms.msys2_mingw_w64 then + defaults.variables.PWD = "cd" + defaults.variables.CC = os.getenv("CC") or "cc" + defaults.variables.LD = os.getenv("CC") or "cc" + end + if platforms.bsd then defaults.variables.MAKE = "gmake" defaults.gcc_rpath = false -- cgit v1.2.3-55-g6feb