Skip to content
This repository has been archived by the owner on Sep 18, 2023. It is now read-only.

feat(add-rust-support): Added Rust support #129

Merged
merged 1 commit into from
Aug 7, 2023
Merged

Conversation

qtpeters
Copy link
Contributor

@qtpeters qtpeters commented Jul 31, 2023

Summary

image This PR should go in after feat(purl-generation): Syft Service now creates a well formed, sensible purl for the Package #124

Added support for projects containing a Cargo.lock file

Added

  • The ability for the GitHub SBOM Ingest Provider to produce SBOMs when a Cargo.lock file is found
  • New GitHub repo in the harbor-test-org. This Repo has a Cargo.lock file to allow SBOM creation with the
    Rust cataloger: https://github.com/harbor-test-org/rust-repo-with-cargo-lock

Changed

.gitignore no longer ignores the Cago.lock file and the Cargo.lock file is checked in. At this time the Cargo.lock file is about ~86k and the cargo book supports checking in the lock file if the project generates an app rather than a library.

If you’re building a non-end product, such as a rust library that other rust [packages](https://doc.rust-lang.org/cargo/appendix/glossary.html#package) will depend on, put Cargo.lock in your .gitignore. If you’re building an end product, which are executable like command-line tool or an application, or a system library with crate-type of staticlib or cdylib, check Cargo.lock into git.

https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html

How to test

  1. Initialize test environment
  2. Run cargo test commands::ingest::github::test::execute_on_harbor_test_org
  3. Open Compass, select the Package collection and apply this filter: { kind: "primary", purl: /cargo/ }
  4. Ensure a single document with the purl: pkg:cargo/harbor-test-org/rust-repo-with-cargo-lock@d0.0.0 exists

@qtpeters qtpeters changed the title Add rust support feat(add-rust-support): Added rust support Jul 31, 2023
@qtpeters qtpeters self-assigned this Jul 31, 2023
@qtpeters qtpeters changed the title feat(add-rust-support): Added rust support feat(add-rust-support): Added Rust support Jul 31, 2023
@qtpeters qtpeters linked an issue Aug 3, 2023 that may be closed by this pull request
Copy link
Contributor

@DerekStrickland DerekStrickland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All tests passed.

@qtpeters qtpeters merged commit 1642e8c into main Aug 7, 2023
3 checks passed
@qtpeters qtpeters deleted the add-rust-support branch August 7, 2023 15:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Rust support to GitHub SBOM Provider
2 participants