Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: mage installation with go1.18 #33083

Merged
merged 5 commits into from
Sep 14, 2022

Conversation

v1v
Copy link
Member

@v1v v1v commented Sep 14, 2022

What does this PR do?

go1.18 changed where the packages are installed when using go install
Run the same command in the CI pipeline

Why is it important?

The UR for 7.17 is broken for the last 5 days.

Installing mage v1.13.0.
make[3]: Leaving directory '/var/lib/jenkins/workspace/elastic+unified-release+master+snapshot-beats-7.17/cd/release/release-manager/project-configs/7.17/build/projects/gopath/src/github.com/elastic/beats/libbeat'
bash: mage: command not found
make[3]: [../dev-tools/make/mage-install.mk:11: mage] Error 127 (ignored)
bash: mage: command not found
make[3]: *** [scripts/Makefile:33

Test

echo  1.17.10 > .go-version
./dev-tools/run_with_go_ver make test-mage 
...

## Variables

GOOS             = darwin
GOARCH           = amd64
GOARM            = 
Platform         = darwin/amd64
BinaryExt        = 
XPackDir         = ../x-pack
echo  1.18.5 > .go-version
./dev-tools/run_with_go_ver make test-mage 
...

## Variables

GOOS             = darwin
GOARCH           = amd64
GOARM            = 
Platform         = darwin/amd64
BinaryExt        = 
XPackDir         = ../x-pack
BeatName         = beats
BeatServiceName  = beats
## Functions

beat_doc_branch              = 7.17
beat_version                 = 7.17.7
commit                       = 0390d5708dec5ef6c7c721af0c29e6a4bc28261d
date                         = 2022-09-14T17:37:17Z
elastic_beats_dir            = /Users/vmartinez/work/src/github.com/elastic/beats
go_version                   = 1.18.5

Additionally, I tested on docker, to be the more platform agnostic as possible, see #33083 (comment)

Issues

Caused by #32693

@v1v v1v requested review from cmacknz and a team September 14, 2022 16:19
@v1v v1v requested a review from a team as a code owner September 14, 2022 16:19
@v1v v1v requested review from belimawr and removed request for a team September 14, 2022 16:19
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Sep 14, 2022
@botelastic
Copy link

botelastic bot commented Sep 14, 2022

This pull request doesn't have a Team:<team> label.

@v1v v1v self-assigned this Sep 14, 2022
@v1v v1v added the bug label Sep 14, 2022
@elasticmachine
Copy link
Collaborator

elasticmachine commented Sep 14, 2022

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-09-14T17:33:03.123+0000

  • Duration: 73 min 53 sec

Test stats 🧪

Test Results
Failed 0
Passed 22149
Skipped 1563
Total 23712

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

Copy link
Member

@cmacknz cmacknz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I noticed this errors in the logs but never got around to figuring out why they were there.

@v1v
Copy link
Member Author

v1v commented Sep 14, 2022

I'm still fixing it ...

$ docker run --rm -ti -v `pwd`:/src/github.com/elastic/beats -w /src/github.com/elastic/beats ubuntu
$ apt-get update ; apt-get install -y curl make build-essential  ; HOME=/src ./dev-tools/run_with_go_ver make test-mage
+ /src/bin/gvm 1.17.10
+ cut -d ' ' -f 2
+ tr -d '\"'


++ /src/bin/gvm 1.17.10
+ eval 'export GOROOT="/src/.gvm/versions/go1.17.10.linux.amd64"
export PATH="/src/.gvm/versions/go1.17.10.linux.amd64/bin:$PATH"'
++ export GOROOT=/src/.gvm/versions/go1.17.10.linux.amd64
++ GOROOT=/src/.gvm/versions/go1.17.10.linux.amd64
++ export PATH=/src/.gvm/versions/go1.17.10.linux.amd64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
++ PATH=/src/.gvm/versions/go1.17.10.linux.amd64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
...

## Functions

beat_doc_branch              = {{ beat_doc_branch }}
beat_version                 = {{ beat_version }}
commit                       = {{ commit }}
date                         = {{ date }}
elastic_beats_dir            = {{ elastic_beats_dir }}
go_version                   = {{ go_version }}
repo.RootImportPath          = {{ repo.RootImportPath }}
repo.CanonicalRootImportPath = {{ repo.CanonicalRootImportPath }}
repo.RootDir                 = {{ repo.RootDir }}

Comment on lines +91 to +93
dir("${BASE_DIR}") {
sh "HOME=${WORKSPACE} GO_VERSION=${GO_VERSION} ./dev-tools/run_with_go_ver make test-mage"
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works

image

@v1v
Copy link
Member Author

v1v commented Sep 14, 2022

@cmacknz , I think this will be ready to be merged, somehow my initial thoughts were about the GOPATH, but the issue was related to go install. I'll be offline in a bit, so this PR could be merged as soon as it gets green, you don't need to wait for me, in case the release team wanna build 7.17 sooner than later, otherwise I'll merge it first thing tomorrow morning

@v1v v1v requested a review from cmacknz September 14, 2022 17:34
@cmacknz cmacknz merged commit 5385fd2 into elastic:7.17 Sep 14, 2022
@v1v
Copy link
Member Author

v1v commented Sep 21, 2022

@Mergifyio backport main

@v1v
Copy link
Member Author

v1v commented Sep 21, 2022

@Mergifyio backport 8.5

@v1v
Copy link
Member Author

v1v commented Sep 21, 2022

@Mergifyio backport 8.4

@mergify
Copy link
Contributor

mergify bot commented Sep 21, 2022

backport main

✅ Backports have been created

@mergify
Copy link
Contributor

mergify bot commented Sep 21, 2022

backport 8.5

❌ No backport have been created

  • Backport to branch 8.5 failed: Branch not found

mergify bot pushed a commit that referenced this pull request Sep 21, 2022
* path for the mage with go1.18 has changed

* ci: test the command in the CI pipeline

* ci: set HOME

* new make goal to validate the mage installation

* unrequired path when using go install

(cherry picked from commit 5385fd2)

# Conflicts:
#	Jenkinsfile
mergify bot pushed a commit that referenced this pull request Sep 21, 2022
* path for the mage with go1.18 has changed

* ci: test the command in the CI pipeline

* ci: set HOME

* new make goal to validate the mage installation

* unrequired path when using go install

(cherry picked from commit 5385fd2)

# Conflicts:
#	Jenkinsfile
@mergify
Copy link
Contributor

mergify bot commented Sep 21, 2022

backport 8.4

✅ Backports have been created

@v1v
Copy link
Member Author

v1v commented Sep 21, 2022

@Mergifyio backport 8.5

mergify bot pushed a commit that referenced this pull request Sep 21, 2022
* path for the mage with go1.18 has changed

* ci: test the command in the CI pipeline

* ci: set HOME

* new make goal to validate the mage installation

* unrequired path when using go install

(cherry picked from commit 5385fd2)

# Conflicts:
#	Jenkinsfile
@mergify
Copy link
Contributor

mergify bot commented Sep 21, 2022

backport 8.5

✅ Backports have been created

michalpristas added a commit that referenced this pull request Nov 9, 2022
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug needs_team Indicates that the issue/PR needs a Team:* label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants