Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
# TODO: Try enabling caching later. It might use up too much disk space on runners so needs extra testing.
cache: false
- run: make generate-ui
- run: GO_TAGS="builtinassets promtail_journal_enabled" GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} GOARM= make alloy
- run: GO_TAGS="builtinassets promtail_journal_enabled slicelabels" GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} GOARM= make alloy

build_linux_boringcrypto:
name: Build on Linux (boringcrypto)
Expand All @@ -64,7 +64,7 @@ jobs:
# TODO: Try enabling caching later. It might use up too much disk space on runners so needs extra testing.
cache: false
- run: make generate-ui
- run: GO_TAGS="builtinassets promtail_journal_enabled" GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} GOARM= GOEXPERIMENT=boringcrypto make alloy
- run: GO_TAGS="builtinassets promtail_journal_enabled slicelabels" GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} GOARM= GOEXPERIMENT=boringcrypto make alloy

build_mac_intel:
name: Build on MacOS (Intel)
Expand All @@ -81,7 +81,7 @@ jobs:
# TODO: Try enabling caching later. It might use up too much disk space on runners so needs extra testing.
cache: false
- run: make generate-ui
- run: GO_TAGS="builtinassets" GOOS=darwin GOARCH=amd64 GOARM= make alloy
- run: GO_TAGS="builtinassets slicelabels" GOOS=darwin GOARCH=amd64 GOARM= make alloy

build_mac_arm:
name: Build on MacOS (ARM)
Expand All @@ -98,7 +98,7 @@ jobs:
# TODO: Try enabling caching later. It might use up too much disk space on runners so needs extra testing.
cache: false
- run: make generate-ui
- run: CGO_LDFLAGS="-ld_classic $CGO_LDFLAGS" GO_TAGS="builtinassets" GOOS=darwin GOARCH=arm64 GOARM= make alloy
- run: CGO_LDFLAGS="-ld_classic $CGO_LDFLAGS" GO_TAGS="builtinassets slicelabels" GOOS=darwin GOARCH=arm64 GOARM= make alloy

