From 84aaabc5f4a4910cf59624e0ba7d7a5b42b7dca2 Mon Sep 17 00:00:00 2001 From: rita7lopes <105070795+rita7lopes@users.noreply.github.com> Date: Tue, 24 Nov 2026 11:50:41 +0000 Subject: [PATCH] build: build the cmd/gigapipe package instead of main.go alone Building main.go alone stops compiling if a second file is added to the package. Today both build the same program. --- .github/workflows/build_release.yml | 4 ++-- .github/workflows/integration.yml | 2 +- Dockerfile | 4 ++-- Makefile | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build_release.yml b/.github/workflows/build_release.yml index 77ec3cf4..83b68e4f 100644 --- a/.github/workflows/build_release.yml +++ b/.github/workflows/build_release.yml @@ -94,7 +94,7 @@ jobs: - name: build static run: | go mod tidy - VIEW=1 CGO_ENABLED=0 go build -ldflags="-extldflags=-static" -o gigapipe_arm64 cmd/gigapipe/main.go + VIEW=1 CGO_ENABLED=0 go build -ldflags="-extldflags=-static" -o gigapipe_arm64 ./cmd/gigapipe - name: get NFPM if: github.event_name == 'release' || ${{ inputs.release }} @@ -157,7 +157,7 @@ jobs: - name: build static run: | go mod tidy - VIEW=1 CGO_ENABLED=0 go build -ldflags="-extldflags=-static" -o gigapipe cmd/gigapipe/main.go + VIEW=1 CGO_ENABLED=0 go build -ldflags="-extldflags=-static" -o gigapipe ./cmd/gigapipe - name: glibc polyfill if: ${{ matrix.goarch == 'amd64' }} diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 89577deb..05ce7344 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -20,7 +20,7 @@ jobs: go-version-file: go.mod - name: Build gigapipe - run: go build -o gigapipe cmd/gigapipe/main.go + run: go build -o gigapipe ./cmd/gigapipe # The image version lives in the compose file, shared with run.sh. - name: Start ClickHouse diff --git a/Dockerfile b/Dockerfile index a28a6bfd..b791f1bc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,9 +3,9 @@ COPY . /src WORKDIR /src ARG VIEW RUN if [ "$VIEW" = "1" ]; then \ - go build -tags view -o gigapipe cmd/gigapipe/main.go ; \ + go build -tags view -o gigapipe ./cmd/gigapipe ; \ else \ - go build -o gigapipe cmd/gigapipe/main.go ; \ + go build -o gigapipe ./cmd/gigapipe ; \ fi FROM alpine:3.21 diff --git a/Makefile b/Makefile index 5bc49e14..437245a5 100644 --- a/Makefile +++ b/Makefile @@ -34,7 +34,7 @@ fmt-check: # Build the gigapipe binary the same way CI does. build: go mod tidy - CGO_ENABLED=0 go build -ldflags="-extldflags=-static" -o gigapipe cmd/gigapipe/main.go + CGO_ENABLED=0 go build -ldflags="-extldflags=-static" -o gigapipe ./cmd/gigapipe # Run the full unit-test suite with the race detector, matching CI. test-unit: