feat/build: simplify Linux build environment, add optional profiling - #16
Merged
Conversation
A new --pprof duration flag runs a CPU profile for that long (or until
shutdown), then writes it alongside a heap and goroutine snapshot to
trafficmon-{cpu,heap,goroutine}.pprof in the working directory, each
openable with `go tool pprof`.
Adds a compose.yaml Alpine/musl container per Linux arch so release-build-linux always runs with a gcc matching its target, invoked via a new release-linux-docker Make target. Also tightens goreleaser's --snapshot detection to only omit the flag on an actual tag ref, and ignores the local dev binary.
release-linux-docker selects its compose service via LINUX_ARCH, not GOARCH -- passing GOARCH on the make command line left LINUX_ARCH at its amd64 default regardless of the matrix leg, so the arm64 runner still ran the amd64 compose service. GORELEASER_ARCH is dropped from the make invocation too: compose.yaml already hardcodes it per service literally, so passing it from the workflow was a no-op.
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.
Summary
--pprof <duration>flag totrafficmonthat captures a CPU profile for that long (or until shutdown), then writes it alongside a heap and goroutine snapshot totrafficmon-{cpu,heap,goroutine}.pprofin the working directory, each openable withgo tool pprof.compose.yamlAlpine/musl container per Linux arch sorelease-build-linuxalways runs with a gcc matching its target, invoked via a newrelease-linux-dockerMake target. Also tightens goreleaser's--snapshotdetection to only omit the flag on an actual tag ref, and ignores the local dev binary.