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

cmd/go: synchronize and remove packages duplicated in x/mod #34801

Closed
jayconrod opened this issue Oct 9, 2019 · 2 comments
Closed

cmd/go: synchronize and remove packages duplicated in x/mod #34801

jayconrod opened this issue Oct 9, 2019 · 2 comments
Labels
FrozenDueToAge GoCommand cmd/go modules NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@jayconrod
Copy link
Contributor

There are several module-related packages that appear in both cmd/go and golang.org/x/mod. They are:

cmd/go/internal/module => golang.org/x/mod/module
cmd/go/internal/semver => golang.org/x/mod/semver
cmd/go/internal/sumweb => golang.org/x/mod/sumdb
cmd/go/internal/dirhash => golang.org/x/mod/sumdb/dirhash
cmd/go/internal/note => golang.org/x/mod/sumdb/note
cmd/go/internal/tlog => golang.org/x/mod/sumdb/tlog

When Russ copied these packages to x/mod, he added documentation and renamed some definitions. We should not undo that. At the same time, we should be careful to copy any changes and fixes to these packages from cmd/go to x/mod in a way that doesn't break compatibility.

@jayconrod jayconrod added NeedsFix The path to resolution is known, but the work has not been done. GoCommand cmd/go modules labels Oct 9, 2019
@jayconrod jayconrod added this to the Go1.14 milestone Oct 9, 2019
@jayconrod jayconrod self-assigned this Oct 9, 2019
@gopherbot
Copy link

Change https://golang.org/cl/200138 mentions this issue: cmd/go: integrate changes made in x/mod packages into internal packages

gopherbot pushed a commit that referenced this issue Oct 11, 2019
This change integrates changes made to x/mod packages into our internal
copies of those packages.

This is the first step of a bidirectional synchronization. A follow-up
change will copy changes made to the internal packages after x/mod was
forked. After that, we can vendor x/mod, update imports, and delete
the internal copies.

The following packages are affected:

* internal/module
* internal/semver (no change)
* internal/sumweb (renamed to internal/sumdb)
* internal/dirhash
* internal/note
* internal/tlog

Several integrated changes affect other packages:

* cmd/go/internal/module.MatchPathMajor now wraps a new function,
  CheckPathMajor, which returns error. MatchPathMajor returns
  bool. This will avoid an incompatible change in the next step.
* module.EncodePath renamed to EscapePath, EncodeVersion to
  EscapeVersion, DecodePath to UnescapePath, DecodeVersion to
  UnescapeVersion.
* cmd/go/internal/sumweb moved to cmd/go/internal/sumdb and package
  renamed to sumdb.
* sumdb.Client renamed to ClientOps, Conn to Client, Server to
  ServerOps, Paths to ServerPaths.
* sumdb/encode.go and encode_test.go are not present in x/mod since
  they are redundant with functionality in module. Both files are
  deleted.
* sumdb.TestServer doesn't implement sumdb.ServerOps after changes
  were were made to golang.org/x/mod/sumdb.ServerOps during the fork.
  Local changes made so tests will pass. These will be copied to x/mod
  in the next step.

Updates #34801

Change-Id: I7e820f10ae0cdbec238e59d039e978fd1cdc7201
Reviewed-on: https://go-review.googlesource.com/c/go/+/200138
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
@gopherbot
Copy link

Change https://golang.org/cl/200767 mentions this issue: all: integrate changes made in cmd/go packages

gopherbot pushed a commit to golang/mod that referenced this issue Oct 16, 2019
This change integrates changes made to cmd/go packages into the
corresponding x/mod packages.

This is the second step of a bidirectional synchronization. The
previous step was CL 200138, which copied changes made in these
packages back into cmd/go. With this change, the cmd/go and x/mod
packages should be the same except for imports. After this change, we
can vendor x/mod into cmd, then remove the duplicate packages in
cmd/go.

Other important changes:

* Updated requirement on golang.org/x/crypto to latest and added
  golang.org/x/xerrors. crypto is needed for ed25519, which was added
  to std in go1.13. xerrors is needed for unwrapping, which was also
  added in 1.13. The x versions of these are compatible with go1.12.
* Copied internal/lazyregexp from std, since it's used in sumdb.

Updates golang/go#34801

Change-Id: Iafdd0668970f9004e663040535c521241d11a6a8
Reviewed-on: https://go-review.googlesource.com/c/mod/+/200767
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
@golang golang locked and limited conversation to collaborators Nov 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge 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

2 participants