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
Closed

x/vgo: add ability to report list of directly imported modules #24042

skseth opened this issue Feb 22, 2018 · 4 comments
Labels
FrozenDueToAge NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone

Comments

@skseth
Copy link

skseth 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
Copy link
Contributor

rsc 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 Feedback is required from experts, contributors, and/or the community before a change can be made. label Mar 30, 2018
@myitcv
Copy link
Member

myitcv 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
Copy link
Contributor

rsc 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
Copy link

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.
Labels
FrozenDueToAge NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Projects
None yet
Development

No branches or pull requests

4 participants