Skip to content

Commit 34388af

Browse files
committed
Merge #922: Add mingw32-w64/wine CI build
ed5a199 tests: fopen /dev/urandom in binary mode (Tim Ruffing) 4dc37bf Add mingw32-w64/wine CI build (Pieter Wuille) Pull request description: ACKs for top commit: real-or-random: ACK ed5a199 jonasnick: utACK ed5a199 Tree-SHA512: 45afc394e3a200f7c020426a66f78df8d12827b9dc91bb04dc1708c3ad5cdc4e7d20554d6d5c046d288552f4e722d4fe8a0f3234b662e7351a4d27aaaeb0d5c0
2 parents 7012a18 + ed5a199 commit 34388af

File tree

4 files changed

+38
-3
lines changed

4 files changed

+38
-3
lines changed

.cirrus.yml

+21
Original file line numberDiff line numberDiff line change
@@ -196,3 +196,24 @@ task:
196196
- rm /etc/ld.so.cache
197197
- ./ci/cirrus.sh
198198
<< : *CAT_LOGS
199+
200+
task:
201+
name: "x86_64 (mingw32-w64): Windows (Debian stable, Wine)"
202+
container:
203+
dockerfile: ci/linux-debian.Dockerfile
204+
cpu: 1
205+
memory: 1G
206+
env:
207+
WINE_CMD: wine64-stable
208+
HOST: x86_64-w64-mingw32
209+
BUILD:
210+
WITH_VALGRIND: no
211+
ECDH: yes
212+
RECOVERY: yes
213+
EXPERIMENTAL: yes
214+
SCHNORRSIG: yes
215+
CTIMETEST: no
216+
<< : *MERGE_BASE
217+
test_script:
218+
- ./ci/cirrus.sh
219+
<< : *CAT_LOGS

ci/cirrus.sh

+11-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ valgrind --version || true
2525
make
2626

2727
# Print information about binaries so that we can see that the architecture is correct
28-
file *tests || true
28+
file *tests* || true
2929
file bench_* || true
3030
file .libs/* || true
3131

@@ -47,6 +47,12 @@ then
4747
$QEMU_CMD ./exhaustive_tests
4848
fi
4949

50+
if [ -n "$WINE_CMD" ]
51+
then
52+
$WINE_CMD ./tests 16
53+
$WINE_CMD ./exhaustive_tests
54+
fi
55+
5056
if [ "$BENCH" = "yes" ]
5157
then
5258
# Using the local `libtool` because on macOS the system's libtool has nothing to do with GNU libtool
@@ -59,6 +65,10 @@ then
5965
then
6066
EXEC="$EXEC valgrind --error-exitcode=42"
6167
fi
68+
if [ -n "$WINE_CMD" ]
69+
then
70+
EXEC="$WINE_CMD"
71+
fi
6272
# This limits the iterations in the benchmarks below to ITER iterations.
6373
export SECP256K1_BENCH_ITERS="$ITERS"
6474
{

ci/linux-debian.Dockerfile

+5-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,8 @@ RUN apt-get install --no-install-recommends --no-upgrade -y \
1010
make automake libtool pkg-config dpkg-dev valgrind qemu-user \
1111
gcc clang libc6-dbg \
1212
gcc-i686-linux-gnu libc6-dev-i386-cross libc6-dbg:i386 \
13-
gcc-s390x-linux-gnu libc6-dev-s390x-cross libc6-dbg:s390x
13+
gcc-s390x-linux-gnu libc6-dev-s390x-cross libc6-dbg:s390x \
14+
wine gcc-mingw-w64-x86-64
15+
16+
# Run a dummy command in wine to make it set up configuration
17+
RUN wine64-stable xcopy || true

src/testrand_impl.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ static void secp256k1_testrand_init(const char* hexseed) {
127127
pos++;
128128
}
129129
} else {
130-
FILE *frand = fopen("/dev/urandom", "r");
130+
FILE *frand = fopen("/dev/urandom", "rb");
131131
if ((frand == NULL) || fread(&seed16, 1, sizeof(seed16), frand) != sizeof(seed16)) {
132132
uint64_t t = time(NULL) * (uint64_t)1337;
133133
fprintf(stderr, "WARNING: could not read 16 bytes from /dev/urandom; falling back to insecure PRNG\n");

0 commit comments

Comments
 (0)