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

avoid using std feature in rust_decimal #19

Merged
merged 1 commit into from
Jun 18, 2024

Conversation

droundy
Copy link
Contributor

@droundy droundy commented Jun 17, 2024

This reduces the number of dependencies, and cargo check and cargo test still run fine.

It came up because I was setting up cargo vet in my code, and was surprised to see rkyv in our list of dependencies. It'll be nice to have fewer dependencies to audit, and rkyv would be a particularly hefty crate to audit.

Of course, it's also nice for compile times to avoid depending on so many crates.

@Ten0
Copy link
Owner

Ten0 commented Jun 18, 2024

It seems to be incorrect that rkyv is enabled by rust_decimal if the rust_decimal/std feature is enabled.
It's only enabled if the rust_decimal/rkyv feature is also enabled.
Note the presence of the ? here (documentation).
It gets resolved in the Cargo.lock for some reason, but cargo check will not compile it, nor does it appear in cargo tree.

The fact it appears in Cargo.lock here but not if the std feature is not enabled seems to be more a Rust issue: I don't think it should be resolved there...
I'd guess that's probably a hack on their end to enable the feature conditionally on the crate being a dep of something else.

It's also probably an issue at cargo vet: it probably shouldn't complain about something that doesn't appear in cargo tree.

The rationale behind enabling this feature was:

  • serde_avro_fast requires std anyway, so let's just not restrict access to all functions or compilation paths that require std to work
  • Since rust_decimal has this feature enabled by default I felt like this would reduce the odds of random breakage (if they make a mistake)

@Ten0 Ten0 merged commit 0e29b8f into Ten0:master Jun 18, 2024
4 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.

None yet

2 participants