Merge rust-bitcoin/rust-secp256k1#641: Fix CI
92778efe92
CI: Pin cc in ASAN no_std_test crate (Tobin C. Harding)5e6dd8a467
CI: Use bash instead of sh (Tobin C. Harding)cf5f1034ca
Target panic message at lib users (Tobin C. Harding)ec9c9643d7
Allow stuff after unconditional panic (Tobin C. Harding)3bbf08348e
no_std_test: Remove internal_features (Tobin C. Harding)cff7a3dae7
CI: Grep for exact error message (Tobin C. Harding)79e184f08a
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: ACK92778efe92
Tree-SHA512: f99b01e17fade7df394299bdb6bf385bec3f88d6568d43962238049b33a94c364d48c266acb358e72a48dd55a4aac6300ace6478b0821275b89cb86eba639d8b
This commit is contained in:
commit
090f073772
|
@ -1,7 +1,8 @@
|
|||
#!/bin/sh
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -ex
|
||||
|
||||
REPO_DIR=$(git rev-parse --show-toplevel)
|
||||
FEATURES="bitcoin-hashes global-context lowmemory rand recovery serde std alloc bitcoin-hashes-std rand-std"
|
||||
|
||||
cargo --version
|
||||
|
@ -16,11 +17,13 @@ fi
|
|||
# Pin dependencies as required if we are using MSRV toolchain.
|
||||
if cargo --version | grep "1\.48"; then
|
||||
cargo update -p wasm-bindgen-test --precise 0.3.34
|
||||
cargo update -p serde --precise 1.0.156
|
||||
cargo update -p serde_test --precise 1.0.175
|
||||
fi
|
||||
|
||||
# Test if panic in C code aborts the process (either with a real panic or with SIGILL)
|
||||
cargo test -- --ignored --exact 'tests::test_panic_raw_ctx_should_terminate_abnormally' 2>&1 | tee /dev/stderr | grep "SIGILL\\|panicked at '\[libsecp256k1\]"
|
||||
cargo test -- --ignored --exact 'tests::test_panic_raw_ctx_should_terminate_abnormally' 2>&1 \
|
||||
| tee /dev/stderr \
|
||||
| grep "SIGILL\\|\[libsecp256k1] illegal argument. !rustsecp256k1_v0_._._fe_is_zero(&ge->x)"
|
||||
|
||||
# Make all cargo invocations verbose
|
||||
export CARGO_TERM_VERBOSE=true
|
||||
|
@ -106,6 +109,12 @@ if [ "$DO_ASAN" = true ]; then
|
|||
CC='clang -fsanitize=memory -fno-omit-frame-pointer' \
|
||||
RUSTFLAGS='-Zsanitizer=memory -Zsanitizer-memory-track-origins -Cforce-frame-pointers=yes -Cllvm-args=-msan-eager-checks=0' \
|
||||
cargo test --lib --all --features="$FEATURES" -Zbuild-std --target x86_64-unknown-linux-gnu
|
||||
|
||||
pushd "$REPO_DIR/no_std_test" > /dev/null || exit 1
|
||||
# See https://github.com/rust-bitcoin/rust-secp256k1/pull/641#issuecomment-1671598914
|
||||
cargo update -p cc --precise 1.0.79
|
||||
popd > /dev/null || exit 1
|
||||
|
||||
cargo run --release --manifest-path=./no_std_test/Cargo.toml | grep -q "Verified Successfully"
|
||||
cargo run --release --features=alloc --manifest-path=./no_std_test/Cargo.toml | grep -q "Verified alloc Successfully"
|
||||
fi
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
//! * Requires linking with `libc` for calling `printf`.
|
||||
//!
|
||||
|
||||
#![feature(lang_items)]
|
||||
#![feature(start)]
|
||||
#![feature(core_intrinsics)]
|
||||
#![feature(panic_info_message)]
|
||||
|
|
|
@ -1036,6 +1036,8 @@ impl serde::Serialize for KeyPair {
|
|||
}
|
||||
|
||||
#[cfg(feature = "serde")]
|
||||
#[allow(unused_variables)] // For `data` under some feature combinations (the unconditional panic below).
|
||||
#[allow(unreachable_code)] // For `KeyPair::from_seckey_slice` after unconditional panic.
|
||||
impl<'de> serde::Deserialize<'de> for KeyPair {
|
||||
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
|
||||
if d.is_human_readable() {
|
||||
|
@ -1051,7 +1053,7 @@ impl<'de> serde::Deserialize<'de> for KeyPair {
|
|||
let ctx = Secp256k1::signing_only();
|
||||
|
||||
#[cfg(not(any(feature = "global-context", feature = "alloc")))]
|
||||
let ctx: Secp256k1<crate::SignOnlyPreallocated> = panic!("The previous implementation was panicking too, please enable the global-context feature of rust-secp256k1");
|
||||
let ctx: Secp256k1<crate::SignOnlyPreallocated> = panic!("cannot deserialize key pair without a context (please enable either the global-context or alloc feature)");
|
||||
|
||||
#[allow(clippy::needless_borrow)]
|
||||
KeyPair::from_seckey_slice(&ctx, data)
|
||||
|
|
Loading…
Reference in New Issue