Skip to content

make alloc and serde compilation more robust #473

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

joseluis
Copy link

@joseluis joseluis commented Apr 28, 2025

This fixes compilation that didn't succeed before like this:

cargo b --features serde,alloc --no-default-features

And by auto-enabling alloc with serde it now works also like this:

cargo b --features serde --no-default-features

And it keeps working as before, like this:

cargo b
cargo b --features serde
cargo b --no-default-features

@joseluis joseluis marked this pull request as draft April 28, 2025 10:21
Copy link

codecov bot commented Apr 28, 2025

Codecov Report

Attention: Patch coverage is 85.71429% with 1 line in your changes missing coverage. Please review.

Project coverage is 99.35%. Comparing base (372c19b) to head (21f6f38).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/hazardous/kdf/argon2i.rs 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #473      +/-   ##
==========================================
- Coverage   99.37%   99.35%   -0.02%     
==========================================
  Files         106      106              
  Lines       21677    21677              
==========================================
- Hits        21541    21538       -3     
- Misses        136      139       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@joseluis joseluis marked this pull request as ready for review April 28, 2025 18:44
Copy link
Member

@brycx brycx left a comment

Choose a reason for hiding this comment

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

Thank you, @joseluis!

This looks good to me and I don't think the change should pose any issues, especially since the serde dependency itself uses alloc when default-features are disabled.

It think we should add this to the test-suite in test.yml, to make sure this feature-combination won't regress in the future. Could I bother you to add this, @joseluis? If not that's totally fine - I'll merge this later and add it myself.

- automatically enable the `alloc` feauure when enabling `serde`.
- re-export `std` as `alloc` as well for greater compatibility.
- remove obsolete `macro_use` attribute in current edition.
- depend `core` instead of `std` when possible.
- use the full paths for `alloc` items.
- update the CI test suite.
@joseluis joseluis force-pushed the feat-alloc-serde branch from 6ae3371 to 21f6f38 Compare May 1, 2025 14:48
@joseluis
Copy link
Author

joseluis commented May 1, 2025

I'm glad you like it. I've added it to the CI test suite.

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