-
Notifications
You must be signed in to change notification settings - Fork 18
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
Switch to tomling crate for reduced dependencies #56
base: master
Are you sure you want to change the base?
Conversation
3ec1e96
to
b5d4f89
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally I'm fine to switch. However, I have some questions before :)
- Did you make any compile time comparisons? What is the difference?
- How good is
tomling
tested? Did you run any tests against some larger set of toml files to ensure it doesn't crash etc?
.chain(dev_deps.into_iter().flat_map(|deps| deps.iter())) | ||
.collect::<Vec<_>>(); | ||
// Ensure renames (i-e deps with `package` key) are listed the last. | ||
deps.sort_by(|(_, a), (_, b)| match (a.package(), b.package()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because the using code relies on this. I added this after a test case was failing because it was getting the name rather than the rename (or was it the other way around? 🤔).
`tomling` crate was specifically created to provide a simple TOML parser with fewer dependencies and focus on Cargo.toml parsing. Fixes bkchr#37.
Fair. :)
Right now there is no noticeable difference tbh. However:
I understand completely if you'd like to wait till tomling brings real significant improvements before switching though.
So we've added the amazing
To save you some math, that's 70% coverage. Other than that, we also have fuzzing enabled (which is why I'm fairly confident we don't crash on any input) and some other test cases based on real world Cago.toml files (currently zbus and tokio). The test case of Again, if you'd like to wait for full spec compliance, I understand completely. |
I mean this crate should compile faster? That being the entire point of using a slimmer dependency? |
It should, yes. :) However, at the moment, it doesn't for the reasons I mentioned. As I wrote, I understand if you want to wait till that is the case before merging. I'm hopeful it will still be soon.
My impression was that it was mainly about the binary size (at least for me that was the only motivation) but yeah, this would be one of the 2 benefits in the end. Another benefit would be "perceived" compile speed. People often look at the number of deps being downloaded, instead of actual compile time to judge Rust projects. It's super silly, I know but it is what it is. 🤷 Anyway, let me know if you want to wait. |
tomling
crate was specifically created to provide a simple TOML parser with fewer dependencies and focus on Cargo.toml parsing.Fixes #37.
Creating a draft PR first to get some input before I roll out the tomling release and then switching to released version in this PR.