Skip to content

binaries-linux-gnu: add Go-module skeleton#3

Merged
nsaini-figma merged 1 commit into
mainfrom
nsaini/binaries-linux-gnu-skeleton
May 14, 2026
Merged

binaries-linux-gnu: add Go-module skeleton#3
nsaini-figma merged 1 commit into
mainfrom
nsaini/binaries-linux-gnu-skeleton

Conversation

@nsaini-figma
Copy link
Copy Markdown
Collaborator

@nsaini-figma nsaini-figma commented May 14, 2026

Summary

Adds the per-platform binaries Go-module skeleton (binaries-linux-gnu/{go.mod, linux_gnu_x86_64.go}) that future release tags will drop a rebuilt libstatsig_ffi.so into. Mirrors the upstream statsig-io/go-server-core-binaries-linux-gnu shape so the wrapper's import resolves under a consumer-side replace directive.

Why

This fork needs to ship a rebuilt .so carrying fixes that haven't landed upstream yet (including the exposure-dedupe memory leak tracked in upstream PR statsig-io#47). To distribute it via Go modules (matching upstream's existing distribution mechanism), we need a fork-owned Go module that embeds the rebuilt binary. This PR is the bare module shape; the .so itself is dropped on tag-reachable commits by the release workflow (separate PR).

What changed

  • binaries-linux-gnu/go.mod: declares module github.com/figma/statsig-server-core/binaries-linux-gnu.
  • binaries-linux-gnu/linux_gnu_x86_64.go: //go:embed linux_gnu_x86_64.so plus GetBinaryData() and GetSignatureData() shims.

Invariants worth calling out

  • package go_server_core_binaries_linux_gnu (with underscores): MUST match upstream's package name; the wrapper resolves the package by symbol, not URL.
  • .so is intentionally NOT in this PR. At HEAD on main, this module won't compile, which is expected. It only becomes a valid Go module at tagged release commits (created by the release workflow in the follow-up PR).

Action required from a repo admin before merge

These are admin-only and cannot be done in this PR:

  • Workflow permissions (Settings → Actions → General → Workflow permissions): set "Read and write permissions" so the upcoming release workflow's `permissions: contents: write` block is honored.
  • Tag protection (Settings → Tags → Protection rules): ensure no rule blocks `statsig-go/v*-figma*` or `binaries-linux-gnu/v*-figma*` from being pushed by `GITHUB_TOKEN`. If protection is required, authorize the workflow's bot identity.

Test plan

  • Confirm files exist on the branch (`git ls-tree HEAD -- binaries-linux-gnu/` shows go.mod plus linux_gnu_x86_64.go, no `.so`)
  • Confirm package declaration is `go_server_core_binaries_linux_gnu`
  • No CI test runs against this PR (no build expected to succeed at HEAD)

Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

Adds go.mod + linux_gnu_x86_64.go for the per-platform binaries
Go module that mirrors upstream's go-server-core-binaries-linux-gnu.
The .so file is intentionally not committed — the release workflow
(added in a follow-up PR) drops it onto tag-reachable release
commits.

Package name matches upstream so the wrapper's import via
//go:embed-bytes-by-symbol resolves correctly under the consumer-
side `replace` in figma/figma's go.mod.
@nsaini-figma nsaini-figma marked this pull request as ready for review May 14, 2026 17:29
@nsaini-figma nsaini-figma merged commit da748ed into main May 14, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants