From de2f3ef80e321db3205c82fd02f08408f736dcd0 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 21 Sep 2022 19:23:15 +0100 Subject: [PATCH] fix: mage installation with go1.18 (backport #33083) (#33149) --- Jenkinsfile | 4 ++++ Makefile | 4 ++++ dev-tools/make/mage-install.mk | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4c40ebdba84..75bcec3a746 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -88,6 +88,10 @@ pipeline { steps { withGithubNotify(context: "Checks") { stageStatusCache(id: 'Checks'){ + // test the ./dev-tools/run_with_go_ver used by the Unified Release process + dir("${BASE_DIR}") { + sh "HOME=${WORKSPACE} GO_VERSION=${GO_VERSION} ./dev-tools/run_with_go_ver make test-mage" + } withBeatsEnv(archive: false, id: "checks") { dumpVariables() whenTrue(env.ONLY_DOCS == 'false') { diff --git a/Makefile b/Makefile index a859eff1f2a..de3f72d15ff 100644 --- a/Makefile +++ b/Makefile @@ -235,3 +235,7 @@ beats-dashboards: mage update build/distributions/dependencies.csv: $(PYTHON) @mkdir -p build/distributions $(PYTHON) dev-tools/dependencies-report --csv $@ + +## test-mage : Test the mage installation used by the Unified Release process +test-mage: mage + @mage dumpVariables diff --git a/dev-tools/make/mage-install.mk b/dev-tools/make/mage-install.mk index 309e3fa585a..db6beb37c62 100644 --- a/dev-tools/make/mage-install.mk +++ b/dev-tools/make/mage-install.mk @@ -7,7 +7,7 @@ export MAGE_IMPORT_PATH mage: ifndef MAGE_PRESENT @echo Installing mage $(MAGE_VERSION). - @go get -ldflags="-X $(MAGE_IMPORT_PATH)/mage.gitTag=$(MAGE_VERSION)" ${MAGE_IMPORT_PATH}@$(MAGE_VERSION) + @go install -ldflags="-X $(MAGE_IMPORT_PATH)/mage.gitTag=$(MAGE_VERSION)" ${MAGE_IMPORT_PATH}@$(MAGE_VERSION) @-mage -clean endif @true