build_windows:
name: Build on Windows (AMD64)
Expand All @@ -115,7 +115,7 @@ jobs:
# TODO: Try enabling caching later. It might use up too much disk space on runners so needs extra testing.
cache: false
- run: make generate-ui
- run: echo "GO_TAGS=builtinassets" | Out-File -FilePath $env:GITHUB_ENV -Append
- run: echo "GO_TAGS=builtinassets slicelabels" | Out-File -FilePath $env:GITHUB_ENV -Append
- run: echo "GOOS=windows" | Out-File -FilePath $env:GITHUB_ENV -Append
- run: echo "GOARCH=amd64" | Out-File -FilePath $env:GITHUB_ENV -Append
- run: make alloy
Expand All @@ -141,4 +141,4 @@ jobs:
# TODO: Try enabling caching later. It might use up too much disk space on runners so needs extra testing.
cache: false
- run: make generate-ui
- run: GO_TAGS="builtinassets" GOOS=freebsd GOARCH=amd64 GOARM= make alloy
- run: GO_TAGS="builtinassets slicelabels" GOOS=freebsd GOARCH=amd64 GOARM= make alloy
2 changes: 1 addition & 1 deletion .github/workflows/fuzz-go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ jobs:
# a different module.
cd "${{ matrix.package }}"
# Note: -parallel=1 is required to avoid race conditions in the fuzzer until https://github.com/golang/go/issues/56238 is fixed.
go test -parallel=1 -fuzz="${{ matrix.function }}\$" -run="${{ matrix.function }}\$" -fuzztime="${FUZZ_TIME}" .
go test -tags=slicelabels -parallel=1 -fuzz="${{ matrix.function }}\$" -run="${{ matrix.function }}\$" -fuzztime="${FUZZ_TIME}" .
env:
FUZZ_TIME: ${{ inputs.fuzz-time }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ jobs:
go-version-file: go.mod
# TODO: Enable caching later.
cache: false
- run: K8S_USE_DOCKER_NETWORK=1 make test
- run: K8S_USE_DOCKER_NETWORK=1 GO_TAGS="slicelabels" make test
2 changes: 1 addition & 1 deletion .github/workflows/test_mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ jobs:
go-version-file: go.mod
cache: true
- name: Test
run: CGO_LDFLAGS="-ld_classic $CGO_LDFLAGS" make GO_TAGS="nodocker" test
run: CGO_LDFLAGS="-ld_classic $CGO_LDFLAGS" make GO_TAGS="nodocker,slicelabels" test
2 changes: 1 addition & 1 deletion .github/workflows/test_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ jobs:
go-version-file: go.mod
cache: false

- run: make GO_TAGS="nodocker" test
- run: make GO_TAGS="nodocker,slicelabels" test

2 changes: 1 addition & 1 deletion .github/workflows/test_pyroscope_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ jobs:
go-version-file: go.mod
cache: false

- run: sudo make test-pyroscope
- run: sudo GO_TAGS="slicelabels" make test-pyroscope
2 changes: 1 addition & 1 deletion .github/workflows/test_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ jobs:
# We'll need to make sure the same cache is reused by the workflow to build Windows binaries.
cache: false
- name: Test
run: '& "C:/Program Files/git/bin/bash.exe" -c ''go test -tags="nodocker,nonetwork"
run: '& "C:/Program Files/git/bin/bash.exe" -c ''go test -tags="nodocker,nonetwork,slicelabels"
$(go list ./... | grep -v /integration-tests/)'''
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
version: "2"
run:
build-tags:
- slicelabels
linters:
enable:
- depguard # Allow/denylist specific imports
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg/mod \
GOOS="$TARGETOS" GOARCH="$TARGETARCH" GOARM=${TARGETVARIANT#v} \
RELEASE_BUILD=${RELEASE_BUILD} VERSION=${VERSION} \
GO_TAGS="netgo builtinassets promtail_journal_enabled" \
GO_TAGS="netgo builtinassets promtail_journal_enabled slicelabels" \
GOEXPERIMENT=${GOEXPERIMENT} \
make alloy

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.windows
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ SHELL ["cmd", "/S", "/C"]
# we can before moving on to the next step.
RUN ""C:\Program Files\git\bin\bash.exe" -c "RELEASE_BUILD=${RELEASE_BUILD} VERSION=${VERSION} make generate-ui && rm -rf web/ui/node_modules && yarn cache clean --all""

RUN ""C:\Program Files\git\bin\bash.exe" -c "RELEASE_BUILD=${RELEASE_BUILD} VERSION=${VERSION} GO_TAGS=\"builtinassets ${GO_TAGS}\" make alloy""
RUN ""C:\Program Files\git\bin\bash.exe" -c "RELEASE_BUILD=${RELEASE_BUILD} VERSION=${VERSION} GO_TAGS=\"builtinassets slicelabels ${GO_TAGS}\" make alloy""
# In this case, we're separating the clean command from make alloy to avoid an issue where access to some mod cache
# files is denied immediately after make alloy, for example:
# "go: remove C:\go\pkg\mod\golang.org\[email protected]\bin\go.exe: Access is denied."
Expand Down
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ GOARM ?= $(shell go env GOARM)
CGO_ENABLED ?= 1
RELEASE_BUILD ?= 0
GOEXPERIMENT ?= $(shell go env GOEXPERIMENT)
GO_TAGS ?= slicelabels

# Determine the golangci-lint binary path using Make functions where possible.
# Priority: GOBIN, GOPATH/bin, PATH (via shell), Fallback Name.
Expand Down Expand Up @@ -146,11 +147,11 @@ endif
.PHONY: lint
lint: alloylint
find . -name go.mod | xargs dirname | xargs -I __dir__ $(GOLANGCI_LINT_BINARY) run -v --timeout=10m
$(ALLOYLINT_BINARY) ./...
GOFLAGS="-tags=$(GO_TAGS)" $(ALLOYLINT_BINARY) ./...

.PHONY: run-alloylint
run-alloylint: alloylint
$(ALLOYLINT_BINARY) ./...
GOFLAGS="-tags=$(GO_TAGS)" $(ALLOYLINT_BINARY) ./...

.PHONY: test
# We have to run test twice: once for all packages with -race and then once
Expand Down
Loading
Loading