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

Have an option to determine recursive package dependencies. #89

Open
rajudev opened this issue Feb 4, 2018 · 13 comments
Open

Have an option to determine recursive package dependencies. #89

rajudev opened this issue Feb 4, 2018 · 13 comments
Assignees

Comments

@rajudev
Copy link
Contributor

rajudev commented Feb 4, 2018

While running dh-make-golang <package-name> , we get a list of dependencies which are still not in Debian.
Then we have to do the same thing for all the dependencies and there sub-dependencies on multiple hierarchies manually.

It would be great if dh-make-golang has an optional flag, may be -r or something like --recursive-dependencies so that it can generate the whole dependency tree.

A simple text hierarchical output of the dependency tree is fine as well. The functionality can be further enhanced to provide an image file of the dependency tree, some thing like this

@stapelberg stapelberg self-assigned this Feb 15, 2018
stapelberg added a commit that referenced this issue Feb 15, 2018
@stapelberg
Copy link
Collaborator

Implemented the estimate command, which should do the trick. Leaving this issue open until -git_revision is supported. Issue #88 is a somewhat related usability improvement.

@rajudev
Copy link
Contributor Author

rajudev commented Feb 16, 2018

Like, already. I was planning to start working on this.

Anyways, it would have taken me ages. Glad you implemented it.
Will test the functionality in sometime.

@stapelberg
Copy link
Collaborator

dh-make-golang estimate github.com/jinzhu/gorm doesn’t list the test-only dependency github.com/erikstmartin/go-testdb (packaged in golang-github-erikstmartin-go-testdb-dev).

I think we’ll need to add TestImports and XTestImports to the go list template.

stapelberg added a commit that referenced this issue Mar 1, 2018
@rajudev
Copy link
Contributor Author

rajudev commented Apr 5, 2018

Is the go estimate <package-name> reliable for use now?
Also while estimating dependencies for a package.
I just got a list of packaged and un-packaged dependencies, instead of the tree graph that we planned.
A list just gets which packages are not yet done, without letting me know which package depends on what.
Am I missing something, or that is yet to be implemented.

@stapelberg
Copy link
Collaborator

The estimate command is ready to use.

Which package are you running this on that a tree is required instead of a list?

@rajudev
Copy link
Contributor Author

rajudev commented Apr 5, 2018

Well running it for http://github.com/zyedidia/micro
It has dependencies and dependencies has there own dependencies .
I have already determined the dependency tree manually. It is just that I am testing the estimate option if it could have saved me the manual work.

@rajudev
Copy link
Contributor Author

rajudev commented Apr 6, 2018

Using the estimate command complains for the digraph tool not being present.
May be we should add golang-golang-x-tools as a dependency for dh-make-golang in control.

rajudev@5658cb08429d:~/dev/salsa.debian.org$ dh-make-golang estimate github.com/Debian/dh-make-golang
/bin/sh: 1: digraph: not found
2018/04/06 05:27:50 [/bin/sh -c go list -f '{{.ImportPath}}{{.Imports}}{{.TestImports}}{{.XTestImports}}' ... | tr '[]' ' ' | digraph forward $(go list github.com/Debian/dh-make-golang/...)]: exit status 127

@stapelberg
Copy link
Collaborator

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=898396 is another example for a rather complicated dependency tree. We should likely display the tree as an indented list at least.

stapelberg added a commit that referenced this issue Jun 24, 2018
This removes the runtime dependency on digraph(1).

related to #89
@stapelberg
Copy link
Collaborator

Commit 55a1fa2 implements printing an indented tree. Hope that helps.

@rajudev
Copy link
Contributor Author

rajudev commented Jun 26, 2018

@stapelberg thanks a lot for all the work you have done for enabling this feature.
The indented lists is fine and it works nicely. I'll work on it in future to add support for tree style outputs.

@ramantehlan
Copy link

ramantehlan commented Apr 22, 2019

@rajudev @stapelberg
Hey, I just created this tool GoCheckDeb and golang package github.com/ramantehlan/GoCheckDeb/pkg/gocheckdeb/gocheckdeb.go to address this issue.

This package can return, Graph, Tree and List of Go project dependencies, with tags of whether it is packaged in Debian or not. It also has some other minor features which some people might like.

@eenagy
Copy link

eenagy commented Sep 2, 2023

I'm getting some errors around the estimate command with github.com/russross/blackfriday/v2

dh-make-golang estimate github.com/ethereum/go-ethereum
go get: 3.36 GiBpackage github.com/ethereum/go-ethereum/cmd/abigen: cannot find package "github.com/urfave/cli/v2" in any of:
	/usr/lib/go-1.19/src/github.com/urfave/cli/v2 (from $GOROOT)
	/tmp/dh-make-golang4192342632/src/github.com/urfave/cli/v2 (from $GOPATH)
go get: 3.37 GiBpackage github.com/ethereum/go-ethereum/cmd/abigen: cannot find package "github.com/golang-jwt/jwt/v4" in any of:
	/usr/lib/go-1.19/src/github.com/golang-jwt/jwt/v4 (from $GOROOT)
	/tmp/dh-make-golang4192342632/src/github.com/golang-jwt/jwt/v4 (from $GOPATH)
go get: 3.38 GiBpackage github.com/ethereum/go-ethereum/cmd/abigen
	imports github.com/influxdata/line-protocol: no Go files in /tmp/dh-make-golang4192342632/src/github.com/influxdata/line-protocol
go get: 3.74 GiBpackage github.com/ethereum/go-ethereum/cmd/abigen: cannot find package "github.com/flosch/pongo2/v4" in any of:
	/usr/lib/go-1.19/src/github.com/flosch/pongo2/v4 (from $GOROOT)
	/tmp/dh-make-golang4192342632/src/github.com/flosch/pongo2/v4 (from $GOPATH)
go get: 3.74 GiBpackage github.com/ethereum/go-ethereum/cmd/abigen: cannot find package "github.com/russross/blackfriday/v2" in any of:
	/usr/lib/go-1.19/src/github.com/russross/blackfriday/v2 (from $GOROOT)
	/tmp/dh-make-golang4192342632/src/github.com/russross/blackfriday/v2 (from $GOPATH)
2023/09/02 02:16:44 estimate: go get: exit status 1

@gibmat
Copy link
Member

gibmat commented Sep 2, 2023

See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1050523; it appears that something in go 1.21 has broken this, but I haven't dug into it very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants