Fix seid static-link paths for missing .a files#3426
Conversation
The static-build path for seid was broken in two ways that masked
each other and only surfaced when goreleaser first tried it:
- The sei-wasmd v152/v155 archives were named libwasmvm*static.a,
but link_muslc.go wants -lwasmvm*_muslc — so the linker said
"cannot find -lwasmvm155_muslc" and never noticed the static.a
files were also wrong (Mach-O arm64, not Linux musl ELF).
- sei-wasmvm/internal/api was missing libwasmvmstatic_darwin.a
entirely.
Fixes:
- Rename the misnamed Mach-O archives to libwasmvm*static_darwin.a
to match link_mac_static.go.
- Add libwasmvm{152,155}_muslc{,.aarch64}.a from the sei-wasmd
v0.3.6 release, with SHA256s pinned via Go tests.
- Add libwasmvmstatic_darwin.a, produced reproducibly by the new
macos-static target rather than someone's laptop.
CI:
- cross-arch-build.yml: new linux-amd64-static job that asserts
the resulting seid is actually statically linked. Would have
caught this at PR time.
- libwasmvm.yml: add release-build-macos-static to the matrix so
the darwin static archive can be regenerated on demand.
Additionally, add tests that assert the consistency of shasums for
checked in .a files. The missing files are ported over from:
* https://github.com/sei-protocol/sei-wasmd/releases/tag/v0.3.6
Add tests to programmatically assert existence of linked libraries
across the entire codebase.
Relates to: PLT-41
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3426 +/- ##
==========================================
+ Coverage 59.29% 59.37% +0.07%
==========================================
Files 2125 2112 -13
Lines 175629 173527 -2102
==========================================
- Hits 104144 103028 -1116
+ Misses 62404 61517 -887
+ Partials 9081 8982 -99
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
PR SummaryLow Risk Overview Adds guardrail tests to prevent future broken static builds: a repo-level test ( Reviewed by Cursor Bugbot for commit 5d56365. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 5d56365. Configure here.
| if !isLib { | ||
| continue | ||
| } | ||
| base := name[len("lib") : len(name)-len(ext)] |
There was a problem hiding this comment.
Missing "lib" prefix guard causes potential panic
Low Severity
TestArtifactsHaveNoOrphans documents that it processes "every lib*.{a,so,dylib}" but only filters by extension, not by the "lib" prefix. The slice name[len("lib") : len(name)-len(ext)] assumes the filename starts with "lib" and is long enough. A non-lib-prefixed file with a library extension (e.g. ab.a) would cause a slice-bounds panic since len("lib") exceeds len(name)-len(ext). Adding a strings.HasPrefix(name, "lib") guard would match the documented intent and prevent a test-suite crash.
Reviewed by Cursor Bugbot for commit 5d56365. Configure here.
| return s[:len(s)-len(suf)] | ||
| } | ||
| return s | ||
| } |
There was a problem hiding this comment.
Custom stripSuffix reimplements strings.TrimSuffix
Low Severity
The stripSuffix helper has identical semantics to strings.TrimSuffix from the standard library — both check if the string ends with the suffix and return it stripped, or the original string unchanged. Replacing it with strings.TrimSuffix removes unnecessary code and is more idiomatic Go.
Reviewed by Cursor Bugbot for commit 5d56365. Configure here.


The static-build path for seid was broken in two ways that masked each other and only surfaced when goreleaser first tried it:
Fixes:
CI:
Additionally, add tests that assert the consistency of shasums for checked in .a files. The missing files are ported over from:
Add tests to programmatically assert existence of linked libraries across the entire codebase.
Note: for internal/api/libwasmvm I stripped off debugging info to reduce the size of the .a file since GitHub does not accept sole files with size over 100MiB.
Relates to: PLT-41
Note
Medium Risk
Medium risk because it changes the static-linking artifact set and adds CI/test enforcement around cgo linking; mistakes here can break release builds across platforms.
Overview
Fixes the
seidstatic-link path by ensuring the vendoredlibwasmvmarchives actually match thelink_*.gocgo-l...directives (and aren’t wrong-arch/misnamed).Adds Go tests to (1) verify every
link_*.goresolves to a reallib*.{a,so,dylib}insei-wasmdv152/v155 andsei-wasmvm/internal/api, (2) fail on orphaned library artifacts, and (3) pin SHA256 checksums for the v152/v155 musl static archives.Updates CI to build macOS static
libwasmvmvia a newrelease-build-macos-staticworkflow matrix entry.Reviewed by Cursor Bugbot for commit e799e33. Bugbot is set up for automated code reviews on this repo. Configure here.