Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14864343
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
10 KB
Subscribers
None
View Options
diff --git a/src/secp256k1/.travis.yml b/src/secp256k1/.travis.yml
index c65d7b9cb..e1ccd304a 100644
--- a/src/secp256k1/.travis.yml
+++ b/src/secp256k1/.travis.yml
@@ -1,130 +1,130 @@
language: c
os:
- linux
- osx
dist: bionic
# Valgrind currently supports upto macOS 10.13, the latest xcode of that version is 10.1
osx_image: xcode10.1
addons:
apt:
packages:
- gcc-multilib
- libc6-dbg:i386
- libgmp-dev
- libgmp-dev:i386
- libtool-bin
- ninja-build
- valgrind
homebrew:
packages:
- cmake
- gcc@9
- gmp
- ninja
- valgrind
update: true
install:
- if [ "${TRAVIS_OS_NAME}" = "linux" ] && [ "${TRAVIS_CPU_ARCH}" = "amd64" ]; then ./travis/install_cmake.sh; fi
cache:
directories:
- /opt/cmake
compiler:
- clang
- gcc
env:
global:
- WIDEMUL=auto
- BIGNUM=gmp
- ENDOMORPHISM=no
- STATICPRECOMPUTATION=yes
- ECMULTGENPRECISION=auto
- ASM=no
- AUTOTOOLS_TARGET=check
- CMAKE_TARGET=check-secp256k1
- AUTOTOOLS_EXTRA_FLAGS=
- CMAKE_EXTRA_FLAGS=
- HOST=
- ECDH=no
- RECOVERY=no
- SCHNORR=yes
- EXPERIMENTAL=no
- JNI=no
- OPENSSL_TESTS=auto
- MULTISET=no
- CTIMETEST=yes
- BENCH=yes
- ITERS=2
jobs:
- WIDEMUL=int64 RECOVERY=yes
- WIDEMUL=int64 ECDH=yes EXPERIMENTAL=yes MULTISET=yes
- WIDEMUL=int64 ENDOMORPHISM=yes
- WIDEMUL=int128
- WIDEMUL=int128 RECOVERY=yes
- WIDEMUL=int128 ENDOMORPHISM=yes
- WIDEMUL=int128 ENDOMORPHISM=yes ECDH=yes EXPERIMENTAL=yes MULTISET=yes
- WIDEMUL=int128 ASM=x86_64
- WIDEMUL=int128 ENDOMORPHISM=yes ASM=x86_64
- BIGNUM=no
- BIGNUM=no ENDOMORPHISM=yes RECOVERY=yes EXPERIMENTAL=yes MULTISET=yes
- BIGNUM=no STATICPRECOMPUTATION=no
- - AUTOTOOLS_TARGET=distcheck CMAKE_TARGET=install CTIMETEST= BENCH=
+ - AUTOTOOLS_TARGET=distcheck CMAKE_TARGET=install CTIMETEST=no BENCH=no
- AUTOTOOLS_EXTRA_FLAGS=CPPFLAGS=-DDETERMINISTIC CMAKE_EXTRA_FLAGS=-DCMAKE_C_FLAGS=-DDETERMINISTIC
- - AUTOTOOLS_EXTRA_FLAGS=CFLAGS=-O0 CMAKE_EXTRA_FLAGS=-DCMAKE_BUILD_TYPE=Debug CTIMETEST=
- - AUTOTOOLS_TARGET=check-java CMAKE_TARGET=check-secp256k1-java JNI=yes ECDH=yes EXPERIMENTAL=yes CTIMETEST= BENCH=
+ - AUTOTOOLS_EXTRA_FLAGS=CFLAGS=-O0 CMAKE_EXTRA_FLAGS=-DCMAKE_BUILD_TYPE=Debug CTIMETEST=no
+ - AUTOTOOLS_TARGET=check-java CMAKE_TARGET=check-secp256k1-java JNI=yes ECDH=yes EXPERIMENTAL=yes CTIMETEST=no BENCH=no
- ECMULTGENPRECISION=2
- ECMULTGENPRECISION=8
- VALGRIND=yes
BIGNUM=no ENDOMORPHISM=yes ASM=x86_64 EXPERIMENTAL=yes ECDH=yes RECOVERY=yes OPENSSL_TESTS=no MULTISET=yes
AUTOTOOLS_EXTRA_FLAGS=CPPFLAGS=-DVALGRIND AUTOTOOLS_TARGET=
CMAKE_EXTRA_FLAGS=-DCMAKE_C_FLAGS=-DVALGRIND CMAKE_TARGET="secp256k1-tests secp256k1-exhaustive_tests"
# The same as above but without endomorphism.
- VALGRIND=yes
BIGNUM=no ASM=x86_64 EXPERIMENTAL=yes ECDH=yes RECOVERY=yes OPENSSL_TESTS=no MULTISET=yes
AUTOTOOLS_EXTRA_FLAGS=CPPFLAGS=-DVALGRIND AUTOTOOLS_TARGET=
CMAKE_EXTRA_FLAGS=-DCMAKE_C_FLAGS=-DVALGRIND CMAKE_TARGET="secp256k1-tests secp256k1-exhaustive_tests"
- SCHNORR=no
jobs:
fast_finish: true
include:
- compiler: clang
os: linux
env: HOST=i686-linux-gnu ENDOMORPHISM=yes OPENSSL_TESTS=no
- compiler: clang
os: linux
env: HOST=i686-linux-gnu BIGNUM=no OPENSSL_TESTS=no
- compiler: gcc
os: linux
env: HOST=i686-linux-gnu ENDOMORPHISM=yes BIGNUM=no OPENSSL_TESTS=no
- compiler: gcc
os: linux
env: HOST=i686-linux-gnu OPENSSL_TESTS=no
# S390x build (big endian system)
- dist: focal
compiler: gcc
- env: HOST=s390x-unknown-linux-gnu OPENSSL_TESTS=no ECDH=yes RECOVERY=yes EXPERIMENTAL=yes MULTISET=yes CTIMETEST=
+ env: HOST=s390x-unknown-linux-gnu OPENSSL_TESTS=no ECDH=yes RECOVERY=yes EXPERIMENTAL=yes MULTISET=yes CTIMETEST=no
arch: s390x
addons:
apt:
packages:
- cmake
- libgmp-dev
- libtool-bin
- ninja-build
before_script:
# This limits the iterations in the benchmarks below to ITER iterations.
- export SECP256K1_BENCH_ITERS="$ITERS"
# travis auto terminates jobs that go for 10 minutes without printing to stdout,
# but travis_wait doesn't work well with forking programs like valgrind
# (https://docs.travis-ci.com/user/common-build-problems/#build-times-out-because-no-output-was-received https://github.com/bitcoin-core/secp256k1/pull/750#issuecomment-623476860)
script:
- function keep_alive() { while true; do echo -en "\a"; sleep 60; done }
- keep_alive &
- ./travis/build_autotools.sh
- ./travis/build_cmake.sh
- kill %keep_alive
after_script:
- valgrind --version
diff --git a/src/secp256k1/travis/build_autotools.sh b/src/secp256k1/travis/build_autotools.sh
index 099383abc..78736587f 100755
--- a/src/secp256k1/travis/build_autotools.sh
+++ b/src/secp256k1/travis/build_autotools.sh
@@ -1,98 +1,98 @@
#!/usr/bin/env bash
export LC_ALL=C
set -ex
# FIXME The java tests will fail on macOS with autotools due to the
# libsepc256k1_jni library referencing the libsecp256k1 library with an absolute
# path. This needs to be rewritten with install_name_tool to use relative paths
# via the @variables supported by the macOS loader.
if [ "$TRAVIS_OS_NAME" = "osx" ] && [ "$JNI" = "yes" ]
then
echo "Skipping the java tests built with autotools on OSX"
exit 0
fi
if [ -n "$HOST" ]; then
USE_HOST="--host=$HOST"
fi
if [ "x$HOST" = "xi686-linux-gnu" ]; then
CC="$CC -m32"
fi
if [ "$TRAVIS_OS_NAME" = "osx" ] && [ "$TRAVIS_COMPILER" = "gcc" ]
then
CC="gcc-9"
fi
$CC --version
./autogen.sh
mkdir buildautotools
pushd buildautotools
../configure \
--enable-experimental=$EXPERIMENTAL \
--enable-endomorphism=$ENDOMORPHISM \
--with-test-override-wide-multiply=$WIDEMUL \
--with-bignum=$BIGNUM \
--with-asm=$ASM \
--enable-ecmult-static-precomputation=$STATICPRECOMPUTATION \
--with-ecmult-gen-precision=$ECMULTGENPRECISION \
--enable-module-ecdh=$ECDH \
--enable-module-multiset=$MULTISET \
--enable-module-recovery=$RECOVERY \
--enable-module-schnorr=$SCHNORR \
--enable-jni=$JNI \
--enable-openssl-tests=$OPENSSL_TESTS \
$AUTOTOOLS_EXTRA_FLAGS \
$USE_HOST
print_logs() {
cat tests.log || :
cat exhaustive_tests.log || :
cat valgrind_ctime_test.log || :
cat bench.log || :
}
trap 'print_logs' ERR
make -j2 $AUTOTOOLS_TARGET
-if [ -n "$VALGRIND" ]; then
+if [ "$VALGRIND" = "yes" ]; then
# the `--error-exitcode` is required to make the test fail if valgrind found
# errors, otherwise it'll return 0
# (http://valgrind.org/docs/manual/manual-core.html)
valgrind --error-exitcode=42 ./tests 16
valgrind --error-exitcode=42 ./exhaustive_tests
fi
-if [ -n "$BENCH" ]; then
- if [ -n "$VALGRIND" ]; then
+if [ "$BENCH" = "yes" ]; then
+ if [ "$VALGRIND" = "yes" ]; then
# Using the local `libtool` because on macOS the system's libtool has
# nothing to do with GNU libtool
EXEC='./libtool --mode=execute valgrind --error-exitcode=42';
else
EXEC= ;
fi
$EXEC ./bench_ecmult >> bench.log 2>&1
$EXEC ./bench_internal >> bench.log 2>&1
$EXEC ./bench_sign >> bench.log 2>&1
$EXEC ./bench_verify >> bench.log 2>&1
if [ "$RECOVERY" == "yes" ]; then
$EXEC ./bench_recover >> bench.log 2>&1
fi
if [ "$ECDH" == "yes" ]; then
$EXEC ./bench_ecdh >> bench.log 2>&1
fi
if [ "$MULTISET" == "yes" ]; then
$EXEC ./bench_multiset >> bench.log 2>&1
fi
fi
-if [ -n "$CTIMETEST" ]; then
+if [ "$CTIMETEST" = "yes" ]; then
./libtool --mode=execute valgrind --error-exitcode=42 ./valgrind_ctime_test > valgrind_ctime_test.log 2>&1
fi
popd
diff --git a/src/secp256k1/travis/build_cmake.sh b/src/secp256k1/travis/build_cmake.sh
index ab43c9d22..38fa48382 100755
--- a/src/secp256k1/travis/build_cmake.sh
+++ b/src/secp256k1/travis/build_cmake.sh
@@ -1,60 +1,60 @@
#!/usr/bin/env bash
export LC_ALL=C
set -ex
if [ "x$HOST" = "xi686-linux-gnu" ]; then
CMAKE_EXTRA_FLAGS="$CMAKE_EXTRA_FLAGS -DCMAKE_C_FLAGS=-m32"
fi
if [ "$TRAVIS_OS_NAME" = "osx" ] && [ "$TRAVIS_COMPILER" = "gcc" ]
then
CMAKE_EXTRA_FLAGS="$CMAKE_EXTRA_FLAGS -DCMAKE_C_COMPILER=gcc-9"
fi
# "auto" is not a valid value for SECP256K1_ECMULT_GEN_PRECISION with cmake.
# In this case we use the default value instead by not setting the cache
# variable on the cmake command line.
if [ "x$ECMULTGENPRECISION" != "xauto" ]; then
ECMULT_GEN_PRECISION_ARG="-DSECP256K1_ECMULT_GEN_PRECISION=$ECMULTGENPRECISION"
fi
mkdir -p buildcmake/install
pushd buildcmake
# Use the cmake version installed via the install_cmake.sh script on linux amd64
if [ "$TRAVIS_OS_NAME" = "linux" ] && [ "${TRAVIS_CPU_ARCH}" = "amd64" ]
then
CMAKE_COMMAND=/opt/cmake/bin/cmake
else
CMAKE_COMMAND=cmake
fi
${CMAKE_COMMAND} --version
${CMAKE_COMMAND} -GNinja .. \
-DCMAKE_INSTALL_PREFIX=install \
-DSECP256K1_BUILD_OPENSSL_TESTS=$OPENSSL_TESTS \
-DSECP256K1_ECMULT_STATIC_PRECOMPUTATION=$STATICPRECOMPUTATION \
-DSECP256K1_ENABLE_MODULE_ECDH=$ECDH \
-DSECP256K1_ENABLE_MODULE_MULTISET=$MULTISET \
-DSECP256K1_ENABLE_MODULE_RECOVERY=$RECOVERY \
-DSECP256K1_ENABLE_MODULE_SCHNORR=$SCHNORR \
-DSECP256K1_ENABLE_JNI=$JNI \
-DSECP256K1_ENABLE_ENDOMORPHISM=$ENDOMORPHISM \
-DSECP256K1_ENABLE_BIGNUM=$BIGNUM \
-DSECP256K1_USE_ASM=$ASM \
-DSECP256K1_TEST_OVERRIDE_WIDE_MULTIPLY=$WIDEMUL \
$ECMULT_GEN_PRECISION_ARG \
$CMAKE_EXTRA_FLAGS
ninja $CMAKE_TARGET
-if [ -n "$VALGRIND" ]; then
+if [ "$VALGRIND" = "yes" ]; then
# the `--error-exitcode` is required to make the test fail if valgrind found
# errors, otherwise it'll return 0
# (http://valgrind.org/docs/manual/manual-core.html)
valgrind --error-exitcode=42 ./secp256k1-tests 16
valgrind --error-exitcode=42 ./secp256k1-exhaustive_tests
fi
popd
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Wed, May 21, 18:54 (1 d, 2 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5865736
Default Alt Text
(10 KB)
Attached To
rABC Bitcoin ABC
Event Timeline
Log In to Comment