Skip to content

Modernize and fix build system - #7546

Merged
6543 merged 12 commits into
woodpecker-ci:mainfrom
6543-forks:modernize-build-system-part1
Nov 24, 2026
Merged

6543 merged 12 commits into
woodpecker-ci:mainfrom
6543-forks:modernize-build-system-part1

Conversation

@6543

@6543 6543 commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

I let claude port over findings from #6985 for build system ...

  • fix windows server build (windows >= 10 only now)
  • put sqlite support behind own feature env flag
  • allow cli and agent to be build with cgo
  • make xgo-release reusable (prepare for xgo agent and cli compilation)
  • split unit tests (components and engine) in own steps
  • rais golangci lint timeout ... we need that under heavy load ...

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.
@6543 6543 added build CI pipeline related wip labels Nov 11, 2026
6543 and others added 6 commits November 11, 2026 13:46
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.
@woodpecker-bot

woodpecker-bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Surge PR preview deployment was removed

@6543 6543 removed the wip label Nov 11, 2026
@codecov

codecov Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.42%. Comparing base (d1aedfd) to head (cc3208d).
⚠️ Report is 3 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@6543
6543 requested a review from a team November 11, 2026 14:45
Comment thread Makefile Resolved
Comment thread Makefile Resolved
Comment thread .woodpecker/binaries.yaml Resolved
claude and others added 2 commits November 24, 2026 12:36
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.
@6543
6543 requested a review from xoxys November 24, 2026 12:55
@6543
6543 merged commit f6d0481 into woodpecker-ci:main Nov 24, 2026
10 checks passed
@6543
6543 deleted the modernize-build-system-part1 branch November 24, 2026 21:33
@woodpecker-bot woodpecker-bot mentioned this pull request Nov 24, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build CI pipeline related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants