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

ci: update to Go 1.16.6 on CI #8324

Merged
merged 20 commits into from
Aug 17, 2021
Merged

ci: update to Go 1.16.6 on CI #8324

merged 20 commits into from
Aug 17, 2021

Conversation

guseggert
Copy link
Contributor

@guseggert guseggert commented Aug 3, 2021

Carried over from #8138

This also includes a change to use a beefier build host, which improves build times a lot (we were at 2 vCPUs, now 16 vCPUs, build time for me dropped from 30min -> 15min). It also fixes a bug that was causing the -coverprofile flag to be incorrect (due to Make subtleties, spaces were not being replaced correctly here).

@welcome
Copy link

welcome bot commented Aug 3, 2021

Thank you for submitting this PR!
A maintainer will be here shortly to review it.
We are super grateful, but we are also overloaded! Help us by making sure that:

  • The context for this PR is clear, with relevant discussion, decisions
    and stakeholders linked/mentioned.

  • Your contribution itself is clear (code comments, self-review for the
    rest) and in its best form. Follow the code contribution
    guidelines

    if they apply.

Getting other community members to do a review would be great help too on complex PRs (you can ask in the chats/forums). If you are unsure about something, just leave us a comment.
Next steps:

  • A maintainer will triage and assign priority to this PR, commenting on
    any missing things and potentially assigning a reviewer for high
    priority items.

  • The PR gets reviews, discussed and approvals as needed.

  • The PR is merged by maintainers when it has been approved and comments addressed.

We currently aim to provide initial feedback/triaging within two business days. Please keep an eye on any labelling actions, as these will indicate priorities and status of your contribution.
We are very grateful for your contribution!

@guseggert guseggert requested a review from aschmahmann August 3, 2021 18:40
Comment on lines 129 to 134
- run: |
mkdir ~/localgo && cd ~/localgo
wget https://golang.org/dl/go1.16.6.linux-amd64.tar.gz
tar xfz go1.16.6.linux-amd64.tar.gz
echo "export PATH=$(pwd)/go/bin:$PATH" >> $BASH_ENV
- run: go version
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the reason why we're doing this/what happens when we don't? Is this because the machine executor doesn't have the same version of Go as the golang ones?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good question, this might be unnecessary code, it was carried over from #8138. Let me dig deeper.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah this is required because the sharness test is using an Ubuntu image which is on Go 1.15.2, not the Go image.

@@ -9,17 +9,15 @@
# use the ipfs tool to test against

# add current directory to path, for ipfs tool.
if test "$MAKE_SKIP_PATH" != "1"; then
Copy link
Contributor

Choose a reason for hiding this comment

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

What changed with MAKE_SKIP_PATH?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure exactly why this fixes it. Presumably something somewhere else has a side efffect of setting the PATH so that it contains the correct ipfs binary for the test, which is what the sharness tests were implicitly relying on. Something changed with 1.16 such that the ipfs binary is no longer found in the PATH. I spent a few hours trying to find where, unsuccessfully. I couldn't find any rationale for MAKE_SKIP_PATH and the tests pass when I disable it, b/c PATH is setup correctly before each test run (pointing to the coverage binary).

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not totally sure, but I think the idea here is that you can locally run sharness tests on your machine from the sharness test folder without causing weird issues. Could you double check those work.

It seems like removing that flag shouldn't change anything (we set it to 1 in the makefile and then check if it equals 1).

I'm not sure exactly why this fixes it.

What was failing before and with which code changes? You've also changed a couple commands here (e.g. from BIN=$(cd .. && echo `pwd`/bin) to BIN=$(cd .. && pwd)/bin ). Any chance those were the changes that fixed things and not MAKE_SKIP_PATH?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did figure this out finally. It was due to this:

echo "export PATH=$(pwd)/go/bin:$PATH" >> $BASH_ENV

(link)

That writes a PATH env var to BASH_ENV, and BASH_ENV is inherited by every subshell, so every time a subshell is run, Bash applies env vars in BASH_ENV which overwrite whatever PATH was inherited from the parent process, which means setting PATH in any Makefile (or any other env in BASH_ENV) is silently ignored.

(Setting PATH with BASH_ENV is what CircleCI docs recommend....)

Copy link
Contributor

@aschmahmann aschmahmann left a comment

Choose a reason for hiding this comment

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

LGTM. @guseggert if there's a 1.16.7 then let's use that, otherwise we can just merge.

@BigLep
Copy link
Contributor

BigLep commented Aug 17, 2021

Per 2021-08-17 conversation: update to 1.16.7

Short term

  • everything except go-ipfs should run 1.16.x and 1.17.0
  • sharness will run on 1.16.x
  • infrastructure will deploy with 1.16.x

@guseggert guseggert merged commit 360aff4 into master Aug 17, 2021
@guseggert guseggert deleted the update-go-on-ci-guseggert branch August 17, 2021 16:34
@@ -126,6 +127,12 @@ jobs:
TEST_VERBOSE: 1
steps:
- run: sudo apt update
- run: |
mkdir ~/localgo && cd ~/localgo
wget https://golang.org/dl/go1.16.6.linux-amd64.tar.gz
Copy link
Member

Choose a reason for hiding this comment

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

Should be 1.16.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants