Skip to content

Conversation

@nresare
Copy link
Contributor

@nresare nresare commented Aug 10, 2025

This change moves most of the functionality in main.rs to lib.rs and makes main() call it from there. The effect is that the functionality of this crate is available as a library crate as well as built into a binary.

Unfortunately, the github review UI does not make this super easy to review. I found it the easiest to review this by checking out the project twice and manually diff main.rs from origin/main against lib.rs in the head branch. Briefly, the change consists of updating the signature of run() to take args as an argument, and making relevant structs publicly visible.

The reason why I'm looking for this change is that I'm working with some code to build the source files needed to create policy compliant sources files for deb packages for Ubuntu, and with this change I can pull in the vendor-filterer functionality without needing to have separate instructions on how to install the tool.

There are some usability changes that would be useful that I would be interested in contributing as follow-up PRs if you are interested in merging this change, moving the parsing of Cargo.toml config values out of the path of execution when using it as a library comes to mind, but I would not want to make this change bigger than it already is, and I would like to hear some about how you feel about landing this before I go through the work of making those changes

This change moves most of the functionality in main.rs to lib.rs and
makes main() call it from there. The effect is that the functionality
of this crate is available as a library crate as well as built into
a binary.
Copy link
Member

@cgwalters cgwalters left a comment

Choose a reason for hiding this comment

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

Thanks for this PR! Sorry for the delay in review. This makes sense to me overall...I just want to do a bit more sanity checking before merging.

@cgwalters cgwalters enabled auto-merge (squash) September 5, 2025 19:34
@cgwalters cgwalters merged commit 6f42524 into coreos:main Sep 5, 2025
6 checks passed
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.

2 participants