-
Notifications
You must be signed in to change notification settings - Fork 735
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
Disable Serde's default-features #905
Conversation
5e25c01
to
046e52e
Compare
Seems I have some test failures to look into. I'll try to get these worked out tonight. |
Changing features makes this a breaking change, right? We are in the process of a big breaking release anyways but thought I'd flag it. |
046e52e
to
f18c42c
Compare
That is my understanding 👍 |
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.
ACK f18c42c8e51821d1e0d0c0f8fd7358f8e02d0002
Yes, this is a breaking change, but it's fine to bring into the RC.
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.
NACK: build is broken due to test dependency issues + possible undesirable side-effect of always having non-std serde even for std
builds
Sorry for the repeated test failures. I promise I am running |
There are probably some environment variables you need to set to get |
The test failures are actually caused by the lack of |
dd63987
to
9cc4844
Compare
I've reworked this PR to address comments, fix tests, and rebase onto master. Sorry for the delay (its been a busy week on other projects). Specifically, I added the |
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.
This doesn't look right, the feature is not used anywhere. Did you forget to commit some files?
The only place I am aware of that requires Keep in mind, any feature which enables |
Sorry, it looks like I was confused and you don't need |
Ok, I'll back out |
Also to address @dr-orlovsky concern: users needing |
2ed3175
to
fcbe52d
Compare
Oops I forgot to run the dep_test. I did have environment variables set to enable that test, but I must've cleared them before my last push 🤦. I forgot to explicitly add |
fcbe52d
to
29677df
Compare
Oh, shit. I got confused. For some reason the compatibility issue can't be triggered from normal To clean up my shit, I looked at it properly and found a proper solution. Wanted to make a PR against your repo but was unable to do so. Here are my changes: Kixunil@28bb060 Explanation: I started re-adding If you want to be super-pedantic and make the history nicer you could split it up into three commits (changing serde features, removing default impls, adding override) but I personally wouldn't block the PR if you don't want to. Suggested commit descriptions:
|
@Kixunil good finds! I like that approach. I am afk for several hours today, but I found the github setting to let others push commits to my PR. You should be able to push now. If not, I'll pull your changes in when I get a chance this evening. |
Cool, pushed! Do you want to do the squashing? |
Oh, shit, MSRV issues. Suggested solution: remove the optimization and Now I finally understand why |
Let's just wait for #964 |
We have #964 now -- can you rebase? |
28bb060
to
1541e14
Compare
Awesome. Done ✔️ |
Could you clean up the git history please? Ideally make it three commits: 1. the topic of this PR, 2. removing unneeded method impls, 2 adding the optimization. But I can accept squashing to a single commit. |
We do not need serde/std, only serde/alloc. Serde/std breaks no-std builds, but serde/alloc does not. Depending on serde/alloc is the more compatible approach, as the entire library already depends on alloc.
The default methods do the exact same thing thus our overrides are useless, potentially even problematic. Credit to Kixunil for this fix: rust-bitcoin#905 (comment)
This override may avoid allocation and thus make the deserialization faster. Credit to Kixunil for this fix: rust-bitcoin#905 (comment)
1541e14
to
76fcf81
Compare
@Kixunil good call. Done. Thanks for all your assistance! |
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.
Perfect, thanks!
ACK 76fcf81
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.
ACK 76fcf81
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.
ACK 76fcf81
The default methods do the exact same thing thus our overrides are useless, potentially even problematic. Credit to Kixunil for this fix: rust-bitcoin/rust-bitcoin#905 (comment)
This override may avoid allocation and thus make the deserialization faster. Credit to Kixunil for this fix: rust-bitcoin/rust-bitcoin#905 (comment)
76fcf81 Override default visit_byte_buf on Script (ass3rt) add100c Removed reimplementations of default methods (ass3rt) 7db03f2 Disable Serde's default-features (ass3rt) Pull request description: With this patch, existing users of the `use-serde` feature will no longer be compiling with `serde/std` enabled, but this allows dependent projects to import serde and enable `serde/alloc` as required by some no-std targets. ACKs for top commit: Kixunil: ACK 76fcf81 tcharding: ACK 76fcf81 apoelstra: ACK 76fcf81 Tree-SHA512: 5748e64e1f91f19dbfbf32bead6e6d759e448e92ed0dab731b3059f6b37bd811fad6654edc8fbd113e3be17fefaf9fc4912145d6b61484ced0517712361ecfdc
With this patch, existing users of the
use-serde
feature will no longer becompiling with
serde/std
enabled, but this allows dependent projectsto import serde and enable
serde/alloc
as required by some no-std targets.