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

proposal: x/mod: new repo for module mechanics #31761

Open
rsc opened this issue Apr 30, 2019 · 21 comments

Comments

Projects
None yet
9 participants
@rsc
Copy link
Contributor

commented Apr 30, 2019

For the initial development of module support, we've kept everything in internal directories to make it easier to make changes as our understanding of what the pieces should look like becomes clearer. But now I think the basic pieces have become pretty clear, and we should think about exporting some packages to help other people who want to write tools working directly with module mechanics.

Note that I said "module mechanics". This is about supporting direct manipulation of modules themselves. It is not about supporting general development tools that need to do things like load packages in module mode. That use case, where modules are incidental rather than the focus, should remain in x/tools, specifically x/tools/go/packages. And the specific case of loading packages should still be done by invoking the go command, which will remain the single point of truth for those algorithms.

I propose to create a new repo golang.org/x/mod that will initially contain:

There's an open issue that this proposal addresses (about exposing some of this stuff) but once again I cannot find it.

/cc @bcmills @jayconrod @ianthehat @myitcv @rogpeppe

@rsc rsc added this to the Proposal milestone Apr 30, 2019

@rsc rsc added the Proposal label Apr 30, 2019

@bcmills

This comment has been minimized.

Copy link
Member

commented Apr 30, 2019

There's an open issue that this proposal addresses (about exposing some of this stuff) but once again I cannot find it.

That's #28101.

@dmitshur

This comment has been minimized.

Copy link
Member

commented Apr 30, 2019

I propose to create a new repo golang.org/x/mod

Does this proposal include a plan for how the new module, modfile, semver, etc., packages will be kept in sync with the ones in cmd/go/internal/...?

@bcmills

This comment has been minimized.

Copy link
Member

commented Apr 30, 2019

I would assume that they'll be vendored in using go mod vendor.

That does imply that we'll have to have a clean (and perhaps smaller) API boundary between golang.org/x/mod and cmd/go/internal, but that's arguably a good thing anyway.

@rsc

This comment has been minimized.

Copy link
Contributor Author

commented Apr 30, 2019

@dmitshur, yes they would be vendored into cmd/vendor using "go mod vendor".
All the ones I've chosen should already have clean API boundaries, and if not, we'd work on that.

@ianthehat

This comment has been minimized.

Copy link

commented May 2, 2019

I need quite a few of these in order to support mod files in editors. I have an experiment I have been working on that has them copied to an internal directory of x/tools, but it would be much nicer if I could go straight to using this repository instead.

@hyangah

This comment has been minimized.

Copy link
Contributor

commented May 3, 2019

@jayconrod

This comment has been minimized.

Copy link
Contributor

commented May 3, 2019

The list of packages above looks good. I expect this will be useful for developing gorelease and a lot of other tools.

I notice that none of internal/modload, internal/modfetch, internal/modfetch/coderepo, internal/mvs are in the list. I think that's the right decision for now -- these are all pretty tightly coupled with cmd/go. It might be worth moving these to x/mod after some refactoring though. I think the proxy and discovery projects have run into use cases where query and download functionality would be useful, and the Go command doesn't do quite what they need.

@thepudds thepudds added the modules label May 5, 2019

@rsc

This comment has been minimized.

Copy link
Contributor Author

commented May 7, 2019

Sentiment here seems overwhelmingly in favor. Accepting proposal.

@rsc rsc modified the milestones: Proposal, Go1.13 May 7, 2019

@rsc

This comment has been minimized.

Copy link
Contributor Author

commented May 7, 2019

Obviously x/mod itself is "unreleased" but it will have effects in the main repo, so milestoned to Go 1.13.

@rsc

This comment has been minimized.

Copy link
Contributor Author

commented May 10, 2019

@andybons, I created this repo. Can you take care of adding it to gopherbot, builders, etc.? Thanks.

@gopherbot

This comment has been minimized.

Copy link

commented May 10, 2019

Change https://golang.org/cl/176463 mentions this issue: sumdb/note: signed note formats for checksum database

@gopherbot

This comment has been minimized.

Copy link

