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

feat: retain go package info when no module declared #1632

Merged
merged 3 commits into from
Mar 1, 2023

Conversation

westonsteimel
Copy link
Contributor

If there is at least a path declared, construct a main module from that and retain all of the other information we can, build flags, etc rather than dropping them entirely from the sbom

Signed-off-by: Weston Steimel <weston.steimel@anchore.com>
@github-actions
Copy link

github-actions bot commented Feb 28, 2023

Benchmark Test Results

Benchmark results from the latest changes vs base branch
goos: linux
goarch: amd64
pkg: github.com/anchore/syft/test/integration
cpu: Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz
                                                          │ ./.tmp/benchmark-f909cce.txt │
                                                          │            sec/op            │
ImagePackageCatalogers/alpmdb-cataloger-2                                   14.08m ±  2%
ImagePackageCatalogers/ruby-gemspec-cataloger-2                             1.159m ± 16%
ImagePackageCatalogers/python-package-cataloger-2                           4.074m ±  6%
ImagePackageCatalogers/php-composer-installed-cataloger-2                   888.8µ ±  5%
ImagePackageCatalogers/javascript-package-cataloger-2                       491.1µ ±  3%
ImagePackageCatalogers/dpkgdb-cataloger-2                                   695.7µ ±  7%
ImagePackageCatalogers/rpm-db-cataloger-2                                   688.9µ ±  4%
ImagePackageCatalogers/java-cataloger-2                                     13.50m ±  4%
ImagePackageCatalogers/graalvm-native-image-cataloger-2                     9.872µ ±  3%
ImagePackageCatalogers/apkdb-cataloger-2                                    1.175m ±  1%
ImagePackageCatalogers/go-module-binary-cataloger-2                         22.15µ ±  2%
ImagePackageCatalogers/dotnet-deps-cataloger-2                              1.204m ±  6%
ImagePackageCatalogers/portage-cataloger-2                                  425.8µ ±  3%
ImagePackageCatalogers/sbom-cataloger-2                                     128.5µ ±  4%
ImagePackageCatalogers/binary-cataloger-2                                   177.1µ ±  3%
geomean                                                                     607.2µ

                                                          │ ./.tmp/benchmark-f909cce.txt │
                                                          │             B/op             │
ImagePackageCatalogers/alpmdb-cataloger-2                                   5.061Mi ± 0%
ImagePackageCatalogers/ruby-gemspec-cataloger-2                             141.6Ki ± 0%
ImagePackageCatalogers/python-package-cataloger-2                           946.8Ki ± 0%
ImagePackageCatalogers/php-composer-installed-cataloger-2                   155.8Ki ± 0%
ImagePackageCatalogers/javascript-package-cataloger-2                       95.48Ki ± 0%
ImagePackageCatalogers/dpkgdb-cataloger-2                                   144.6Ki ± 0%
ImagePackageCatalogers/rpm-db-cataloger-2                                   170.1Ki ± 0%
ImagePackageCatalogers/java-cataloger-2                                     2.721Mi ± 0%
ImagePackageCatalogers/graalvm-native-image-cataloger-2                     1.523Ki ± 0%
ImagePackageCatalogers/apkdb-cataloger-2                                    232.0Ki ± 0%
ImagePackageCatalogers/go-module-binary-cataloger-2                         3.102Ki ± 0%
ImagePackageCatalogers/dotnet-deps-cataloger-2                              314.2Ki ± 0%
ImagePackageCatalogers/portage-cataloger-2                                  75.40Ki ± 0%
ImagePackageCatalogers/sbom-cataloger-2                                     13.02Ki ± 0%
ImagePackageCatalogers/binary-cataloger-2                                   21.15Ki ± 0%
geomean                                                                     111.4Ki

                                                          │ ./.tmp/benchmark-f909cce.txt │
                                                          │          allocs/op           │
ImagePackageCatalogers/alpmdb-cataloger-2                                    86.71k ± 0%
ImagePackageCatalogers/ruby-gemspec-cataloger-2                              2.159k ± 0%
ImagePackageCatalogers/python-package-cataloger-2                            15.48k ± 0%
ImagePackageCatalogers/php-composer-installed-cataloger-2                    3.457k ± 0%
ImagePackageCatalogers/javascript-package-cataloger-2                        1.252k ± 0%
ImagePackageCatalogers/dpkgdb-cataloger-2                                    2.646k ± 0%
ImagePackageCatalogers/rpm-db-cataloger-2                                    3.759k ± 0%
ImagePackageCatalogers/java-cataloger-2                                      38.26k ± 0%
ImagePackageCatalogers/graalvm-native-image-cataloger-2                       40.00 ± 0%
ImagePackageCatalogers/apkdb-cataloger-2                                     5.573k ± 0%
ImagePackageCatalogers/go-module-binary-cataloger-2                           101.0 ± 0%
ImagePackageCatalogers/dotnet-deps-cataloger-2                               5.011k ± 0%
ImagePackageCatalogers/portage-cataloger-2                                   1.487k ± 0%
ImagePackageCatalogers/sbom-cataloger-2                                       392.0 ± 0%
ImagePackageCatalogers/binary-cataloger-2                                     649.0 ± 0%
geomean                                                                      2.259k

Signed-off-by: Weston Steimel <weston.steimel@anchore.com>
@westonsteimel westonsteimel requested a review from a team February 28, 2023 13:48
Signed-off-by: Weston Steimel <weston.steimel@anchore.com>
@westonsteimel westonsteimel merged commit bcc0751 into main Mar 1, 2023
@westonsteimel westonsteimel deleted the go-cataloger-no-deps branch March 1, 2023 14:26
@kzantow kzantow added the enhancement New feature or request label Mar 2, 2023
GijsCalis pushed a commit to GijsCalis/syft that referenced this pull request Feb 19, 2024
Signed-off-by: Weston Steimel <weston.steimel@anchore.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants