From d68ba7ab1fc9de389b1c6ad348c0c3cf4064c6f4 Mon Sep 17 00:00:00 2001 From: TJ Kolleh Date: Sat, 4 Apr 2026 23:17:25 -0400 Subject: [PATCH 1/7] fix(build): remove luv/luasystem from lux dependencies to fix CI build The LuaRocks CMake build for luv fails on Linux with multiarch Lua installations because $(LUA_LIBDIR) cannot be expanded (luarocks/luarocks#1155, #1257). This is a known ecosystem limitation inherited by Lux. Since the justfile already builds luv and luasystem manually from git source via build-luv and build-system recipes (using direct CMake variables -DLUA_INCLUDE_DIR and -DLUA_LIBRARIES), remove them from lux.toml entirely. This eliminates the redundant and broken lx build --only-deps path while keeping the working manual build. Also remove the now-unnecessary --variables WITH_SHARED_LIBUV=OFF and CFLAGS/MACOSX_DEPLOYMENT_TARGET from ensure-deps and install recipes since those were only needed for the luv CMake build. --- justfile | 14 +++++--------- lux.toml | 8 ++++---- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/justfile b/justfile index 9d9770d..e548869 100644 --- a/justfile +++ b/justfile @@ -84,7 +84,7 @@ lint: [doc("Lint for CI (Lua 5.4)")] [group('ci')] lint-ci: - lx --lua-version 5.4 --variables "WITH_SHARED_LIBUV=OFF" lint + lx --lua-version 5.4 lint [doc("Run code quality checks")] [group('dev')] @@ -96,7 +96,7 @@ check: lint fmt [group('test')] test-unit: @echo "Running unit tests..." - lx --lua-version {{ lua_version }} --lua-dir {{ lua_prefix }} --variables "WITH_SHARED_LIBUV=OFF" test + lx --lua-version {{ lua_version }} --lua-dir {{ lua_prefix }} test [doc("Alias for test-unit")] [group('test')] @@ -106,7 +106,7 @@ test: test-unit [group('ci')] test-ci: @echo "Running unit tests for CI..." - lx --lua-version 5.4 --variables "WITH_SHARED_LIBUV=OFF" test + lx --lua-version 5.4 test # --- Build --- @@ -114,9 +114,7 @@ test-ci: [private] ensure-deps: @echo "Ensuring dependencies are installed..." - CFLAGS="-I{{ lua_include }} {{ if os() == 'macos' { '-mmacosx-version-min=' + macos_version } else { '' } }}" \ - {{ if os() == 'macos' { 'MACOSX_DEPLOYMENT_TARGET=' + macos_version } else { '' } }} \ - lx --lua-version {{ lua_version }} --lua-dir {{ lua_prefix }} --variables "WITH_SHARED_LIBUV=OFF" build --only-deps --no-lock + lx --lua-version {{ lua_version }} build --only-deps --no-lock [doc("Build the standalone executable")] [group('build')] @@ -213,9 +211,7 @@ test-perf: build [doc("Install dependencies")] [group('workflow')] install: - CFLAGS="-I{{ lua_include }} {{ if os() == 'macos' { '-mmacosx-version-min=' + macos_version } else { '' } }}" \ - {{ if os() == 'macos' { 'MACOSX_DEPLOYMENT_TARGET=' + macos_version } else { '' } }} \ - lx --lua-version {{ lua_version }} --lua-dir {{ lua_prefix }} --variables "WITH_SHARED_LIBUV=OFF" build --only-deps --no-lock + lx --lua-version {{ lua_version }} build --only-deps --no-lock [doc("Run spinner directly without building (development mode)")] [group('dev')] diff --git a/lux.toml b/lux.toml index 6fd51a3..12bc419 100644 --- a/lux.toml +++ b/lux.toml @@ -15,12 +15,12 @@ labels = ["terminal", "spinner", "cli", "ansi", "progress", "neovim"] url = "https://github.com/tkolleh/roda.lua/archive/refs/tags/v$(VERSION).zip" dev = "git+https://github.com/tkolleh/roda.lua.git" - - [dependencies] -luasystem = ">=0.4.0" -luv = ">= 1.44.2" # argp is vendored in lua/roda/argp.lua (git rockspec doesn't install source files) +# luv and luasystem are built manually by the justfile (build-luv, build-system recipes) +# from git source — not installed via Lux/LuaRocks, because the CMake build fails on +# Linux with multiarch Lua installations ($(LUA_LIBDIR) cannot be expanded; +# see luarocks/luarocks#1155, #1257) [test_dependencies] busted = "2.3.0-1" From 7818c5c4f4999ee008081b0a3e8ba593bb9a0ebc Mon Sep 17 00:00:00 2001 From: TJ Kolleh Date: Sat, 4 Apr 2026 23:34:26 -0400 Subject: [PATCH 2/7] fix(build): build luv.so shared module alongside libluv.a for tests The luv CMake build now produces both BUILD_MODULE=ON (luv.so for require() in busted tests) and BUILD_STATIC_LIBS=ON (libluv.a for luastatic binary). test-ci and test-unit recipes depend on build-luv and set LUA_CPATH to find the shared module. .busted config includes cpath fallback. Fixes CI failure: module 'luv' not found on Linux test runs. --- .busted | 1 + justfile | 13 +++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.busted b/.busted index b6e63f7..67d1c95 100644 --- a/.busted +++ b/.busted @@ -2,6 +2,7 @@ return { _all = { coverage = false, lpath = "lua/?.lua;lua/?/init.lua", + cpath = ".build/?.so;;", pattern = "_spec%.lua$", ROOT = { "spec/" }, }, diff --git a/justfile b/justfile index e548869..1ebafd5 100644 --- a/justfile +++ b/justfile @@ -94,9 +94,9 @@ check: lint fmt [doc("Run unit tests (all spec/*_spec.lua files via lux/busted)")] [group('test')] -test-unit: +test-unit: build-luv @echo "Running unit tests..." - lx --lua-version {{ lua_version }} --lua-dir {{ lua_prefix }} test + LUA_CPATH="{{ build_dir }}/?.so;;" lx --lua-version {{ lua_version }} --lua-dir {{ lua_prefix }} test [doc("Alias for test-unit")] [group('test')] @@ -104,9 +104,9 @@ test: test-unit [doc("Run unit tests for CI (Lua 5.4)")] [group('ci')] -test-ci: +test-ci: build-luv @echo "Running unit tests for CI..." - lx --lua-version 5.4 test + LUA_CPATH="{{ build_dir }}/?.so;;" lx --lua-version 5.4 test # --- Build --- @@ -130,12 +130,13 @@ prep: [group('build')] [private] build-luv: prep - @echo "Building static luv..." + @echo "Building static luv and shared module..." {{ if path_exists(build_dir / "luv") == "true" { "" } else { "git clone --recursive https://github.com/luvit/luv.git " + (build_dir / "luv") } }} - cd {{ build_dir / 'luv' }} && cmake -DBUILD_STATIC_LIBS=ON -DBUILD_MODULE=OFF -DWITH_LUA_ENGINE=Lua -DLUA_BUILD_TYPE=System -DLUA_INCLUDE_DIR={{ lua_include }} -DLUA_LIBRARIES={{ lua_lib }} . + cd {{ build_dir / 'luv' }} && cmake -DBUILD_MODULE=ON -DBUILD_STATIC_LIBS=ON -DWITH_LUA_ENGINE=Lua -DLUA_BUILD_TYPE=System -DLUA_INCLUDE_DIR={{ lua_include }} -DLUA_LIBRARIES={{ lua_lib }} . cd {{ build_dir / 'luv' }} && make cp {{ build_dir / 'luv' / 'libluv.a' }} {{ build_dir }}/ cp {{ build_dir / 'luv' / 'deps' / 'libuv' / 'libuv.a' }} {{ build_dir }}/ + cp {{ build_dir / 'luv' / 'luv.so' }} {{ build_dir }}/ [doc("Statically compile luasystem (GCC/AR)")] [group('build')] From 5316fd36b3022eae6c1287cf45479e980c04c5ae Mon Sep 17 00:00:00 2001 From: TJ Kolleh Date: Sat, 4 Apr 2026 23:36:10 -0400 Subject: [PATCH 3/7] ci(tests): install Lua dev headers and CMake for luv build The build-luv recipe compiles luv from source via CMake, which requires liblua5.4-dev headers and cmake. The Lux GitHub Action installs the Lux binary but not system-level Lua development packages. --- .github/workflows/tests.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e9ce924..374f13c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -23,6 +23,11 @@ jobs: # because it doesn't run tests (no busted dependency) version: 0.18.8 + - name: Install system dependencies + run: | + sudo apt-get update + sudo apt-get install -y liblua5.4-dev cmake + - name: Install just run: | mkdir -p /tmp/just From 1766f023804586e1c52f6a3bd1191ce137ec6154 Mon Sep 17 00:00:00 2001 From: TJ Kolleh Date: Sat, 4 Apr 2026 23:38:21 -0400 Subject: [PATCH 4/7] ci(tests): install lua5.4 interpreter for lx test lx test spawns the lua binary to run busted, but only liblua5.4-dev was installed which provides headers/libs, not the interpreter. --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 374f13c..bfef524 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -26,7 +26,7 @@ jobs: - name: Install system dependencies run: | sudo apt-get update - sudo apt-get install -y liblua5.4-dev cmake + sudo apt-get install -y lua5.4 liblua5.4-dev cmake - name: Install just run: | From b2173d31345fabe9021ae6f099a13c9a3459af6c Mon Sep 17 00:00:00 2001 From: TJ Kolleh Date: Sat, 4 Apr 2026 23:47:07 -0400 Subject: [PATCH 5/7] ci(release): add Lux bin directory to PATH for luastatic The ensure-deps recipe installs luastatic into the Lux-managed tree (~/.lux/5.4/bin) which is not on PATH by default in GitHub Actions. --- .github/workflows/release-please.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index c8904be..1052d3d 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -54,6 +54,7 @@ jobs: LUA_VERSION: "5.4" LUA_PREFIX: "/usr" LUA_LIB: "/usr/lib/x86_64-linux-gnu/liblua5.4.a" + PATH: "${{ env.HOME }}/.lux/5.4/bin:${PATH}" run: | just build sha256sum roda > roda.sha256 From 2bafc5b4c90c3768aa83a22c181f771410123afd Mon Sep 17 00:00:00 2001 From: TJ Kolleh Date: Sat, 4 Apr 2026 23:58:15 -0400 Subject: [PATCH 6/7] fix(ci): use /Users/tkolleh in run step instead of env var for PATH ${{ env.HOME }} resolves to empty string in GitHub Actions env context. Using export PATH in the run step instead so /Users/tkolleh is expanded by bash. --- .github/workflows/release-please.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 1052d3d..43d993a 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -54,8 +54,8 @@ jobs: LUA_VERSION: "5.4" LUA_PREFIX: "/usr" LUA_LIB: "/usr/lib/x86_64-linux-gnu/liblua5.4.a" - PATH: "${{ env.HOME }}/.lux/5.4/bin:${PATH}" run: | + export PATH="$HOME/.lux/5.4/bin:$PATH" just build sha256sum roda > roda.sha256 From e1010885457d165a2ef43ad066b36cdf1abf06c3 Mon Sep 17 00:00:00 2001 From: TJ Kolleh Date: Sun, 5 Apr 2026 00:03:39 -0400 Subject: [PATCH 7/7] fix(ci): checkout default branch instead of tag in release workflow Checking out the tag causes a race condition: the workflow file from the tag may not have the latest build steps (e.g. Install just was missing in v1.13.1 and v1.13.2 tags). Checkout the default branch instead so the workflow always uses the latest version. --- .github/workflows/release-please.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 0728145..d9b39eb 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -24,8 +24,6 @@ jobs: - name: Checkout repository if: ${{ steps.release.outputs.release_created }} uses: actions/checkout@v4 - with: - ref: ${{ steps.release.outputs.tag_name }} - name: Install System Dependencies if: ${{ steps.release.outputs.release_created }}