Skip to content
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

ci: Respect {{ matrix.toolchain }} in "Test Core: test" job #1085

Merged
merged 7 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,15 @@ jobs:
with:
profile: minimal
toolchain: ${{ matrix.toolchain }}
default: true
target: wasm32-unknown-unknown
- name: downgrade `anstyle`, `clap`, `clap_lex` crates to support older Rust toolchain
if: matrix.toolchain == '1.69.0'
run: |
cargo update -p anstyle --precise 1.0.2
cargo update -p clap --precise 4.3.24
cargo update -p clap_lex --precise 0.5.0
Comment on lines +29 to +31
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i've tried

cargo +nightly update -Z direct-minimal-versions

from this recipe to automate this process of adding exceptions,
but, besides the fact, that this command required applying following diff to hint minimal versions to be able to run successfully

diff --git a/near-contract-standards/Cargo.toml b/near-contract-standards/Cargo.toml
index 263deee..8942314 100644
--- a/near-contract-standards/Cargo.toml
+++ b/near-contract-standards/Cargo.toml
@@ -7,17 +7,17 @@ license = "MIT OR Apache-2.0"
 categories = ["wasm"]
 repository = "https://github.com/near/near-sdk-rs"
 homepage = "https://near-sdk.io"
 documentation = "https://docs.rs/near-contract-standards"
 description = """
 NEAR smart contracts standard library.
 """
 
 [dependencies]
 near-sdk = { path = "../near-sdk", version = "~4.1.1", default-features = false, features = ["legacy"] }
-serde = "1"
-serde_json = "1"
-schemars = "0.8"
+serde = "1.0.157"
+serde_json = "1.0.68"
+schemars = "0.8.11"
 
 [features]
 default = ["abi"]
 abi = ["near-sdk/abi"]
diff --git a/near-sdk-macros/Cargo.toml b/near-sdk-macros/Cargo.toml
index 9b7e7bc..a110e1f 100644
--- a/near-sdk-macros/Cargo.toml
+++ b/near-sdk-macros/Cargo.toml
@@ -8,21 +8,21 @@ categories = ["wasm"]
 repository = "https://github.com/near/near-sdk-rs"
 homepage = "https://near-sdk.io"
 description = """
 Main macro of the library for writing NEAR smart contracts.
 """
 
 [lib]
 proc-macro = true
 
 [dependencies]
-proc-macro2 = "1.0"
-syn = { version = "1", features = ["full", "fold", "extra-traits", "visit"] }
+proc-macro2 = "1.0.55"
+syn = { version = "1.0.60", features = ["full", "fold", "extra-traits", "visit"] }
 strum = "0.24"
 strum_macros = "0.24"
-quote = "1.0"
+quote = "1.0.25"
 Inflector = { version = "0.11.4", default-features = false, features = [] }
 
 [features]
 abi = []
 __abi-embed = ["abi"]
 __abi-generate = ["abi"]
diff --git a/near-sdk/Cargo.toml b/near-sdk/Cargo.toml
index a015a64..9905772 100644
--- a/near-sdk/Cargo.toml
+++ b/near-sdk/Cargo.toml
@@ -12,44 +12,44 @@ description = """
 Rust library for writing NEAR smart contracts.
 """
 
 [[test]]
 name = "compilation_tests"
 path = "compilation_tests/all.rs"
 required-features = ["abi", "unstable"]
 
 [dependencies]
 # Provide near_bidgen macros.
-serde = { version = "1", features = ["derive"] }
-serde_json = "1"
+serde = { version = "1.0.157", features = ["derive"] }
+serde_json = "1.0.68"
 near-sdk-macros = { path = "../near-sdk-macros", version = "~4.1.1" }
 near-sys = { path = "../near-sys", version = "0.2" }
 base64 = "0.13"
-borsh = { version = "0.9", features = ["const-generics"] }
+borsh = { version = "0.9.3", features = ["const-generics"] }
 bs58 = "0.4"
-schemars = { version = "0.8.8", optional = true }
+schemars = { version = "0.8.11", optional = true }
 # Export dependencies for contracts
 wee_alloc = { version = "0.4.5", default-features = false, optional = true }
 
 # Used for caching, might be worth porting only functionality needed.
 once_cell = { version = "1.17", default-features = false }
 
 near-abi = { version = "0.3.0", features = ["__chunked-entries"], optional = true }
 
 [target.'cfg(not(target_arch = "wasm32"))'.dependencies]
 near-vm-logic = { version = "0.17", optional = true }
 near-primitives-core = { version = "0.17", optional = true }
 near-primitives = { version = "0.17", optional = true }
 near-crypto = { version = "0.17", optional = true }
 
 [dev-dependencies]
-rand = "0.8.4"
+rand = "0.8.5"
 trybuild = "1.0"
 rustversion = "1.0"
 rand_xorshift = "0.3"
 quickcheck = "1.0"
 arbitrary = { version = "1.2.3", features = ["derive"] }
 derive_arbitrary = "1.2.3"
 hex = { version = "0.4.3", features = ["serde"] }
 
 [features]
 default = ["wee_alloc", "unit-testing", "legacy", "abi"]

it generates a Cargo.lock file, where the versions of problematic anstyle, clap and clap_lex are greater than needed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i've tried cargo +nightly update -Z minimal-versions as well.
it doesn't require hinting, but cannot figure out the right version for clap as well

- uses: Swatinem/rust-cache@v1
- run: rustup target add wasm32-unknown-unknown
- name: Test
run: cargo test --all --features unstable,legacy
lint:
Expand Down
2 changes: 1 addition & 1 deletion near-sdk/compilation_tests/schema_derive_invalids.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ error[E0277]: the trait bound `Inner: JsonSchema` is not satisfied
i128
and $N others
note: required by a bound in `SchemaGenerator::subschema_for`
--> $CARGO/schemars-0.8.13/src/gen.rs
--> $CARGO/schemars-0.8.15/src/gen.rs
|
| pub fn subschema_for<T: ?Sized + JsonSchema>(&mut self) -> Schema {
| ^^^^^^^^^^ required by this bound in `SchemaGenerator::subschema_for`
Loading