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

x/website/_content/ref/mod.mod: misstatements about build metadata in versions #64652

Open
bcmills opened this issue Dec 11, 2023 · 1 comment
Labels
Documentation FixPending Issues that have a fix which has not yet been reviewed or submitted. GoCommand cmd/go modules NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@bcmills
Copy link
Contributor

bcmills commented Dec 11, 2023

Go version

59275e2

What operating system and processor architecture are you using (go env)?

N/A

What did you do?

Read https://go.dev/ref/mod#versions.

What did you expect to see?

A description of the actual behavior of the go command.¹

Concretely:

  • go get accepts versions with +metadata suffixes, and will accept such a tag as the base for a pseudo-version.
  • However, because Semantic Version specifies that +metadata has no effect on version precedence, go commands convert such versions to unambiguous, totally-ordered pseudo-versions for the purpose of version selection, and those pseudo-versions are what are ultimately written to the go.mod file.

¹https://cs.opensource.google/go/go/+/master:src/cmd/go/internal/modfetch/coderepo.go;l=586-596;drc=46ea4ab5cb87e9e5d443029f5f1a4bba012804d3

What did you see instead?

(emphasis added)

The build metadata suffix is ignored for the purpose of comparing versions. Tags with build metadata are ignored in version control repositories, but build metadata is preserved in versions specified in go.mod files. The suffix +incompatible denotes a version released before migrating to modules version major version 2 or later (see Compatibility with non-module repositories).

@gopherbot gopherbot added this to the Unreleased milestone Dec 11, 2023
@bcmills bcmills added Documentation NeedsFix The path to resolution is known, but the work has not been done. GoCommand cmd/go modules labels Dec 11, 2023
@bcmills bcmills changed the title x/website/_content/ref/mod.mod: errors about build metadata in versions x/website/_content/ref/mod.mod: misstatements about build metadata in versions Dec 11, 2023
@gopherbot
Copy link

Change https://go.dev/cl/553156 mentions this issue: _content/ref: modules, correct statement on recording build metadata

@dmitshur dmitshur added the FixPending Issues that have a fix which has not yet been reviewed or submitted. label Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation FixPending Issues that have a fix which has not yet been reviewed or submitted. GoCommand cmd/go modules NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

3 participants