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/vgo: add ability to report list of directly imported modules #24042

Closed
skseth opened this issue Feb 22, 2018 · 4 comments

Comments

@skseth
Copy link

commented Feb 22, 2018

A common pattern with the minimal version selection would be for each module owner to update to the latest applicable version of their direct dependencies, but accept the minimal version for any transitive dependency.

For example, if my module A depends on B and C, which both in turn depend on D, i want the latest of B and C only, and then transitively pull in the minimal version D compatible with B and C.

At this point i have a command "vgo get -u" which will get me the latest of B and C, but also D, which i may not want. The request is for something like "vgo get -u -directonly", which would restrict the upgradation to the latest versions of the direct dependencies B and C.

@gopherbot gopherbot added this to the vgo milestone Feb 22, 2018

@FiloSottile FiloSottile changed the title x/vgo:Allow updating all direct dependencies to the latest version x/vgo: allow updating all direct dependencies to the latest version Feb 22, 2018

@rsc

This comment has been minimized.

Copy link
Contributor

commented Mar 30, 2018

I think more generally we might want a way to list the modules imported directly from this one. Then you just want vgo get -u <that list>. Will think about that.

@rsc rsc changed the title x/vgo: allow updating all direct dependencies to the latest version x/vgo: add ability to report list of directly imported modules Mar 30, 2018

@rsc rsc added the NeedsDecision label Mar 30, 2018

@myitcv

This comment has been minimized.

Copy link
Member

commented Apr 10, 2018

Commenting under the new title "x/vgo: add ability to report list of directly imported modules" - so this is not a comment about versioning/upgrading etc

@rsc were you thinking about this information living in the "Module" section of vgo list -json?

{
	"Module": {
		"Transitive": [
			// transitive set of module dependencies; vgo equivalent of .Deps
			{
				"Package": "golang.org/x/net/html",
				"Version": "v0.0.0-20180406214816-61147c48b25b"
			},
			...
		],
		"Direct": [
			// direct "requires" from go.mod; vgo equivalent of .Imports
			// + .TestImports + .XTestImports
			{
				"Package": "golang.org/x/net/html",
				"Version": "v0.0.0-20180406214816-61147c48b25b"
			}
		],
		"Path": "rubbish.com/blah",
		"Top": true,
		"Version": ""
	}
}
@rsc

This comment has been minimized.

Copy link
Contributor

commented Jul 6, 2018

There's not a flag but after the CLs I have pending you can use

vgo get $(vgo list -m -f '{{if and (not .Indirect) (not .Main)}}{{.Path}}{{end}}' all)
@gopherbot

This comment has been minimized.

Copy link

commented Jul 6, 2018

Change https://golang.org/cl/121304 mentions this issue: cmd/go/internal/vgo: track directly-used vs indirectly-used modules

@golang golang locked and limited conversation to collaborators Jul 10, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants
You can’t perform that action at this time.