Skip to content

Commit 060e32c

Browse files
committed
Merge bitcoin-core/secp256k1#1401: ci, gha: Run all MSVC tests on Windows natively
d78bec7 ci: Remove Windows MSVC tasks from Cirrus CI (Hennadii Stepanov) 3545dc2 ci, gha: Run all MSVC tests on Windows natively (Hennadii Stepanov) Pull request description: ACKs for top commit: real-or-random: ACK d78bec7 jonasnick: ACK d78bec7 Tree-SHA512: b58162a9f0827dceb1c7eb6fb7c759c0bffcf3e0d24cc7e6628ad71d1faaabaffb9d8de6fcd3d07bfcaca409632a13f711f9ad871a30718139557544cf91b4bf
2 parents de657c2 + d78bec7 commit 060e32c

File tree

4 files changed

+38
-74
lines changed

4 files changed

+38
-74
lines changed

.cirrus.yml

-43
Original file line numberDiff line numberDiff line change
@@ -208,48 +208,6 @@ task:
208208
- ./ci/cirrus.sh
209209
<< : *CAT_LOGS
210210

211-
task:
212-
<< : *LINUX_CONTAINER
213-
env:
214-
WRAPPER_CMD: wine
215-
WERROR_CFLAGS: -WX
216-
WITH_VALGRIND: no
217-
ECDH: yes
218-
RECOVERY: yes
219-
EXPERIMENTAL: yes
220-
SCHNORRSIG: yes
221-
ELLSWIFT: yes
222-
CTIMETESTS: no
223-
# Use a MinGW-w64 host to tell ./configure we're building for Windows.
224-
# This will detect some MinGW-w64 tools but then make will need only
225-
# the MSVC tools CC, AR and NM as specified below.
226-
HOST: x86_64-w64-mingw32
227-
CC: /opt/msvc/bin/x64/cl
228-
AR: /opt/msvc/bin/x64/lib
229-
NM: /opt/msvc/bin/x64/dumpbin -symbols -headers
230-
# Set non-essential options that affect the CLI messages here.
231-
# (They depend on the user's taste, so we don't want to set them automatically in configure.ac.)
232-
CFLAGS: -nologo -diagnostics:caret
233-
LDFLAGS: -Xlinker -Xlinker -Xlinker -nologo
234-
matrix:
235-
- name: "x86_64 (MSVC): Windows (Debian stable, Wine)"
236-
- name: "x86_64 (MSVC): Windows (Debian stable, Wine, int128_struct)"
237-
env:
238-
WIDEMUL: int128_struct
239-
- name: "x86_64 (MSVC): Windows (Debian stable, Wine, int128_struct with __(u)mulh)"
240-
env:
241-
WIDEMUL: int128_struct
242-
CPPFLAGS: -DSECP256K1_MSVC_MULH_TEST_OVERRIDE
243-
- name: "i686 (MSVC): Windows (Debian stable, Wine)"
244-
env:
245-
HOST: i686-w64-mingw32
246-
CC: /opt/msvc/bin/x86/cl
247-
AR: /opt/msvc/bin/x86/lib
248-
NM: /opt/msvc/bin/x86/dumpbin -symbols -headers
249-
test_script:
250-
- ./ci/cirrus.sh
251-
<< : *CAT_LOGS
252-
253211
# Sanitizers
254212
task:
255213
<< : *LINUX_CONTAINER
@@ -343,4 +301,3 @@ task:
343301
test_script:
344302
- g++ -Werror include/*.h
345303
- clang -Werror -x c++-header include/*.h
346-
- /opt/msvc/bin/x64/cl.exe -c -WX -TP include/*.h

.github/workflows/ci.yml

+36-3
Original file line numberDiff line numberDiff line change
@@ -97,32 +97,65 @@ jobs:
9797
if: ${{ always() }}
9898

9999
win64-native:
100-
name: "x86_64: Windows, VS 2022"
100+
name: ${{ matrix.configuration.job_name }}
101101
# See: https://github.com/actions/runner-images#available-images.
102102
runs-on: windows-2022
103103

104104
strategy:
105105
fail-fast: false
106106
matrix:
107-
lib_type: ['shared', 'static']
107+
configuration:
108+
- job_name: 'x64 (MSVC): Windows (VS 2022, shared)'
109+
cmake_options: '-A x64 -DBUILD_SHARED_LIBS=ON'
110+
- job_name: 'x64 (MSVC): Windows (VS 2022, static)'
111+
cmake_options: '-A x64 -DBUILD_SHARED_LIBS=OFF'
112+
- job_name: 'x64 (MSVC): Windows (VS 2022, int128_struct)'
113+
cmake_options: '-A x64 -DSECP256K1_TEST_OVERRIDE_WIDE_MULTIPLY=int128_struct'
114+
- job_name: 'x64 (MSVC): Windows (VS 2022, int128_struct with __(u)mulh)'
115+
cmake_options: '-A x64 -DSECP256K1_TEST_OVERRIDE_WIDE_MULTIPLY=int128_struct'
116+
cpp_flags: '/DSECP256K1_MSVC_MULH_TEST_OVERRIDE'
117+
- job_name: 'x86 (MSVC): Windows (VS 2022)'
118+
cmake_options: '-A Win32'
108119

109120
steps:
110121
- name: Checkout
111122
uses: actions/checkout@v3
112123

113124
- name: Generate buildsystem
114-
run: cmake -E env CFLAGS="/WX" cmake -B build -A x64 -DSECP256K1_ENABLE_MODULE_RECOVERY=ON -DSECP256K1_BUILD_EXAMPLES=ON -DBUILD_SHARED_LIBS=${{ matrix.lib_type == 'shared' && 'ON' || 'OFF' }}
125+
run: cmake -E env CFLAGS="/WX ${{ matrix.configuration.cpp_flags }}" cmake -B build -DSECP256K1_ENABLE_MODULE_RECOVERY=ON -DSECP256K1_BUILD_EXAMPLES=ON ${{ matrix.configuration.cmake_options }}
115126

116127
- name: Build
117128
run: cmake --build build --config RelWithDebInfo -- /p:UseMultiToolTask=true /maxCpuCount
118129

130+
- name: Binaries info
131+
# Use the bash shell included with Git for Windows.
132+
shell: bash
133+
run: |
134+
cd build/src/RelWithDebInfo && file *tests.exe bench*.exe libsecp256k1-*.dll || true
135+
119136
- name: Check
120137
run: |
121138
ctest -C RelWithDebInfo --test-dir build -j ([int]$env:NUMBER_OF_PROCESSORS + 1)
122139
build\src\RelWithDebInfo\bench_ecmult.exe
123140
build\src\RelWithDebInfo\bench_internal.exe
124141
build\src\RelWithDebInfo\bench.exe
125142
143+
win64-native-headers:
144+
name: "x64 (MSVC): C++ (public headers)"
145+
# See: https://github.com/actions/runner-images#available-images.
146+
runs-on: windows-2022
147+
148+
steps:
149+
- name: Checkout
150+
uses: actions/checkout@v3
151+
152+
- name: Add cl.exe to PATH
153+
uses: ilammy/msvc-dev-cmd@v1
154+
155+
- name: C++ (public headers)
156+
run: |
157+
cl.exe -c -WX -TP include/*.h
158+
126159
sage:
127160
name: "SageMath prover"
128161
runs-on: ubuntu-latest

ci/cirrus.sh

-10
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,6 @@ print_environment() {
3131
}
3232
print_environment
3333

34-
# Start persistent wineserver if necessary.
35-
# This speeds up jobs with many invocations of wine (e.g., ./configure with MSVC) tremendously.
36-
case "$WRAPPER_CMD" in
37-
*wine*)
38-
# Make sure to shutdown wineserver whenever we exit.
39-
trap "wineserver -k || true" EXIT INT HUP
40-
wineserver -p
41-
;;
42-
esac
43-
4434
env >> test_env.log
4535

4636
# If gcc is requested, assert that it's in fact gcc (and not some symlinked Apple clang).

ci/linux-debian.Dockerfile

+2-18
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
2121
gcc-aarch64-linux-gnu libc6-dev-arm64-cross libc6-dbg:arm64 \
2222
gcc-powerpc64le-linux-gnu libc6-dev-ppc64el-cross libc6-dbg:ppc64el \
2323
gcc-mingw-w64-x86-64-win32 wine64 wine \
24-
gcc-mingw-w64-i686-win32 wine32
24+
gcc-mingw-w64-i686-win32 wine32 \
25+
python3
2526

2627
WORKDIR /root
2728

@@ -55,20 +56,3 @@ RUN wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.
5556
# Create symlinks for them
5657
ln -s $(ls /usr/bin/clang-?? | sort | tail -1) /usr/bin/clang-snapshot && \
5758
ln -s $(ls /usr/bin/clang-?? | sort | head -1) /usr/bin/clang
58-
59-
# The "wine" package provides a convenience wrapper that we need
60-
RUN apt-get update && apt-get install --no-install-recommends -y \
61-
git ca-certificates wine64 wine python3-simplejson python3-six msitools winbind procps && \
62-
# Workaround for `wine` package failure to employ the Debian alternatives system properly.
63-
ln -s /usr/lib/wine/wine64 /usr/bin/wine64 && \
64-
# Set of tools for using MSVC on Linux.
65-
git clone https://github.com/mstorsjo/msvc-wine && \
66-
mkdir /opt/msvc && \
67-
python3 msvc-wine/vsdownload.py --accept-license --dest /opt/msvc Microsoft.VisualStudio.Workload.VCTools && \
68-
# Since commit 2146cbfaf037e21de56c7157ec40bb6372860f51, the
69-
# msvc-wine effectively initializes the wine prefix when running
70-
# the install.sh script.
71-
msvc-wine/install.sh /opt/msvc && \
72-
# Wait until the wineserver process has exited before closing the session,
73-
# to avoid corrupting the wine prefix.
74-
while (ps -A | grep wineserver) > /dev/null; do sleep 1; done

0 commit comments

Comments
 (0)