Skip to content

Commit 090f073

Browse files
committed
Merge #641: Fix CI
92778ef CI: Pin cc in ASAN no_std_test crate (Tobin C. Harding) 5e6dd8a CI: Use bash instead of sh (Tobin C. Harding) cf5f103 Target panic message at lib users (Tobin C. Harding) ec9c964 Allow stuff after unconditional panic (Tobin C. Harding) 3bbf083 no_std_test: Remove internal_features (Tobin C. Harding) cff7a3d CI: Grep for exact error message (Tobin C. Harding) 79e184f CI: Update MSRV pins (Tobin C. Harding) Pull request description: CI has a bunch of things broken. This is #640 followed by #639 followed by a few addition fixes to get CI green again. Includes clippy warnings in feature gated code which is not strictly necessary and a fix to a panic message, also not strictly necessary. ACKs for top commit: apoelstra: ACK 92778ef Tree-SHA512: f99b01e17fade7df394299bdb6bf385bec3f88d6568d43962238049b33a94c364d48c266acb358e72a48dd55a4aac6300ace6478b0821275b89cb86eba639d8b
2 parents 29e1a0c + 92778ef commit 090f073

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

contrib/test.sh

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
#!/bin/sh
1+
#!/usr/bin/env bash
22

33
set -ex
44

5+
REPO_DIR=$(git rev-parse --show-toplevel)
56
FEATURES="bitcoin-hashes global-context lowmemory rand recovery serde std alloc bitcoin-hashes-std rand-std"
67

78
cargo --version
@@ -16,11 +17,13 @@ fi
1617
# Pin dependencies as required if we are using MSRV toolchain.
1718
if cargo --version | grep "1\.48"; then
1819
cargo update -p wasm-bindgen-test --precise 0.3.34
19-
cargo update -p serde --precise 1.0.156
20+
cargo update -p serde_test --precise 1.0.175
2021
fi
2122

2223
# Test if panic in C code aborts the process (either with a real panic or with SIGILL)
23-
cargo test -- --ignored --exact 'tests::test_panic_raw_ctx_should_terminate_abnormally' 2>&1 | tee /dev/stderr | grep "SIGILL\\|panicked at '\[libsecp256k1\]"
24+
cargo test -- --ignored --exact 'tests::test_panic_raw_ctx_should_terminate_abnormally' 2>&1 \
25+
| tee /dev/stderr \
26+
| grep "SIGILL\\|\[libsecp256k1] illegal argument. !rustsecp256k1_v0_._._fe_is_zero(&ge->x)"
2427

2528
# Make all cargo invocations verbose
2629
export CARGO_TERM_VERBOSE=true
@@ -106,6 +109,12 @@ if [ "$DO_ASAN" = true ]; then
106109
CC='clang -fsanitize=memory -fno-omit-frame-pointer' \
107110
RUSTFLAGS='-Zsanitizer=memory -Zsanitizer-memory-track-origins -Cforce-frame-pointers=yes -Cllvm-args=-msan-eager-checks=0' \
108111
cargo test --lib --all --features="$FEATURES" -Zbuild-std --target x86_64-unknown-linux-gnu
112+
113+
pushd "$REPO_DIR/no_std_test" > /dev/null || exit 1
114+
# See https://github.com/rust-bitcoin/rust-secp256k1/pull/641#issuecomment-1671598914
115+
cargo update -p cc --precise 1.0.79
116+
popd > /dev/null || exit 1
117+
109118
cargo run --release --manifest-path=./no_std_test/Cargo.toml | grep -q "Verified Successfully"
110119
cargo run --release --features=alloc --manifest-path=./no_std_test/Cargo.toml | grep -q "Verified alloc Successfully"
111120
fi

no_std_test/src/main.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
//! * Requires linking with `libc` for calling `printf`.
2828
//!
2929
30-
#![feature(lang_items)]
3130
#![feature(start)]
3231
#![feature(core_intrinsics)]
3332
#![feature(panic_info_message)]

src/key.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1036,6 +1036,8 @@ impl serde::Serialize for KeyPair {
10361036
}
10371037

10381038
#[cfg(feature = "serde")]
1039+
#[allow(unused_variables)] // For `data` under some feature combinations (the unconditional panic below).
1040+
#[allow(unreachable_code)] // For `KeyPair::from_seckey_slice` after unconditional panic.
10391041
impl<'de> serde::Deserialize<'de> for KeyPair {
10401042
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
10411043
if d.is_human_readable() {
@@ -1051,7 +1053,7 @@ impl<'de> serde::Deserialize<'de> for KeyPair {
10511053
let ctx = Secp256k1::signing_only();
10521054

10531055
#[cfg(not(any(feature = "global-context", feature = "alloc")))]
1054-
let ctx: Secp256k1<crate::SignOnlyPreallocated> = panic!("The previous implementation was panicking too, please enable the global-context feature of rust-secp256k1");
1056+
let ctx: Secp256k1<crate::SignOnlyPreallocated> = panic!("cannot deserialize key pair without a context (please enable either the global-context or alloc feature)");
10551057

10561058
#[allow(clippy::needless_borrow)]
10571059
KeyPair::from_seckey_slice(&ctx, data)

0 commit comments

Comments
 (0)