diff --git a/Cargo.toml b/Cargo.toml index 9a47b87..7632645 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,7 @@ edition = "2018" [features] default = ["std"] std = [] -schemars = ["actual-schemars", "dyn-clone"] +schemars = ["actual-schemars"] # If you disable std, you can still use a Write trait via the core2 feature. # You can also use ToHex via the alloc feature, as it requires Vec/String. # And you can still just disable std by disabling default features, without enabling these two. @@ -29,10 +29,7 @@ serde = { version = "1.0", default-features = false, optional = true } core2 = { version = "0.3.0", optional = true, default_features = false } # Do NOT use this as a feature! Use the `schemars` feature instead. Can only be used with "std" enabled. -actual-schemars = { package = "schemars", version = "<=0.8.3", optional = true } -# Do NOT enable this dependency, this is just to pin dyn-clone (transitive dep from schemars) -# 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 } +actual-schemars = { package = "schemars", version = "0.8.3", optional = true } [dev-dependencies] serde_test = "1.0" diff --git a/README.md b/README.md index 14ded38..391e198 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,16 @@ since these are needed to display hashes anway. This library should always compile with any combination of features on **Rust 1.41.1**. +### Dependency pinning + +Some dependencies break the MSRV build (only when building with `schemars` feature), to build with +Rust 1.41.1 you need to pin as follows: +```bash + + cargo update --package schemars --precise 0.8.3 + cargo update --package dyn-clone --precise 1.0.7 +``` + ## Contributions Contributions are welcome, including additional hash function implementations. diff --git a/contrib/test.sh b/contrib/test.sh index 6bda67b..11e369f 100755 --- a/contrib/test.sh +++ b/contrib/test.sh @@ -16,6 +16,12 @@ export CARGO_TERM_VERBOSE=true cargo build --all cargo test --all +# Pin if using MSRV toolchain. +if cargo --version | grep "cargo 1\.41"; then + cargo update --package schemars --precise 0.8.3 + cargo update --package dyn-clone --precise 1.0.7 +fi + if [ "$DO_FEATURE_MATRIX" = true ]; then cargo build --all --no-default-features cargo test --all --no-default-features @@ -40,7 +46,16 @@ if [ "$DO_FEATURE_MATRIX" = true ]; then fi if [ "$DO_SCHEMARS_TESTS" = true ]; then - (cd extended_tests/schemars && cargo test) + ( + cd extended_tests/schemars + # Pin if using MSRV toolchain. + if cargo --version | grep "cargo 1\.41"; then + cargo update --package schemars --precise 0.8.3 + cargo update --package dyn-clone --precise 1.0.7 + fi + + cargo test + ) fi # Build the docs if told to (this only works with the nightly toolchain) diff --git a/extended_tests/schemars/Cargo.toml b/extended_tests/schemars/Cargo.toml index b204a20..6a061af 100644 --- a/extended_tests/schemars/Cargo.toml +++ b/extended_tests/schemars/Cargo.toml @@ -12,6 +12,6 @@ features = ['schemars', 'serde'] [dependencies] jsonschema-valid = "^0.4.0" serde = { version = "1.0", default-features = false} -schemars = { version = "<=0.8.3"} +schemars = { version = "0.8.3"} serde_test = "1.0" serde_json = "1.0"