Skip to content

build(kernel): 2-mode kernel build recipe + tagged CI job#395

Draft
mani-mathur-arch wants to merge 1 commit into
mani/sea-kernel-backendfrom
mani/sea-kernel-build-recipe
Draft

build(kernel): 2-mode kernel build recipe + tagged CI job#395
mani-mathur-arch wants to merge 1 commit into
mani/sea-kernel-backendfrom
mani/sea-kernel-build-recipe

Conversation

@mani-mathur-arch

@mani-mathur-arch mani-mathur-arch commented Jul 11, 2026

Copy link
Copy Markdown
Collaborator

What

Adds a reproducible build recipe for the opt-in SEA-via-kernel backend and a CI job that exercises it, so the databricks_kernel-tagged path is built and unit-tested in CI instead of being dead code. This is the distribution follow-up that lets #393 leave draft.

  • KERNEL_REV pins the kernel commit to build against (currently PR 163 head in the kernel, which carries the statement canceller the driver links; re-pin to the merge SHA once 163 lands).
  • cgo.go drops the machine-specific link line; per-platform cgo_<os>.go files carry ${SRCDIR}-relative LDFLAGS and force static linking (-l:…a). linux/amd64 is real; darwin/windows are documented stubs pending native runners.
  • build/kernel-lib.sh builds the kernel .a from source at KERNEL_REV (cargo --no-default-features --features tls-rustls), with a rev-stamped cache short-circuit, a KERNEL_LOCAL_A prebuilt-archive override, and a fail-loud guard against source cross-builds. Makefile adds kernel-lib / build-kernel / test-kernel and a kernel-lib-download stub for the future published-.a path.
  • go.yml gains build-and-test-kernel (CGO + rust + cargo-via-JFrog); the pure-Go CGO_ENABLED=0 jobs are untouched. Built artifacts are gitignored.

Multi-OS support comes via native per-OS runners (host == target) or staging a prebuilt .a, not cross-compiling from source — matching the settled distribution design.

⚠️ Stacked on #393 (mani/sea-kernel-backend) and draft. Contains a temporary push: CI trigger for mani/sea-kernel-build-recipe in go.yml (clearly commented) so CI runs on this stacked branch — must be stripped before merge.

Testing

  • make kernel-lib builds the .a (reproducible sha256) from a clean clone, a cache-restored tree, and a leftover-source tree.
  • make test-kernel links the archive with CGO and passes the databricks_kernel-tagged unit tests (ok …/internal/backend/kernel).
  • CGO_ENABLED=0 go build ./... still succeeds — default pure-Go build unaffected.
  • Cache short-circuit skips on a matching rev-stamp and rebuilds on a stale one; cross-build (GOOS ≠ host) fails loud.
  • Reviewed with Isaac Review (5 passes, converged to a clean pass).

Co-authored-by: Isaac

@mani-mathur-arch mani-mathur-arch force-pushed the mani/sea-kernel-build-recipe branch from ec1e033 to de9c139 Compare July 11, 2026 19:57
Add a reproducible build recipe for the opt-in SEA-via-kernel backend and a
CI job that exercises it, so the databricks_kernel-tagged path is built and
unit-tested in CI instead of being dead code.

- KERNEL_REV pins the kernel commit (PR #163 head) to build against.
- cgo.go drops the machine-specific link line; per-platform cgo_<os>.go files
  carry ${SRCDIR}-relative LDFLAGS and force static linking (-l:...a).
- build/kernel-lib.sh builds the kernel .a from source at KERNEL_REV
  (cargo --no-default-features --features tls-rustls), with a KERNEL_LOCAL_A
  override; Makefile adds kernel-lib / build-kernel / test-kernel and a
  kernel-lib-download stub for the future published-.a path.
- go.yml gains build-and-test-kernel (CGO + rust + cargo-via-JFrog); the
  pure-Go CGO_ENABLED=0 jobs are untouched. Built artifacts are gitignored.

Co-authored-by: Isaac
@mani-mathur-arch mani-mathur-arch force-pushed the mani/sea-kernel-build-recipe branch from de9c139 to 38c283f Compare July 11, 2026 21:04
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.

1 participant