Skip to content
This repository was archived by the owner on Nov 30, 2022. It is now read-only.

Commit edddddc

Browse files
committed
Remove schemars pinning
Pinning was introduced using `<=` in the version number for `schemars` and `dyn-clone`, we would prefer to use pinning by way of the `cargo update -p`. - Remove the pinning from `Cargo.toml`. - Add pinning to CI - Document pinning in readme
1 parent 9815a4c commit edddddc

File tree

5 files changed

+35
-8
lines changed

5 files changed

+35
-8
lines changed

Cargo.toml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ edition = "2018"
1414
[features]
1515
default = ["std"]
1616
std = []
17-
schemars = ["actual-schemars", "dyn-clone"]
17+
schemars = ["actual-schemars"]
1818
# If you disable std, you can still use a Write trait via the core2 feature.
1919
# You can also use ToHex via the alloc feature, as it requires Vec/String.
2020
# And you can still just disable std by disabling default features, without enabling these two.
@@ -28,10 +28,7 @@ serde = { version = "1.0", default-features = false, optional = true }
2828
core2 = { version = "0.3.0", optional = true, default_features = false }
2929

3030
# Do NOT use this as a feature! Use the `schemars` feature instead. Can only be used with "std" enabled.
31-
actual-schemars = { package = "schemars", version = "<=0.8.3", optional = true }
32-
# Do NOT enable this dependency, this is just to pin dyn-clone (transitive dep from schemars)
33-
# because 1.0.8 does not build with Rust 1.41.1 (because of useage of `Arc::as_ptr`).
34-
dyn-clone = { version = "<=1.0.7", default_features = false, optional = true }
31+
actual-schemars = { package = "schemars", version = "0.8.3", optional = true }
3532

3633
[dev-dependencies]
3734
serde_test = "1.0"

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@ This library should always compile with any combination of features on **Rust 1.
1515
The one exception is the `schemars` feature which has no MSRV and should not be used
1616
by users who expect stability from their libraries.
1717

18+
### Dependency pinning
19+
20+
Some dependencies break the MSRV build (only when building with `schemars` feature), to build with
21+
Rust 1.41.1 you may need to pin as follows:
22+
```bash
23+
24+
cargo update --package schemars --precise 0.8.3
25+
cargo update --package dyn-clone --precise 1.0.7
26+
```
27+
1828
## Contributions
1929

2030
Contributions are welcome, including additional hash function implementations.

contrib/test.sh

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,22 @@ fi
1818
# Make all cargo invocations verbose
1919
export CARGO_TERM_VERBOSE=true
2020

21+
# Pin if using MSRV toolchain.
22+
REQUIRE_VERSION_PINNING=false
23+
if cargo --version | grep "cargo 1\.41"; then
24+
REQUIRE_VERSION_PINNING=true
25+
fi
26+
2127
# Defaults / sanity checks
2228
cargo build --all
2329
cargo test --all
2430

31+
32+
if [ "$REQUIRE_VERSION_PINNING" = true ]; then
33+
cargo update --package schemars --precise 0.8.3
34+
cargo update --package dyn-clone --precise 1.0.7
35+
fi
36+
2537
if [ "$DO_FEATURE_MATRIX" = true ]; then
2638
cargo build --all --no-default-features
2739
cargo test --all --no-default-features
@@ -46,7 +58,15 @@ if [ "$DO_FEATURE_MATRIX" = true ]; then
4658
fi
4759

4860
if [ "$DO_SCHEMARS_TESTS" = true ]; then
49-
(cd extended_tests/schemars && cargo test)
61+
(
62+
cd extended_tests/schemar
63+
if [ "$REQUIRE_VERSION_PINNING" = true ]; then
64+
cargo update --package schemars --precise 0.8.3
65+
cargo update --package dyn-clone --precise 1.0.7
66+
fi
67+
68+
cargo test
69+
)
5070
fi
5171

5272
# Build the docs if told to (this only works with the nightly toolchain)

extended_tests/schemars/Cargo.toml renamed to extended_tests/schemar/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "schemars"
2+
name = "schemar"
33
version = "0.1.0"
44
authors = ["Jeremy Rubin <[email protected]>"]
55
edition = "2018"
@@ -12,6 +12,6 @@ features = ['schemars', 'serde']
1212
[dependencies]
1313
jsonschema-valid = "^0.4.0"
1414
serde = { version = "1.0", default-features = false}
15-
schemars = { version = "<=0.8.3"}
15+
schemars = { version = "0.8.3"}
1616
serde_test = "1.0"
1717
serde_json = "1.0"

0 commit comments

Comments
 (0)