commented May 10, 2019

Change https://golang.org/cl/176464 mentions this issue: sumdb/dirhash: directory tree hash algorithm

@gopherbot

This comment has been minimized.

Copy link

commented May 10, 2019

Change https://golang.org/cl/176465 mentions this issue: sumdb/storage: basic storage interface and tests

@gopherbot

This comment has been minimized.

Copy link

commented May 10, 2019

Change https://golang.org/cl/176466 mentions this issue: sumdb: client and server protocol for checksum database

@gopherbot

This comment has been minimized.

Copy link

commented May 10, 2019

Change https://golang.org/cl/176460 mentions this issue: semver: basic semver parsing package

@gopherbot

This comment has been minimized.

Copy link

commented May 10, 2019

Change https://golang.org/cl/176461 mentions this issue: module: basic module.Version type and support

@gopherbot

This comment has been minimized.

Copy link

commented May 10, 2019

Change https://golang.org/cl/176462 mentions this issue: sumdb/tlog: transparent log data structures and algorithms

@andybons

This comment has been minimized.

Copy link
Member

commented May 10, 2019

Everything is set up for x/mod (mirroring, gerritbot, golang.org/x/mod, etc.)

@gopherbot

This comment has been minimized.

Copy link

commented May 10, 2019

Change https://golang.org/cl/176639 mentions this issue: sumdb/gosumcheck: basic go.sum checker

@gopherbot

This comment has been minimized.

Copy link

commented May 10, 2019

Change https://golang.org/cl/176540 mentions this issue: proxy: basic proxy server protocol

@gopherbot

This comment has been minimized.

Copy link

commented May 10, 2019

Change https://golang.org/cl/176541 mentions this issue: gomodproxy: simple Go module proxy implementation

gopherbot pushed a commit to golang/mod that referenced this issue May 13, 2019

semver: basic semver parsing package
Copied from cmd/go/internal/semver.

For golang/go#31761.

Change-Id: I59e8a264f49a5d20ba1caa85b59c3177209a6ff5
Reviewed-on: https://go-review.googlesource.com/c/mod/+/176460
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>

gopherbot pushed a commit to golang/mod that referenced this issue May 13, 2019

module: basic module.Version type and support
Copied from cmd/go/internal/module and added Version.String method.

For golang/go#31761.

Change-Id: I2fbe224843378e68f0e5890dbc36766936a7e3ed
Reviewed-on: https://go-review.googlesource.com/c/mod/+/176461
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>

gopherbot pushed a commit to golang/mod that referenced this issue May 13, 2019

sumdb/tlog: transparent log data structures and algorithms
Copied from golang.org/x/exp/sumdb/internal/tlog.

For golang/go#31761.

Change-Id: If44ad226195908ebc8757c1ca54f20f2a6adb3ef
Reviewed-on: https://go-review.googlesource.com/c/mod/+/176462
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>

gopherbot pushed a commit to golang/mod that referenced this issue May 13, 2019

sumdb/note: signed note formats for checksum database
Copied from golang.org/x/exp/sumdb/internal/note.

For golang/go#31761.

Change-Id: Ie1feebc86b6d34a6cdd20ee0c0ba24588841d1c3
Reviewed-on: https://go-review.googlesource.com/c/mod/+/176463
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>

gopherbot pushed a commit to golang/mod that referenced this issue May 13, 2019

sumdb/dirhash: directory tree hash algorithm
Copied from cmd/go/internal/dirhash, with additional doc comments.

For golang/go#31761.

Change-Id: Id56c1bbb6f27e69194f383d49b9def6876f948be
Reviewed-on: https://go-review.googlesource.com/c/mod/+/176464
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>

gopherbot pushed a commit to golang/mod that referenced this issue May 13, 2019

sumdb/storage: basic storage interface and tests
Copied from golang.org/x/exp/sumdb/internal/tkv and tkvtest.

For golang/go#31761.

Change-Id: Ib5a411c9b9641d1006a2e721043e8e16bf0f6bea
Reviewed-on: https://go-review.googlesource.com/c/mod/+/176465
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.