-
Notifications
You must be signed in to change notification settings - Fork 857
Improve support for cataloging nix package relationships #3837
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
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
b76c853
add nix DB cataloger
wagoodman e8b3887
add derivation path to nix store pkg metadata
wagoodman 6a942d3
go mod tidy
wagoodman fef39eb
allow for derivation path to be optional
wagoodman 648332c
repin build image and disable syscall filtering
wagoodman c3aa6d4
bump storage capacity
wagoodman 49bb0cd
track nix derivation details on packages
wagoodman 5b691b1
image fixture should have derivation examples
wagoodman e11224b
Merge remote-tracking branch 'origin/main' into improve-nix
wagoodman 681a41a
address comments
wagoodman 944906c
Merge remote-tracking branch 'origin/main' into improve-nix
wagoodman 6ebaa69
Merge remote-tracking branch 'origin/main' into improve-nix
wagoodman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| package options | ||
|
|
||
| import ( | ||
| "github.com/anchore/clio" | ||
| "github.com/anchore/syft/syft/pkg/cataloger/nix" | ||
| ) | ||
|
|
||
| type nixConfig struct { | ||
| CaptureOwnedFiles bool `json:"capture-owned-files" yaml:"capture-owned-files" mapstructure:"capture-owned-files"` | ||
| } | ||
|
|
||
| func defaultNixConfig() nixConfig { | ||
| def := nix.DefaultConfig() | ||
| return nixConfig{ | ||
| def.CaptureOwnedFiles, | ||
| } | ||
| } | ||
|
|
||
| var _ interface { | ||
| clio.FieldDescriber | ||
| } = (*nixConfig)(nil) | ||
|
|
||
| func (o *nixConfig) DescribeFields(descriptions clio.FieldDescriptionSet) { | ||
| descriptions.Add(&o.CaptureOwnedFiles, `enumerate all files owned by packages found within Nix store paths`) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Is this concerning? Is there something else we should do to limit/reduce the overall test resources used?
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.
yeah, I tried to limit these test fixtures, but it seems like when you're working with nix and building anything you'll need at least
nixos/nix(or install withhttps://nixos.org/nix/install) which seems to be ~650MB right out of the door with no alterations. I'm adding jq and sqlite on top of it which seems to make the image swell to ~850MB... which is why I make these a multistage image so it's reduced to ~40MB.But yeah, I'm a little concerned, we are getting up there in terms of disk usage for these fixtures (not including whats pulled down to build them):
I don't think I have an answer within the scope of this PR though.
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.
It looks like tests didn't kick off the last commit on this PR, I hope this isn't due to some resource constraints on the larger runners.