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

all: attempt to make method for shadow checks consistent with 1.12 and 1.13 #1797

Merged
merged 2 commits into from Oct 1, 2019
Merged

all: attempt to make method for shadow checks consistent with 1.12 and 1.13 #1797

merged 2 commits into from Oct 1, 2019

Conversation

leighmcculloch
Copy link
Member

PR Checklist

PR Structure

  • This PR has reasonably narrow scope (if not, break it down into smaller PRs).
  • This PR avoids mixing refactoring changes with feature changes (split into two PRs
    otherwise).
  • This PR's title starts with name of package that is most changed in the PR, ex.
    services/friendbot, or all or doc if the changes are broad or impact many
    packages.

Thoroughness

  • This PR adds tests for the most critical parts of the new functionality or fixes.
  • I've updated any docs (developer docs, .md
    files, etc... affected by this change). Take a look in the docs folder for a given service,
    like this one.

Release planning

  • I've updated the relevant CHANGELOG (here for Horizon) if
    needed with deprecations, added features, breaking changes, and DB schema changes.
  • I've decided if this PR requires a new major/minor version according to
    semver, or if it's mainly a patch change. The PR is targeted at the next
    release branch if it's not a patch change.

Summary

Change the govet.sh script so that it runs the shadows check the same way for Go 1.12 and Go 1.13 builds, wrapping the shadow analyzer in a tiny main function that catches and ignores the unsafeptr flag that gets passed through by go vet in Go 1.13+.

Goal and scope

On a couple occasions we've had builds break after #1778 was merged. The failures reported have only been on Go 1.13. The specific failure seems to be inconsistent and was reported to golang/go#34557. The fact that we've seen this failure only occur on Go 1.13 is curious. It's possible that there's a change in the language that is contributing to that behavior, or it's possible that different way we run the shadow checker for our 1.13 builds is causing tests to be included in some different way.

When I implemented #1778 I had the option of making the 1.12 and 1.13 builds execute the binary the same way like in this PR, or to execute differently like how it was done in #1778. I mostly flipped a coin.

I'm not sure if doing it this other way will yield more consistent go vet runs, but I figure worth a shot before we remove it.

Summary of changes

  • Remove the code that runs shadow differently on Go 1.13
  • When installing the shadow analyzer, wrap it in a simple main that will gobble the unsafeptr flag

Known limitations & issues

  • This might not make a difference to the failures.
  • This doesn't address the actual cause of the failures, or the inconsistency, and is just attempting to make our own two builds more consistent with each other.

What shouldn't be reviewed

N/A

govet.sh Outdated Show resolved Hide resolved
Co-Authored-By: Eric Saunders <ire-and-curses@users.noreply.github.com>
@leighmcculloch leighmcculloch merged commit 828c132 into stellar:master Oct 1, 2019
@leighmcculloch leighmcculloch deleted the shadow-shadow-where-are-you branch December 13, 2019 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants