Repository navigation
Modernize and fix build system - #7546
Merged
6543 merged 12 commits intoNov 24, 2026
Merged
Conversation
The sqlite driver now needs Windows 10 or newer, but xgo builds for Windows NT 4.0 by default (_WIN32_WINNT=0x0400), so the windows/amd64 server cross compile fails on main. Use the xgo target windows-10. Only xgo gets the version suffix: the Makefile strips it from TARGETOS, so the binary keeps its .exe suffix and the archive keeps its name woodpecker-server_windows_amd64.zip.
Until now every cgo build of the server linked sqlite. Gate it behind the sqlite tag, so cgo can be on without pulling in sqlite. The Makefile adds the tags with the new SQLITE_ENABLED flag. It defaults to true when cgo is enabled, so make builds keep sqlite, and fails early if it is set without cgo. CI sets SQLITE_ENABLED instead of listing the sqlite tags, and drops the unused bindata tag. The test targets set their tags on their own: TAGS now holds sqlite_unlock_notify by default, which makes TestWrapErrDatabaseLocked hang until the test timeout.
build-agent and build-cli forced CGO_ENABLED=0, so there was no way to build them with a feature that needs cgo. Forward CGO_ENABLED like build-server does. The container images keep building agent and cli without cgo: they cross compile on the build platform without cgo cross compilers, and the default images are FROM scratch.
release-server-xgo could only build the server. Turn it into release-xgo, which builds the COMPONENT it gets (server, agent or cli), and add cross-compile-agent and cross-compile-cli next to cross-compile-server as one pattern rule. Release builds do not change: CI still cross compiles only the server, the agent and cli release binaries keep using plain go build.
cli exec listed the flags of every backend by hand next to its backend list, so adding a backend meant two edits. Take the flags from the backends like the agent does.
The test step ran the agent, server, cli and lib tests one after the other. Move test-lib into a test-engine step, so it runs in parallel with the component tests.
Give lint runs on slow CI runners more headroom before they are cut off.
Contributor
|
Surge PR preview deployment was removed |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7546 +/- ##
=======================================
Coverage 67.41% 67.42%
=======================================
Files 452 452
Lines 22793 22797 +4
=======================================
+ Hits 15366 15370 +4
Misses 7427 7427 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
xoxys
requested changes
Nov 24, 2026
xoxys
requested changes
Nov 24, 2026
Test targets had their own hardcoded tags, so a tag added to $(TAGS) was not seen by tests. They only avoided $(TAGS) because the sqlite_unlock_notify tag makes TestWrapErrDatabaseLocked hang. The server never opens SQLite with a shared cache, which is the only case where unlock_notify does anything, and lock errors are already retried. So drop the tag and let tests use $(TAGS) like the builds.
xoxys
approved these changes
Nov 24, 2026
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.
I let claude port over findings from #6985 for build system ...