Build failed on Arch lua header mismatch
Browse files
Cloning into 'oxwm'...
done.
==> Starting pkgver()...
==> Updated version: oxwm-git 0.11.3.10.gf72f06d-1
==> Sources are ready.
==> Making package: oxwm-git 0.11.3.10.gf72f06d-1 (Tue 24 Mar 2026 04:43:15 AM EDT)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> WARNING: Using existing $srcdir/ tree
==> Starting pkgver()...
==> Starting build()...
==> Starting check()...
test
└─ run test
└─ compile test ReleaseSmall native 1 errors
error: undefined symbol: luaL_openselectedlibs
note: referenced by .zig-cache/o/747b51bcc23a666b914d361583a70c6c/test_zcu.o:.text
error: the following command failed with 1 compilation errors:
/usr/bin/zig test -fno-lld .zig-cache/o/3f099549888438d13cdc867461e07421/liblua.a -OReleaseSmall -I .zig-cache/o/53ed955ced3c0fd35a0b9feb57db3332 --dep lua -Mroot=/home/dwilliams/.cache/yay/oxwm-git/src/oxwm/tests/lua_config_tests.zig -OReleaseSmall -Mlua=/home/dwilliams/.cache/yay/oxwm-git/src/oxwm/src/config/lua.zig -lc --cache-dir .zig-cache --global-cache-dir /home/dwilliams/.cache/zig --name test --zig-lib-dir /usr/lib/zig/ --listen=-
Build Summary: 6/9 steps succeeded; 1 failed; 15/15 tests passed
test transitive failure
└─ run test transitive failure
└─ compile test ReleaseSmall native 1 errors
error: the following build command failed with exit code 1:
.zig-cache/o/9fc7ed28134f4e2db1c74dd2fec2d80c/build /usr/bin/zig /usr/lib/zig /home/dwilliams/.cache/yay/oxwm-git/src/oxwm .zig-cache /home/dwilliams/.cache/zig --seed 0x810c1ca4 -Z2a06ba5d3cde19b1 test -Doptimize=ReleaseSmall
==> ERROR: A failure occurred in check().
Aborting...
-> error making: oxwm-git-exit status 4
-> Failed to install the following packages. Manual intervention is required:
oxwm-git - exit status 4
zig version
0.15.2
Issue: Lua headers used by Zig tests didn’t match the bundled Lua library, causing luaL_openselectedlibs undefined symbol during zig build test.
Fix: all Zig modules/tests include the Lua dependency headers so the headers and linked Lua library are consistent.
On branch fix/lua-header-mismatch
Changes to be committed:
modified: build.zig
+12 −5 build.zig
| @@ -4,6 +4,8 @@ const zon = @import("build.zig.zon"); | |||
| 4 | pub fn build(b: *std.Build) void { | 4 | pub fn build(b: *std.Build) void { |
| 5 | const target = b.standardTargetOptions(.{}); | 5 | const target = b.standardTargetOptions(.{}); |
| 6 | const optimize = b.standardOptimizeOption(.{}); | 6 | const optimize = b.standardOptimizeOption(.{}); |
| 7 | + const lua_dep = b.dependency("lua", .{}); | ||
| 8 | + const lua_headers = lua_dep.path("src/"); | ||
| 7 | 9 | ||
| 8 | const exe = b.addExecutable(.{ | 10 | const exe = b.addExecutable(.{ |
| 9 | .name = "oxwm", | 11 | .name = "oxwm", |
| @@ -13,6 +15,7 @@ pub fn build(b: *std.Build) void { | |||
| 13 | .optimize = optimize, | 15 | .optimize = optimize, |
| 14 | }), | 16 | }), |
| 15 | }); | 17 | }); |
| 18 | + exe.root_module.addIncludePath(lua_headers); | ||
| 16 | 19 | ||
| 17 | const exe_options = b.addOptions(); | 20 | const exe_options = b.addOptions(); |
| 18 | exe_options.addOption([]const u8, "version", zon.version); | 21 | exe_options.addOption([]const u8, "version", zon.version); |
| @@ -24,7 +27,7 @@ pub fn build(b: *std.Build) void { | |||
| 24 | 27 | ||
| 25 | exe.use_lld = false; | 28 | exe.use_lld = false; |
| 26 | 29 | ||
| 27 | - const lua = buildLua(b, target, optimize); | 30 | + const lua = buildLua(b, lua_dep, target, optimize); |
| 28 | exe.linkLibrary(lua); | 31 | exe.linkLibrary(lua); |
| 29 | exe.linkSystemLibrary("X11"); | 32 | exe.linkSystemLibrary("X11"); |
| 30 | exe.linkSystemLibrary("Xinerama"); | 33 | exe.linkSystemLibrary("Xinerama"); |
| @@ -61,6 +64,7 @@ pub fn build(b: *std.Build) void { | |||
| 61 | }), | 64 | }), |
| 62 | }); | 65 | }); |
| 63 | src_main_unit_tests.use_lld = false; | 66 | src_main_unit_tests.use_lld = false; |
| 67 | + src_main_unit_tests.root_module.addIncludePath(lua_headers); | ||
| 64 | src_main_unit_tests.linkLibrary(lua); | 68 | src_main_unit_tests.linkLibrary(lua); |
| 65 | src_main_unit_tests.linkSystemLibrary("X11"); | 69 | src_main_unit_tests.linkSystemLibrary("X11"); |
| 66 | src_main_unit_tests.linkSystemLibrary("Xinerama"); | 70 | src_main_unit_tests.linkSystemLibrary("Xinerama"); |
| @@ -77,11 +81,14 @@ pub fn build(b: *std.Build) void { | |||
| 77 | }), | 81 | }), |
| 78 | }); | 82 | }); |
| 79 | lua_config_tests.use_lld = false; | 83 | lua_config_tests.use_lld = false; |
| 80 | - lua_config_tests.root_module.addImport("lua", b.createModule(.{ | 84 | + lua_config_tests.root_module.addIncludePath(lua_headers); |
| 85 | + const lua_config_module = b.createModule(.{ | ||
| 81 | .root_source_file = b.path("src/config/lua.zig"), | 86 | .root_source_file = b.path("src/config/lua.zig"), |
| 82 | .target = target, | 87 | .target = target, |
| 83 | .optimize = optimize, | 88 | .optimize = optimize, |
| 84 | - })); | 89 | + }); |
| 90 | + lua_config_module.addIncludePath(lua_headers); | ||
| 91 | + lua_config_tests.root_module.addImport("lua", lua_config_module); | ||
| 85 | lua_config_tests.linkLibrary(lua); | 92 | lua_config_tests.linkLibrary(lua); |
| 86 | lua_config_tests.linkLibC(); | 93 | lua_config_tests.linkLibC(); |
| 87 | test_step.dependOn(&b.addRunArtifact(lua_config_tests).step); | 94 | test_step.dependOn(&b.addRunArtifact(lua_config_tests).step); |
| @@ -159,8 +166,8 @@ fn addXwaylandRun(b: *std.Build, exe: *std.Build.Step.Compile) *std.Build.Step.R | |||
| 159 | return run_wm; | 166 | return run_wm; |
| 160 | } | 167 | } |
| 161 | 168 | ||
| 162 | -fn buildLua(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.builtin.OptimizeMode) *std.Build.Step.Compile { | 169 | +fn buildLua(b: *std.Build, lua_dep: *std.Build.Dependency, target: std.Build.ResolvedTarget, optimize: std.builtin.OptimizeMode) *std.Build.Step.Compile { |
| 163 | - const lua_src = b.dependency("lua", .{}); | 170 | + const lua_src = lua_dep; |
| 164 | const lua = b.addLibrary(.{ | 171 | const lua = b.addLibrary(.{ |
| 165 | .name = "lua", | 172 | .name = "lua", |
| 166 | .root_module = b.createModule(.{ | 173 | .root_module = b.createModule(.{ |