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

Commit

Permalink
Remove schemars pinning
Browse files Browse the repository at this point in the history
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
  • Loading branch information
tcharding committed Sep 5, 2022
1 parent 561efa4 commit 0055281
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 deletions.
7 changes: 2 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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"
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 6 additions & 0 deletions contrib/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion extended_tests/schemars/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit 0055281

Please sign in to comment.