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: freeze 1.81 for near-workspaces paths (temporarily) #1250

Merged
merged 6 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
5 changes: 3 additions & 2 deletions .github/workflows/test_examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ jobs:
strategy:
matrix:
platform: [ubuntu-latest, macos-latest]
toolchain: [stable]
toolchain: [1.81]
# toolchain: [stable]
example: [
adder,
callback-results,
Expand All @@ -34,7 +35,7 @@ jobs:
- uses: Swatinem/rust-cache@v1
with:
working-directory: ./examples/${{ matrix.example }}
- name: Build status-message
- name: Build `status-message`, that `factory-contract` depends on
if: matrix.example == 'factory-contract'
env:
RUSTFLAGS: '-C link-arg=-s'
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/test_examples_small.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ jobs:
strategy:
matrix:
platform: [ubuntu-latest, macos-latest]
toolchain: [stable]
toolchain: [1.81]
# toolchain: [stable]
steps:
- uses: actions/checkout@v3
- name: "${{ matrix.toolchain }} with rustfmt, clippy, and wasm32"
Expand Down
2 changes: 1 addition & 1 deletion near-sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ rand_chacha = "0.3.1"
near-rng = "0.1.1"
near-abi = { version = "0.4.0", features = ["__chunked-entries"] }
symbolic-debuginfo = "12"
near-workspaces = { version = "0.14", features = ["unstable"] }
near-workspaces = { version = "0.14.1", features = ["unstable"] }
anyhow = "1.0"
tokio = { version = "1", features = ["full"] }
strum = "0.25.0"
Expand Down
2 changes: 2 additions & 0 deletions near-sdk/src/environment/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ pub fn set_blockchain_interface(blockchain_interface: MockedBlockchain) {

/// Implements panic hook that converts `PanicInfo` into a string and provides it through the
/// blockchain interface.
// TODO: replace with std::panic::PanicHookInfo when MSRV becomes >= 1.81.0
#[allow(deprecated)]
fn panic_hook_impl(info: &std_panic::PanicInfo) {
panic_str(info.to_string().as_str());
}
Expand Down
11 changes: 9 additions & 2 deletions near-sdk/tests/store_performance_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ async fn iter() -> anyhow::Result<()> {
Ok(())
}

#[allow(clippy::ifs_same_cond)]
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this is a false lint that since(1.82) and since(1.81) are the same condition

#[tokio::test]
async fn random_access() -> anyhow::Result<()> {
// LookupMap and LookupSet are not iterable.
Expand All @@ -246,8 +247,14 @@ async fn random_access() -> anyhow::Result<()> {
.unwrap();
}

// Rust 1.81 improved performance of unordered collections.
let unordered_map = if rustversion::cfg!(since(1.81)) { 42 } else { 36 };
let unordered_map = if rustversion::cfg!(since(1.82)) {
40
// Rust 1.81 improved performance of unordered collections, 1.82 regressed it
} else if rustversion::cfg!(since(1.81)) {
42
} else {
36
};

// iter, repeat here is the number that reflects how many times we retrieve a random element.
// It's used to measure relative performance.
Expand Down
Loading