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

Split CLI binary from the library crate #58

Merged
merged 1 commit into from
Sep 3, 2023

Conversation

oshevtsov
Copy link
Contributor

I am using rsgen-avro at work for Rust code generation based on Avro schema files. The application we are building is for an IoT system that is run on a custom Yocto linux build. We are using rsgen-avro as a library (we do not use the generated CLI binary). The issue with the rsgen-avro>=0.12.0 is the dependency on clap@4. Since the latter installs the most recent version, which is [email protected] as of today, it requires at least Rust 1.70 to compile. Unfortunately, the latest supported Rust version on Yocto today is 1.68 (see [1] and [2]).

With the current structure of the package, we are stuck on [email protected] until Yocto project supports at least Rust 1.70. We would greatly benefit from using the latest version, rsgen-avro>=0.12.2, but this requires modifying slightly the package structure.

With this change I propose to split the binary generation from the library crate using a feature flag. One can still generate the binary, if needed (and it will be done by the CI/CD pipeline), but the benefit is that the library crate does not depend on clap@4 and therefore any other package that uses rsgen-avro as a library skips installing clap as dependency.

[1] https://docs.yoctoproject.org/dev/migration-guides/release-notes-4.2.html
[2] https://wiki.yoctoproject.org/wiki/Releases

@lerouxrgd
Copy link
Owner

That's a good point, thanks for the careful fix !

@lerouxrgd lerouxrgd merged commit 23e698d into lerouxrgd:master Sep 3, 2023
2 checks passed
@oshevtsov oshevtsov deleted the split-cli-binary-from-lib branch September 4, 2023 03:15
@oshevtsov
Copy link
Contributor Author

Thank you for looking at this and the great library 🙂

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