Repository navigation
sqlc-test-setup: run Spanner Omni on kernels without IPv6 - #4641
Open
kyleconroy wants to merge 1 commit into
Open
kyleconroy wants to merge 1 commit into
kyleconroy wants to merge 1 commit into
Conversation
Spanner Omni's services open IPv6 sockets at startup and abort when the kernel has no IPv6, as in Claude Code's remote environments. When opening an AF_INET6 socket fails with EAFNOSUPPORT, start now builds v6to4, a small LD_PRELOAD library that runs those sockets over IPv4, and preloads it into Omni. Kernels with IPv6 start Omni as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L8QoGi6VRtADkb4jL3BFHP
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.
Spanner Omni's services open IPv6 sockets at startup and abort when the kernel was built without IPv6 (
Failed to create socket with ::socket ... Address family not supported by protocolinbase_services), which is the case in Claude Code's remote environments. Omni has no flag to avoid it, andspanner start-single-serverpasses no flags through anyway.sqlc-test-setup start spannernow checks whether opening anAF_INET6socket fails withEAFNOSUPPORT. Only then does it buildv6to4, a smallLD_PRELOADlibrary, withccand preload it into Omni. The library creates IPv6 sockets as IPv4 ones and translates addresses both ways (::,::1,::ffff:a.b.c.d), so Omni still sees IPv6. On kernels with IPv6, including the GitHub runners, Omni starts exactly as before.cmd/sqlc-test-setup/v6to4/v6to4.c: the library. It calls the kernel throughsyscall()and is built without fortify or the stack protector, so it needs nothing newer than the glibc 2.27 Omni ships with. It lives in its own folder because a.cfile in a Go package without cgo breaksgo build.cmd/sqlc-test-setup/omni_ipv6.go: embeds the source and builds Omni's environment.cmd/sqlc-test-setup/ipv6_linux.go,ipv6_other.go: the kernel check, and a stub that returns false off Linux, where Omni isn't published.cmd/sqlc-test-setup/main.go:startSpannerOmnistarts Omni with that environment.Testing
In a container without IPv6:
go run ./cmd/sqlc-test-setup start spannerbuilt the library, preloaded it and reached a serving Omni; a second run was a no-op.SPANNER_SERVER_URI=localhost:15000 go test --tags=examples ./authors/googlesql/underexamples/passes.go vet ./cmd/sqlc-test-setupis clean for linux and darwin, and the command builds for windows.The path for kernels that do have IPv6 is a single early return and was not exercised here, since this container lacks IPv6.
🤖 Generated with Claude Code
https://claude.ai/code/session_01L8QoGi6VRtADkb4jL3BFHP
Generated by Claude Code