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

std,cmd: add a unit test to ensure that src/go.mod and src/cmd/go.mod are in sync #36907

Closed
bcmills opened this issue Jan 30, 2020 · 7 comments
Closed

Comments

@bcmills
Copy link
Member

@bcmills bcmills commented Jan 30, 2020

In #36851 (comment), @FiloSottile noticed that the std module and the cmd module currently depend on different commits of the golang.org/x/sys module.

We should prevent such skew in the future. It should be straightforward to write a test that uses go list (or a similar approach) to check that the versions required by std and cmd agree for the modules in the intersection of their dependencies.

@bcmills bcmills added this to the Go1.15 milestone Jan 30, 2020
@bcmills bcmills self-assigned this Jan 30, 2020
@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Jan 30, 2020

It's not wholly clear to me why we need to vendor golang.org/x/sys in two different places.

@FiloSottile

This comment has been minimized.

Copy link
Member

@FiloSottile FiloSottile commented Jan 30, 2020

See also #36852.

@bcmills

This comment has been minimized.

Copy link
Member Author

@bcmills bcmills commented Jan 30, 2020

@ianlancetaylor: std needs golang.org/x/sys/cpu, whereas cmd needs golang.org/x/sys/unix.

We don't put std and cmd in the same module because we want to make it easy to see that std does not depend on anything unexpected, especially outside of x/. In contrast, cmd depends on a few modules external to the project (github.com/ianlancetaylor/demangle and github.com/google/pprof).

@bcmills

This comment has been minimized.

Copy link
Member Author

@bcmills bcmills commented Jan 30, 2020

@FiloSottile, note that the test described in #36852 requires network access (in order to download the pristine dependencies for comparison), while the test described here can (at least partially) be computed offline from the contents of src/vendor/modules.txt and src/cmd/vendor/modules.txt.

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Jan 31, 2020

Change https://golang.org/cl/217218 mentions this issue: cmd/internal/moddeps: check for consistent versioning among all modules in GOROOT

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Feb 3, 2020

Change https://golang.org/cl/217517 mentions this issue: all: update module dependencies

@dmitshur

This comment has been minimized.

Copy link
Member

@dmitshur dmitshur commented Feb 19, 2020

This issue is currently labeled as early-in-cycle for Go 1.15. That time is now, so friendly ping. If it no longer needs to be done early in cycle, that label can be removed.

gopherbot pushed a commit that referenced this issue Feb 19, 2020
Updates #36905
Updates #36907

Change-Id: I293dcef67800d5c81ff3a254bbd49309c5880710
Reviewed-on: https://go-review.googlesource.com/c/go/+/217517
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
@gopherbot gopherbot closed this in 8a8adc2 Feb 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.