-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add an Embedded dependency property #17
base: main
Are you sure you want to change the base?
Conversation
@@ -36,13 +36,21 @@ func main() { | |||
version := dep.Version | |||
|
|||
inst, _ := purl.FromString(fmt.Sprintf("pkg:%s/%s@%s", deplist.GetLanguageStr(dep.DepType), dep.Path, version)) | |||
fmt.Println(inst) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps instead of changing the output format for embedded dependencies we should add a command flag which indicates if we want embedded dependencies in the output of not? I think it would avoid the need to have special code in clients which for interrupting the output.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jasinner I could add a flag -modes
which accepts deps
, bundled
, or deps,bundled
and prints dependencies based on the mode. However, for the case where you print both "regular dependencies" and bundled code you do need anyway a way to differentiate them, don't you? Opinions @jasinner ? @sfowl was suggesting to have a JSON output instead.
Do we have clients that use the output mode of deplist?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are planning on using deplist in component-registry. Although the integration is not done yet.
I think for component-registry it would be nice to have json output and split deps and bundled into 2 groups.
@ret2libc Let's sync up on this offline. I'll put this in draft state for now. |
When possible differentiate between runtime dependencies and bundled code. By bundled code we can refer to copy-pasted code, vendored code (e.g. github, node_modules), copy-pasted code, webpacked, etc.
@@ -9,8 +9,6 @@ import ( | |||
func BelongsToIgnoreList(needle string) bool { | |||
switch needle { | |||
case | |||
"node_modules", | |||
"vendor", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, this could be dangerous, go list
traverses the go pkg graph to identify what packages are used by the code in the provided directory. I think we filtered out vendor/ because it's possible for code to be stored there that is not actually used by code in the rest of the repo, i.e. it does not make it into the built binaries. Two causes I think that can lead to this are an out-of-sync vendor dir or that vendor dir is populated by the go module graph, not the go pkg graph, which can be different.
EDIT: By default go list
also does not report test deps, however they will appear in vendor/
When possible (right now only for NodeJS) differentiate between actual
dependencies and embedded code that is actually included in the source
files.