Skip to content

Commit

Permalink
[chore] add remove-toolchain make cmd (#35490)
Browse files Browse the repository at this point in the history
**Description:** <Describe what has changed.>
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->

This PR adds a new `remove-toolchain` make command which removes the
`toolchain` directive from all go.mod files.
The new make command is also added to the `update-otel` make target.

**Link to tracking Issue:** <Issue number if applicable>
- fixes
#33600
- could potentially also work for
#35160

**Testing:** <Describe what testing was performed and which tests were
added.>
- add a `toolchain go1.22.5` directive to any of the go.mod files in
this repo
- call `make remove-toolchain`
- check if the toolchain directive was removed

---------

Signed-off-by: Moritz Wiesinger <[email protected]>
  • Loading branch information
mowies authored Oct 1, 2024
1 parent c621e78 commit 795694c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ gogci:
gotidy:
$(MAKE) $(FOR_GROUP_TARGET) TARGET="tidy"

.PHONY: remove-toolchain
remove-toolchain:
$(MAKE) $(FOR_GROUP_TARGET) TARGET="toolchain"

.PHONY: gomoddownload
gomoddownload:
$(MAKE) $(FOR_GROUP_TARGET) TARGET="moddownload"
Expand Down Expand Up @@ -404,11 +408,12 @@ update-otel:$(MULTIMOD)
$(MULTIMOD) sync -s=true -o ../opentelemetry-collector -m beta --commit-hash $(OTEL_VERSION)
git add . && git commit -s -m "[chore] multimod update beta modules" ; \
$(MAKE) gotidy
$(call updatehelper,$(CORE_VERSIONS),$(GOMOD),./cmd/otelcontribcol/builder-config.yaml)
$(call updatehelper,$(CORE_VERSIONS),$(GOMOD),./cmd/otelcontribcol/builder-config.yaml)
$(call updatehelper,$(CORE_VERSIONS),$(GOMOD),./cmd/oteltestbedcol/builder-config.yaml)
$(MAKE) genotelcontribcol
$(MAKE) genoteltestbedcol
$(MAKE) oteltestbedcol
$(MAKE) remove-toolchain

.PHONY: otel-from-tree
otel-from-tree:
Expand Down
4 changes: 4 additions & 0 deletions Makefile.Common
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,10 @@ tidy:
rm -fr go.sum
$(GOCMD) mod tidy -compat=1.22.0

.PHONY: toolchain
toolchain:
$(GOCMD) get toolchain@none

.PHONY: misspell
misspell: $(TOOLS_BIN_DIR)/misspell
@echo "running $(MISSPELL)"
Expand Down
2 changes: 0 additions & 2 deletions exporter/dorisexporter/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/exporter/dorise

go 1.22.0

toolchain go1.22.7

require (
github.com/cenkalti/backoff/v4 v4.3.0
// cannot use higher version: https://github.com/go-sql-driver/mysql/issues/1602
Expand Down

0 comments on commit 795694c

Please sign in to comment.