Remove libpcap dependency and add Windows support - #210
Merged
Conversation
stream needed libpcap and cgo solely to read capture files offline, so `go install github.com/elastic/stream@latest` failed on any machine without libpcap and a C toolchain. Windows was hit hardest because Go disables cgo there by default. Replace pcap.OpenOffline with gopacket's pure Go pcapgo readers, dispatching on the file magic to choose the pcap or pcapng reader and decompressing gzipped captures explicitly. stream now builds with CGO_ENABLED=0 everywhere, so libpcap is gone from the Dockerfile, the Buildkite pipeline, and the GitHub workflows. Windows also failed to compile because root.go used unix.SignalNum. Move the signal name lookup behind a build tag: Unix keeps the full set, while Windows recognizes SIGINT and SIGTERM, the only signals the Go runtime emulates there. Read packets in an explicit loop instead of PacketSource.Packets(), which retries unrecognized errors in a 5ms loop and so would hang stream indefinitely on a corrupt capture. Truncated captures are still tolerated with a warning. Build the published image FROM scratch now that the binary is static, copying only the CA bundle from the builder. This drops the image from 70.5MB to 56.6MB. Add a cross-build workflow covering six platforms plus ubuntu, windows and macos test runs so none of this regresses unnoticed. Validated by diffing old and new payload extraction across 55 capture files against libpcap 1.10.5: classic pcap matches byte for byte, and no file that libpcap could read fails with pcapgo.
💚 Build Succeeded
|
andrewkroh
added a commit
to elastic/integration-skills
that referenced
this pull request
Aug 4, 2026
`go install github.com/elastic/stream/cmd/stream@latest` fails because that package does not exist. stream's main package sits at the module root, so the correct path is `github.com/elastic/stream@latest`. This was reported by a Windows user who could not install stream. `stream -version` is wrong for the same block: version is a subcommand rather than a flag, so the flag form fails with "unknown shorthand flag: 'v' in -version". Relates: elastic/stream#210 (fixes the windows build)
efd6
approved these changes
Aug 4, 2026
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.
Proposed commit message