Repository navigation
build: use zig in every module and run prek in CI - #4
Merged
Merged
Conversation
Register hermetic_cc_toolchain in luaunit and busted as a dev dependency, and register the glibc 2.28 zig toolchains ahead of the glibc 2.17 default in the root, examples and luaunit. The host toolchain on new distros fails to build BCR C deps: GNU ld 2.47 segfaults on --start-lib, and glibc 2.44 headers break old gnulib. Use the host make in luaunit and busted, as building make from source runs hundreds of slow autoconf actions. Patch the Lua 5.4.6 makefile to build without readline, so the toolchain needs no host readline headers.
Add a GitHub Actions workflow that runs prek on all files. Fix the existing buildifier and prettier findings: sort loads, add module and function docstrings, remove an unused helper and variable, trim trailing whitespace, and regenerate docs. Disable the name-conventions and bzl-visibility lint checks, as LuaLibrary and FennelLibrary are public API, and luaunit and fennel load //lua/private on purpose.
michaelboulton
commented
Oct 25, 2026
Comment on lines
+11
to
+15
| -MYCFLAGS= $(LOCAL) -std=c99 -DLUA_USE_LINUX -DLUA_USE_READLINE | ||
| +MYCFLAGS= $(LOCAL) -std=c99 -DLUA_USE_LINUX | ||
| MYLDFLAGS= $(LOCAL) -Wl,-E | ||
| -MYLIBS= -ldl -lreadline | ||
| +MYLIBS= -ldl |
Owner
Author
There was a problem hiding this comment.
Might cause some problems but this speeds up the build a loooot
Set require_serial on the buildifier hooks, as parallel batches race to download the buildifier binary on a cold cache and fail with "mv: cannot create regular file ... File exists".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Builds every module with the zig C toolchain and host make, and adds a GitHub Actions workflow that runs the pre-commit hooks with prek.
Click for implementation details
luaunitandbustedas a dev dependency. Register the glibc 2.28 zig toolchains ahead of the glibc 2.17 default in the root,examplesandluaunit. The host toolchain on new distros fails to build BCR C deps: GNU ld 2.47 segfaults on--start-lib, and glibc 2.44 headers break old gnulib.tools.make(mode = "system")) inluaunitandbusted, as building make from source runs hundreds of slow autoconf actions.name-conventionsandbzl-visibilitylint checks:LuaLibraryandFennelLibraryare public API, andluaunitandfennelload//lua/privateon purpose.luaunitandbustedlockfile updates from the first commit landed in the second one.Tested on Bazel 9.3.1: root
bazel test //...(9 tests),examples(3),luaunit//tests:all(2),busted//tests:all(1), andprek run --all-files. Not tested on Bazel 8.