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

Add an Embedded dependency property #17

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ret2libc
Copy link
Collaborator

When possible (right now only for NodeJS) differentiate between actual
dependencies and embedded code that is actually included in the source
files.

@@ -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)

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.

Copy link
Collaborator Author

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?

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.

@sfowl
Copy link
Collaborator

sfowl commented May 26, 2022

@ret2libc Let's sync up on this offline. I'll put this in draft state for now.

@sfowl sfowl marked this pull request as draft May 26, 2022 01:30
Riccardo Schirone and others added 2 commits July 13, 2022 10:17
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",
Copy link
Collaborator

@sfowl sfowl Jul 13, 2022

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/

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

Successfully merging this pull request may close these issues.

3 participants