-
Notifications
You must be signed in to change notification settings - Fork 137
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
Fix inference conflict with serde_json
through schemars
feature
#733
Merged
ratmice
merged 8 commits into
linebender:main
from
ratmice:schemars_serde_json_type_inference_issue
Nov 9, 2024
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
a6fc15a
Cause ci to trigger the kurbo/schemars feature in with_winit
ratmice 3d09ae3
Add type annotations needed with kurbo schemars feature
ratmice 9aa58a8
rustfmt
ratmice 5bb5258
use u32::try_from instead
ratmice 049892c
Add comment on kurbo version syncing in root Cargo.toml
ratmice ac97f1e
Add test for schemars
ratmice 9d04706
Update examples/with_winit/src/lib.rs
ratmice ce4b8fe
Remove schemars dep, fix imports
ratmice File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I don't think this is used
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.
It is required by the addtion of
kurbo = { workspace = true, optional = true }
in with_winit/Cargo.tomlwithout that it gets the following:
We could I suppose specify 0.11.1 in
with_winit
rather than picking it up from the workspace,but the two versions (the one inherited through peniko, and the one specified explicitly) need to be kept in sync
to trigger the error (at least that is my belief, until a time where we have the feature supported in peniko itself).
So a bit oddly neither i with_winit or in the root Cargo.toml is perhaps an ideal place for it.
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.
Yeah, this is just my mistake. I misunderstood the context of this change
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.
Perhaps at the very least we could add a comment specifying that the kurbo line can be removed once peniko supports the schemars feature and needs to be kept in sync with the version of kurbo used by peniko?
Edit: Added in 049892c
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.
It might also work to use a
"*"
version, but I don't have a good intuition about whether that will do what you want; it might be worth having a#[test]
when the hidden feature is enabled which validates that the Peniko and Kurbo versions are compatible.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.
Adding a
#[test]
definitely sounds like a good idea, will do.I don't have a good intuition about whether a "*" version will do the right thing either though.
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.
I added that #[test] in ac97f1e, I don't think it will automagically run during ci.
but at the very least you can do so manually with
cargo test --features _ci_dep_features_to_test
That said I did try to take care that the test doesn't actually require initializing gpu, etc.
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.
Hmm would it not be automatically run in CI? It seems to be in your latest commit:
https://github.com/linebender/vello/actions/runs/11730274415/job/32677779520#step:7:159
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.
Well, I guess the following is enough for this test, since all we need to test is that it compiles.
cargo clippy --tests --benches --examples --locked --no-default-features --features _ci_dep_features_to_test -- -D warnings
But these appear to be running running clippy, not actually running any test target, that said I think it is sufficient? I had originally missed that it was actually running with the
--tests
, so had assumed it wasn't compiling them either.