Skip to content

Commit

Permalink
Add generated build files in git. Helps review builder changes
Browse files Browse the repository at this point in the history
Ensure that the generated files are up to date.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
  • Loading branch information
bogdandrutu committed Dec 21, 2021
1 parent 84b3706 commit 712d80e
Show file tree
Hide file tree
Showing 12 changed files with 1,454 additions and 15 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ jobs:
run: |
make gendependabot
git diff -s --exit-code || (echo 'ALL_MODULES have been changed, please run "make gendependabot" and commit the changes in this PR.' && exit 1)
- name: Gen otelcorecol
run: |
make genotelcorecol
git diff -s --exit-code || (echo 'ALL_MODULES have been changed, please run "make genotelcorecol" and commit the changes in this PR.' && exit 1)
- name: Multimod verify
run: make multimod-verify
unittest:
Expand Down
4 changes: 4 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ issues:
- text: "G402:"
linters:
- gosec
# Exclude some linters from running on otelcorecol generated files.
- path: cmd/otelcorecol/*
linters:
- goimports

# The list of ids of default excludes to include or disable. By default it's empty.
# See the list of default excludes here https://golangci-lint.run/usage/configuration.
Expand Down
20 changes: 10 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ install-tools:
cd $(TOOLS_MOD_DIR) && go install go.opentelemetry.io/build-tools/multimod

.PHONY: run
run: build-binary-cmd-otelcol
./bin/otelcolcore --config ${RUN_CONFIG} ${RUN_ARGS}
run: otelcorecol
./bin/otelcorecol_$(GOOS)_$(GOARCH) --config ${RUN_CONFIG} ${RUN_ARGS}

.PHONY: for-all
for-all:
Expand Down Expand Up @@ -190,15 +190,15 @@ delete-tag:
git tag -d "$${dir:2}/$${TAG}" ); \
done

# Builds a collector binary of the removed cmd/otelcol directory
.PHONY: build-binary-cmd-otelcol
build-binary-cmd-otelcol:
mkdir -p ./bin
pushd cmd/builder/ && go run ./ --config ../../internal/buildscripts/builder-config.yaml --output-path ../../bin && popd
# Build the Collector executable.
.PHONY: otelcorecol
otelcorecol:
pushd cmd/otelcorecol && GO111MODULE=on CGO_ENABLED=0 go build -trimpath -o ../../bin/otelcorecol_$(GOOS)_$(GOARCH) \
$(BUILD_INFO) -tags $(GO_BUILD_TAGS) ./cmd/otelcorecol && popd

.PHONY: genmdata
genmdata:
$(MAKE) for-all CMD="go generate ./..."
.PHONY: genotelcorecol
genotelcorecol:
pushd cmd/builder/ && go run ./ --config ../otelcorecol/builder-config.yaml --output-path ../otelcorecol --skip-compilation && popd

DEPENDABOT_PATH=".github/dependabot.yml"
.PHONY: internal-gendependabot
Expand Down
1 change: 1 addition & 0 deletions cmd/otelcorecol/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ../../Makefile.Common
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dist:
module: go.opentelemetry.io/collector/cmd/otelcolcore
name: otelcolcore
module: go.opentelemetry.io/collector/cmd/otelcorecol
name: otelcorecol
include_core: false
description: Local OpenTelemetry Collector binary, testing only.
version: 0.41.0-dev
Expand Down Expand Up @@ -28,5 +28,5 @@ processors:
gomod: go.opentelemetry.io/collector v0.41.0

replaces:
- go.opentelemetry.io/collector => ../
- go.opentelemetry.io/collector/model => ../model
- go.opentelemetry.io/collector => ../../
- go.opentelemetry.io/collector/model => ../../model
81 changes: 81 additions & 0 deletions cmd/otelcorecol/components.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

79 changes: 79 additions & 0 deletions cmd/otelcorecol/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
// Code generated by "go.opentelemetry.io/collector/cmd/builder". DO NOT EDIT.

module go.opentelemetry.io/collector/cmd/otelcorecol

go 1.17

require (
go.opentelemetry.io/collector v0.41.0
golang.org/x/sys v0.0.0-20211205182925-97ca703d548d
)

require (
contrib.go.opencensus.io/exporter/prometheus v0.4.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cenkalti/backoff/v4 v4.1.2 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/felixge/httpsnoop v1.0.2 // indirect
github.com/go-kit/log v0.1.0 // indirect
github.com/go-logfmt/logfmt v0.5.0 // indirect
github.com/go-logr/logr v1.2.1 // indirect
github.com/go-logr/stdr v1.2.0 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/gorilla/mux v1.8.0 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/klauspost/compress v1.13.6 // indirect
github.com/knadh/koanf v1.3.3 // indirect
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
github.com/magiconair/properties v1.8.5 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/mapstructure v1.4.3 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/mostynb/go-grpc-compression v1.1.15 // indirect
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
github.com/prometheus/client_golang v1.11.0 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.32.1 // indirect
github.com/prometheus/procfs v0.6.0 // indirect
github.com/prometheus/statsd_exporter v0.21.0 // indirect
github.com/rs/cors v1.8.0 // indirect
github.com/shirou/gopsutil/v3 v3.21.11 // indirect
github.com/spf13/cast v1.4.1 // indirect
github.com/spf13/cobra v1.3.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/tklauser/go-sysconf v0.3.9 // indirect
github.com/tklauser/numcpus v0.3.0 // indirect
github.com/yusufpapurcu/wmi v1.2.2 // indirect
go.opencensus.io v0.23.0 // indirect
go.opentelemetry.io/collector/model v0.41.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.28.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.28.0 // indirect
go.opentelemetry.io/contrib/zpages v0.28.0 // indirect
go.opentelemetry.io/otel v1.3.0 // indirect
go.opentelemetry.io/otel/exporters/prometheus v0.26.0 // indirect
go.opentelemetry.io/otel/internal/metric v0.26.0 // indirect
go.opentelemetry.io/otel/metric v0.26.0 // indirect
go.opentelemetry.io/otel/sdk v1.3.0 // indirect
go.opentelemetry.io/otel/sdk/export/metric v0.26.0 // indirect
go.opentelemetry.io/otel/sdk/metric v0.26.0 // indirect
go.opentelemetry.io/otel/trace v1.3.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.7.0 // indirect
go.uber.org/zap v1.19.1 // indirect
golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d // indirect
golang.org/x/text v0.3.7 // indirect
google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa // indirect
google.golang.org/grpc v1.43.0 // indirect
google.golang.org/protobuf v1.27.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
)

replace go.opentelemetry.io/collector => ../../

replace go.opentelemetry.io/collector/model => ../../model
Loading

0 comments on commit 712d80e

Please sign in to comment.