From b8ce3376e8d4f5e9e8e3052f6d5fe74e64c794b3 Mon Sep 17 00:00:00 2001 From: Yee Cheng Chin Date: Fri, 3 Apr 2026 19:19:36 -0700 Subject: [PATCH 1/2] ci: Fix non-publish builds failing due to failing to use Homebrew iconv CI builds switched to using Homebrew iconv instead of native one in #1626, but for non-publish builds this assumed libiconv was installed by Homebrew, which wasn't always the case. This led to build failures if Homebrew didn't have it installed. Fix it so that we only use Homebrew libiconv in publish builds and use Apple iconv otherwise. This also helps test that both versions work correctly in CI. --- .github/workflows/macvim-buildtest.yaml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/macvim-buildtest.yaml b/.github/workflows/macvim-buildtest.yaml index 5bee202306..0a421be5ed 100644 --- a/.github/workflows/macvim-buildtest.yaml +++ b/.github/workflows/macvim-buildtest.yaml @@ -232,8 +232,10 @@ jobs: sed -i.bak -f ci/config.mk.optimized.sed src/auto/config.mk fi - # Use Homebrew GNU libiconv since Apple iconv has been broken since macOS 14 - sed -i.bak -f ci/config.mk.brew-libiconv.sed src/auto/config.mk + if ${{ inputs.publish == true }}; then + # Use Homebrew GNU libiconv since Apple iconv has been broken since macOS 14 + sed -i.bak -f ci/config.mk.brew-libiconv.sed src/auto/config.mk + fi - name: Modify configure result if: inputs.publish @@ -284,9 +286,11 @@ jobs: echo 'Found external dynamic linkage!'; false fi - # Make sure we are not using system iconv, which has been buggy since macOS 14. - if otool -L ${VIM_BIN} | grep '^\s*/usr/lib/libiconv'; then - echo 'Using system iconv! We should be linking against GNU iconv instead.'; false + if ${{ inputs.publish == true }}; then + # Make sure we are not using system iconv, which has been buggy since macOS 14. + if otool -L ${VIM_BIN} | grep '^\s*/usr/lib/libiconv'; then + echo 'Using system iconv! We should be linking against GNU iconv instead.'; false + fi fi # Make sure that --disable-sparkle flag will properly exclude all references to Sparkle symbols. This is From 859d963f78bd2c336a45a322298b3aad17ec8f64 Mon Sep 17 00:00:00 2001 From: Yee Cheng Chin Date: Fri, 3 Apr 2026 19:28:44 -0700 Subject: [PATCH 2/2] Fix Lua 5.5 dynamic build Cherry-picked from vim/vim#19909 --- src/if_lua.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/if_lua.c b/src/if_lua.c index 3642561617..e496402362 100644 --- a/src/if_lua.c +++ b/src/if_lua.c @@ -215,7 +215,11 @@ static void luaV_call_lua_func_free(void *state); # define luaopen_os dll_luaopen_os # define luaopen_package dll_luaopen_package # define luaopen_debug dll_luaopen_debug -# define luaL_openlibs dll_luaL_openlibs +# if LUA_VERSION_NUM >= 505 +# define luaL_openselectedlibs dll_luaL_openselectedlibs +# else +# define luaL_openlibs dll_luaL_openlibs +# endif // lauxlib # if LUA_VERSION_NUM <= 501 @@ -331,7 +335,11 @@ int (*dll_luaopen_io) (lua_State *L); int (*dll_luaopen_os) (lua_State *L); int (*dll_luaopen_package) (lua_State *L); int (*dll_luaopen_debug) (lua_State *L); +# if LUA_VERSION_NUM >= 505 +void (*dll_luaL_openselectedlibs) (lua_State *L, int load, int preload); +# else void (*dll_luaL_openlibs) (lua_State *L); +# endif typedef void **luaV_function; typedef struct { @@ -439,7 +447,11 @@ static const luaV_Reg luaV_dll[] = { {"luaopen_os", (luaV_function) &dll_luaopen_os}, {"luaopen_package", (luaV_function) &dll_luaopen_package}, {"luaopen_debug", (luaV_function) &dll_luaopen_debug}, +# if LUA_VERSION_NUM >= 505 + {"luaL_openselectedlibs", (luaV_function) &dll_luaL_openselectedlibs}, +# else {"luaL_openlibs", (luaV_function) &dll_luaL_openlibs}, +# endif {NULL, NULL} }; @@ -2571,7 +2583,11 @@ luaopen_vim(lua_State *L) luaV_newstate(void) { lua_State *L = luaL_newstate(); +# if LUA_VERSION_NUM >= 505 + luaL_openselectedlibs(L, ~0, 0); // core libs +# else luaL_openlibs(L); // core libs +# endif lua_pushcfunction(L, luaopen_vim); // vim lua_call(L, 0, 0); return L;