Skip to content

Commit

Permalink
ci: freeze 1.81 for near-workspaces paths (temporarily) (#1250)
Browse files Browse the repository at this point in the history
* ci: finish somewhat cut `factory-contract` example

* ci: temporarily replace `stable` -> 1.81 , where `near-workspaces` tests are run

* ci: allow stable for mac, silence deprecation warn

* ci: allow stable for `ubuntu-latest` Test job (runs through near_workspaces::compile_project)

* chore: adjust iterations for store perf test

* ci: typo and false clippy lint

---------

Co-authored-by: dj8yf0μl <[email protected]>
  • Loading branch information
dj8yfo and dj8yf0μl authored Oct 24, 2024
1 parent 936ae63 commit 2a4f034
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 6 deletions.
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)]
#[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

0 comments on commit 2a4f034

Please sign in to comment.