Skip to content

Support Go 1.16#2821

Merged
jayconrod merged 2 commits intobazel-contrib:release-0.24from
jayconrod:go116
Feb 16, 2021
Merged

Support Go 1.16#2821
jayconrod merged 2 commits intobazel-contrib:release-0.24from
jayconrod:go116

Conversation

@jayconrod
Copy link
Copy Markdown
Collaborator

Fixes #2820

@google-cla google-cla bot added the cla: yes label Feb 16, 2021
The Go 1.16 linker appears stricter about fingerprinting. This test no
longer works, but the behavior being tested was never supported.

Sync with the test on master, which always expects an error.
Copy link
Copy Markdown
Member

@achew22 achew22 left a comment

Choose a reason for hiding this comment

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

LGTM

})
}

func runTest(t *testing.T, expectError bool, extraArgs ...string) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why are these removed?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

It looks like the 1.16 linker is pickier about fingerprinting packages than 1.15. The test cases that worked before now fail.

I think it's best just to sync this test with master; we won't test with conflicts anymore since it's undefined behavior. If folks are relying on this, they'll need to stay below Go 1.16 or fix conflicts.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

SGTM

@jayconrod jayconrod merged commit 702f3ba into bazel-contrib:release-0.24 Feb 16, 2021
@jayconrod jayconrod deleted the go116 branch February 16, 2021 22:46
yushan26 pushed a commit to yushan26/rules_go that referenced this pull request Jun 16, 2025
…rib#2856)

This reuses the previous work by @vonschultz who implemented
a PEP440 version normalizer. We extend it and use it in the
PEP508 marker evaluation.

Summary:
- Extend the normalization parser to output individual parts
  of the versions to the parsing context.
- Re-implement all of the version comparison calls to use the
  parsed version.
- Add extra validation for `.*` usage in the environment markers
- Fallback to non-version matching in the environment markers
  if one of the sides is not a version.
- Rename the original normalizer file to `version.bzl` because
  as far as Python is concerned this is the only version that
  there can be. We could in theory probably reuse this in other
  code where we are parsing the Python interpreter version many
  times, but this is left for the future.

Fixes bazel-contrib#2826
Work towards bazel-contrib#2821

---------

Co-authored-by: Richard Levasseur <richardlev@gmail.com>
Co-authored-by: Richard Levasseur <rlevasseur@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants