-
Notifications
You must be signed in to change notification settings - Fork 755
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
Remove schemars
pin from manifest
#1696
Conversation
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 it does not take into account the version of
cargo
in use.
That's not right, version of cargo is irrelevant. The reason it's wrong is if a different crate requires higher version those will be incompatible leading to at best duplication, at worst impossibility to compile.
You also need |
I didn't see this before opening #1697. But:
So I dunno, maybe the pin was correct. |
Cool, thanks for the explanation. |
8ea5bec
to
9c8a855
Compare
I discovered this too but the versions of |
196fcc3
to
a970c72
Compare
The new README text is kinda misleading. You do need to pin schemars ... but this has nothing to do with the MSRV. For the MSRV you just need to pin url and formurll_encoded. |
I'm a bit confused then, rust-bitcoin
extended_tests/schemars_test
|
a970c72
to
be68ee0
Compare
The answer doesn't matter really, I could have easily made a mistake while checking every combination I could think of. I changed |
@tcharding to use 1.41.1 you need to pin To use schemars at all you need to pin |
Do you mean the test failure after doing the following?
I printed the error:
If I understand it correctly the type is OK, just |
Yes, I mean that test failure. I wasn't able to print the error because somehow nothing returned by the failing |
The schema generated is wrong because Can be easily solved by: #[cfg(feature = "schemars")]
impl<T: Tag> actual_schemars::JsonSchema for Hash<T> {
fn schema_name() -> String {
"Hash".to_owned()
}
fn json_schema(gen: &mut actual_schemars::gen::SchemaGenerator) -> actual_schemars::schema::Schema {
crate::util::json_hex_string::len_32(gen)
}
}
I think its better to unpin it and every other dependency and just pin using I think that's true for other distros that provide only a single version of a package instead of including all of the minor versions needed. |
That would also effectively remove the need to pin other crates that we don't use directly in the |
hashes/Cargo.toml
Outdated
# because 1.0.8 does not build with Rust 1.41.1 (because of useage of `Arc::as_ptr`). | ||
dyn-clone = { version = "<=1.0.7", default_features = false, optional = true } |
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.
If schemars if being unpinned this should be too IMO, by removing it completely, should allow for #1696 (comment)
@jeandudey thanks for the fix! We are all onboard with removing pins (all of them). The issue is that nobody besides you in this conversation has ever actually used schemars, the person who originally advocated for its inclusion is no longer working on it, and they evidently made some breaking change between 0.8.3 and 0.8.4 which is causing our only test case to break. |
ffee8ad Bump version to v0.30.0 (Tobin C. Harding) Pull request description: Add changelog notes and bump the version number to v0.30.0. ## TODO - pre-merge - [x] Release `bitcoin_hashes` 0.12: #1694 - [x] Release secp 0.27: rust-bitcoin/rust-secp256k1#588 - rust-bitcoin/rust-secp256k1#590 - [x] Update `secp256k1` dependency to use newly released v0.27: #1714 - [x] Merge - ~#1696 - #1695 - #1111 - [x] If time permits merge these: - #1710 - #1705 - #1713 - [x] Set the release date in changelog header - [x] And merge these: - #1721 - #1720 - #1719 - #1717 ## TODO - post release - [ ] Release the blogpost: rust-bitcoin/www.rust-bitcoin.org#2 - ~Set the date in the blog post to match the date 0.30 is released~ ACKs for top commit: sanket1729: reACK ffee8ad Kixunil: ACK ffee8ad apoelstra: ACK ffee8ad Tree-SHA512: b0ea113ee1726fd9b263d0e01fe14bd544c007c05a9ac43b6c2d4edbeef3bb3ad456b061ef086626e1e1b27a0cda49cb6bc28aac3ad1691d72ffe00400ed5b45
Implemented all review suggestions, thanks crew. |
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 d02a984a1906fd5175e0e7eed7e54e0fed2d554f
hashes/contrib/test.sh
Outdated
@@ -1,4 +1,4 @@ | |||
#!/bin/sh | |||
#!/bin/bash |
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 should be /usr/bin/env bash
. Not all systems have bash
in /bin
.
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.
Sure thing, can do.
hashes/contrib/test.sh
Outdated
(cd extended_tests/schemars && cargo test) | ||
pushd "$REPO_DIR/hashes/extended_tests/schemars" > /dev/null | ||
cargo test | ||
popd |
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.
In d02a984a1906fd5175e0e7eed7e54e0fed2d554f:
May want to redirect popd
to null as well if you're redirecting pushd
.
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 the redirect to null, FTR on my system popd
does not output anything anyways. Are there different implementations of popd
that do?
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.
Interesting. On my system popd
also outputs the directory that it's changing to. I have bash 5.1. Maybe this is an obscure setting somewhere.
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.
derrrr me no Linux - I'm using zsh as my shell.
Done reviewing d02a984a1906fd5175e0e7eed7e54e0fed2d554f. Looks good, but I would like the shebang to be fixed. |
d02a984
to
5d29cd6
Compare
Fixed shebang and added redirect as requested. No other changes. |
The derived implementation of `JsonSchema` recently stopped working as described here: rust-bitcoin#1696 (comment) Implement the suggestion.
5d29cd6
to
9043c55
Compare
Please see PR description for what is in the last force push. Don't be surprised If I've confused you, I confused myself there for a bit. |
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 5d29cd6daeda258b4f7ac999aac40d8ff72c2358
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.
Not sure if I should ACK, am I developing OCD?
@@ -17,6 +17,12 @@ if cargo --version | grep nightly >/dev/null; then | |||
NIGHTLY=true | |||
fi | |||
|
|||
# Pin dependencies as required if we are using MSRV toolchain. | |||
if cargo --version | grep "1\.48"; then |
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.
Some sort of version comparison would be nice. sort
can compare versions, so this hack should work:
if "$(echo -e "$(cargo | cut -d ' ' -f 2)"'\n1.48.0' | sort -V | tail -n 1)" = "1.48.0"; then
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 agree, but I don't think it belongs in this PR -- in a future thing we should maybe try to rewrite this script entirely to clean it up (though I think it's mostly in good shape) and to make it easier/more intuitive to run locally.
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, I didn't ACK because of the attribute.
I don't follow - this is a feature guard, nothing to do with docs? EDIT: Ignore this comment by me, I was confused. |
Done as is single patch to make sure all the docs and CI are in sync and correct. We currently pin the `schemars` dependency using `<=0.8.3` as well as a the `dyn-clone` transient dependency in the manifest (`hashes` and the extended test crate). This is incorrect because it makes usage of the crate klunky (or possibly impossible) if downstream users wish to use a later version of `schemars`. Observe also that we do not have to pin `schemars`, we do however have to pin the `serde` crate if either `serde` or `schemars` features are enabled. Do so in CI and document in the readme file within hashes. Currently we have a pin remaining from the old MSRV (`syn` due to use of `matches!`). Fix pinning by: - Remove pin in manifest for `schemars` - Fix pinning for MSRV in CI and docs (this includes documenting pinning requirements for `schemars` feature because it is related to the other pin of `serde`) in both `hashes` readme and main repo readme.
9043c55
to
6c61e10
Compare
Is there a reason for you not ack'ing this one @Kixunil? Force push is to fix multiple types |
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 6c61e10
To run the tests with the MSRV you will need to pin some dependencies: | ||
|
||
- `cargo update -p serde --precise 1.0.156` | ||
- `cargo update -p syn --precise 1.0.107` |
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 think this isn't needed anymore?
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'm unsure. The serde
line definitely is, but syn
you may be right that we can drop. In any case, can wait for a followup PR.
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.
Verified, we no longer need the syn
pin. Will do as follow up because this PR is blocking other work. Thanks
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.
Yep, that's what I meant.
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 6c61e10
53d75c7 extended_tests: Remove stale docs (Tobin C. Harding) Pull request description: We no longer need to pin `syn`; remove stale docs. This is a follow up to #1696 ACKs for top commit: Kixunil: ACK 53d75c7 apoelstra: ACK 53d75c7 Tree-SHA512: 9e939860cfb3731942e92a611632f0b24acc88e06a96e905ee2ae50e489d1610f7b9c79e20384196482aad4d5da182f6f919d18726e079a98a667532806d5aae
This has grown due to now including pinning work also done in #1736, I decided to do this because the PRs conflict and doing it all here saves accidentally getting out of sync. And #1764 requires this PR.
schemars
- phew.Fix: #1687