Skip to content

Commit eb39a50

Browse files
committed
notices: run notices-update in a container, run for amd64 and arm64
Signed-off-by: Mattia Meleleo <mattia.meleleo@coralogix.com>
1 parent 28d8e60 commit eb39a50

556 files changed

Lines changed: 37919 additions & 1 deletion

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Makefile

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ OCI_BIN ?= docker
3636
DOCKER_USER=$(shell id -u):$(shell id -g)
3737
DEPENDENCIES_DOCKERFILE=./dependencies.Dockerfile
3838
GRADLE_IMAGE := $(shell awk '$$4=="gradle-java" {print $$2}' $(DEPENDENCIES_DOCKERFILE))
39+
GOLANG_IMAGE := $(shell awk '$$4=="golang" {print $$2}' $(DEPENDENCIES_DOCKERFILE))
3940
PYTHON39_IMAGE := $(shell awk '$$4=="python39" {print $$2}' $(DEPENDENCIES_DOCKERFILE))
4041
PYTHON314_IMAGE := $(shell awk '$$4=="python314" {print $$2}' $(DEPENDENCIES_DOCKERFILE))
4142

@@ -704,9 +705,27 @@ java-notices-update:
704705
$(NOTICES_DIR)/java/agent/THIRD_PARTY_LICENSES.txt
705706
@cp pkg/internal/java/agent/build/reports/dependency-license/THIRD_PARTY_LICENSES.csv $(NOTICES_DIR)/java/agent/
706707

708+
GO_NOTICES_ARCHES := amd64 arm64
709+
707710
.PHONY: go-notices-update
708711
go-notices-update:
709-
@GOOS=$(GOOS) GOARCH=amd64 go tool $(TOOLS_MODFILE) go-licenses save ./... --save_path=$(NOTICES_DIR) --force
712+
@echo "### Generating Go notices for linux/{$(GO_NOTICES_ARCHES)} in docker"
713+
@# Migrate legacy flat layout: drop any Go-ecosystem dirs at NOTICES root (keep bpf/ + java/ + arch subtrees).
714+
@find $(NOTICES_DIR) -mindepth 1 -maxdepth 1 \
715+
-not -name bpf -not -name java $(foreach a,$(GO_NOTICES_ARCHES),-not -name $(a)) \
716+
-exec rm -rf {} +
717+
@for arch in $(GO_NOTICES_ARCHES); do \
718+
echo "### linux/$$arch"; \
719+
$(OCI_BIN) run --rm \
720+
$(if $(findstring podman,$(OCI_BIN)),,-u "$(DOCKER_USER)") \
721+
-v "$(CURDIR):/src:z" \
722+
-e HOME=/tmp -e GOTOOLCHAIN=local -e GOMODCACHE=/tmp/gomod \
723+
-e GOOS=linux -e GOARCH=$$arch \
724+
-w /src \
725+
$(GOLANG_IMAGE) \
726+
go tool -modfile=internal/tools/go.mod go-licenses save ./... \
727+
--save_path=$(NOTICES_DIR)/$$arch --force || exit 1; \
728+
done
710729

711730
PYTHON_REQUIREMENTS_INS ?= $(shell find ./internal/test/integration/components -type f -name 'requirements.in' | sort)
712731
PYTHON_REQUIREMENTS_DIRS := $(sort $(dir $(PYTHON_REQUIREMENTS_INS)))

NOTICES/cloud.google.com/go/compute/metadata/LICENSE renamed to NOTICES/amd64/cloud.google.com/go/compute/metadata/LICENSE

File renamed without changes.

NOTICES/github.com/AlessandroPomponio/go-gibberish/LICENSE renamed to NOTICES/amd64/github.com/AlessandroPomponio/go-gibberish/LICENSE

File renamed without changes.

NOTICES/github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp/LICENSE renamed to NOTICES/amd64/github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp/LICENSE

File renamed without changes.
File renamed without changes.

NOTICES/github.com/andybalholm/brotli/flate/LICENSE renamed to NOTICES/amd64/github.com/andybalholm/brotli/flate/LICENSE

File renamed without changes.
File renamed without changes.
File renamed without changes.

NOTICES/github.com/aws/aws-sdk-go-v2/config/LICENSE.txt renamed to NOTICES/amd64/github.com/aws/aws-sdk-go-v2/config/LICENSE.txt

File renamed without changes.

NOTICES/github.com/aws/aws-sdk-go-v2/credentials/LICENSE.txt renamed to NOTICES/amd64/github.com/aws/aws-sdk-go-v2/credentials/LICENSE.txt

File renamed without changes.

0 commit comments

Comments
 (0)