Skip to content

Commit 0e278d5

Browse files
authored
Merge pull request #138 from BitgesellOfficial/release-0.1.13
Release 0.1.13
2 parents ea2b732 + 2f7d635 commit 0e278d5

File tree

831 files changed

+25382
-28227
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

831 files changed

+25382
-28227
lines changed

.cirrus.yml

+163-86
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,80 @@
11
env:
22
### cirrus config
33
CIRRUS_CLONE_DEPTH: 1
4-
PACKAGE_MANAGER_INSTALL: "apt-get update && apt-get install -y"
5-
MAKEJOBS: "-j10"
6-
TEST_RUNNER_PORT_MIN: "14000" # Must be larger than 12321, which is used for the http cache. See https://cirrus-ci.org/guide/writing-tasks/#http-cache
7-
CI_FAILFAST_TEST_LEAVE_DANGLING: "1" # Cirrus CI does not care about dangling processes and setting this variable avoids killing the CI script itself on error
8-
CCACHE_MAXSIZE: "200M"
9-
CCACHE_DIR: "/tmp/ccache_dir"
10-
CCACHE_NOHASHDIR: "1" # Debug info might contain a stale path if the build dir changes, but this is fine
4+
### compiler options
5+
HOST:
6+
WRAPPER_CMD:
7+
# Specific warnings can be disabled with -Wno-error=foo.
8+
# -pedantic-errors is not equivalent to -Werror=pedantic and thus not implied by -Werror according to the GCC manual.
9+
WERROR_CFLAGS: -Werror -pedantic-errors
10+
MAKEFLAGS: -j4
11+
BUILD: check
12+
### secp256k1 config
13+
ECMULTWINDOW: 15
14+
ECMULTGENKB: 22
15+
ASM: no
16+
WIDEMUL: auto
17+
WITH_VALGRIND: yes
18+
EXTRAFLAGS:
19+
### secp256k1 modules
20+
EXPERIMENTAL: no
21+
ECDH: no
22+
RECOVERY: no
23+
SCHNORRSIG: no
24+
ELLSWIFT: no
25+
### test options
26+
SECP256K1_TEST_ITERS:
27+
BENCH: yes
28+
SECP256K1_BENCH_ITERS: 2
29+
CTIMETESTS: yes
30+
# Compile and run the tests
31+
EXAMPLES: yes
1132

33+
# A self-hosted machine(s) can be used via Cirrus CI. It can be configured with
34+
# multiple users to run tasks in parallel. No sudo permission is required.
35+
#
1236
# https://cirrus-ci.org/guide/persistent-workers/
1337
#
14-
# It is possible to select a specific persistent worker by label. Refer to the
38+
# Generally, a persistent worker must run Ubuntu 23.04+ or Debian 12+.
39+
#
40+
# The following specific types should exist, with the following requirements:
41+
# - small: For an x86_64 machine, recommended to have 2 CPUs and 8 GB of memory.
42+
# - medium: For an x86_64 machine, recommended to have 4 CPUs and 16 GB of memory.
43+
# - arm64: For an aarch64 machine, recommended to have 2 CPUs and 8 GB of memory.
44+
#
45+
# CI jobs for the latter configuration can be run on x86_64 hardware
46+
# by installing qemu-user-static, which works out of the box with
47+
# podman or docker. Background: https://stackoverflow.com/a/72890225/313633
48+
#
49+
# The above machine types are matched to each task by their label. Refer to the
1550
# Cirrus CI docs for more details.
1651
#
17-
# Generally, a persistent worker must run Ubuntu 23.04+ or Debian 12+.
18-
# Specifically,
52+
# When a contributor maintains a fork of the repo, any pull request they make
53+
# to their own fork, or to the main repository, will trigger two CI runs:
54+
# one for the branch push and one for the pull request.
55+
# This can be avoided by setting SKIP_BRANCH_PUSH=true as a custom env variable
56+
# in Cirrus repository settings, accessible from
57+
# https://cirrus-ci.com/github/my-organization/my-repository
58+
#
59+
# On machines that are persisted between CI jobs, RESTART_CI_DOCKER_BEFORE_RUN=1
60+
# ensures that previous containers and artifacts are cleared before each run.
61+
# This requires installing Podman instead of Docker.
62+
#
63+
# Futhermore:
1964
# - apt-get is required due to PACKAGE_MANAGER_INSTALL
20-
# - podman-docker-4.1+ is required due to the use of `podman` when
21-
# RESTART_CI_DOCKER_BEFORE_RUN is set and 4.1+ due to the bugfix in 4.1
65+
# - podman-docker-4.1+ is required due to the bugfix in 4.1
2266
# (https://github.com/bitcoin/bitcoin/pull/21652#issuecomment-1657098200)
23-
# - The ./ci/ depedencies (with cirrus-cli) should be installed:
67+
# - The ./ci/ dependencies (with cirrus-cli) should be installed. One-liner example
68+
# for a single user setup with sudo permission:
2469
#
2570
# ```
2671
# apt update && apt install git screen python3 bash podman-docker curl -y && curl -L -o cirrus "https://github.com/cirruslabs/cirrus-cli/releases/latest/download/cirrus-linux-$(dpkg --print-architecture)" && mv cirrus /usr/local/bin/cirrus && chmod +x /usr/local/bin/cirrus
2772
# ```
2873
#
29-
# - There are no strict requirements on the hardware, because having less CPUs
30-
# runs the same CI script (maybe slower). To avoid rare and intermittent OOM
31-
# due to short memory usage spikes, it is recommended to add (and persist)
32-
# swap:
74+
# - There are no strict requirements on the hardware. Having fewer CPU threads
75+
# than recommended merely causes the CI script to run slower.
76+
# To avoid rare and intermittent OOM due to short memory usage spikes,
77+
# it is recommended to add (and persist) swap:
3378
#
3479
# ```
3580
# fallocate -l 16G /swapfile_ci && chmod 600 /swapfile_ci && mkswap /swapfile_ci && swapon /swapfile_ci && ( echo '/swapfile_ci none swap sw 0 0' | tee -a /etc/fstab )
@@ -40,16 +85,13 @@ env:
4085
# ```
4186
# RESTART_CI_DOCKER_BEFORE_RUN=1 screen cirrus worker run --labels type=todo_fill_in_type --token todo_fill_in_token
4287
# ```
43-
#
44-
# The following specific types should exist, with the following requirements:
45-
# - small: For an x86_64 machine, recommended to have 2 CPUs and 8 GB of memory.
46-
# - medium: For an x86_64 machine, recommended to have 4 CPUs and 16 GB of memory.
47-
# - noble: For a machine running the Linux kernel shipped with exaclty Ubuntu Noble 24.04. The machine is recommended to have 4 CPUs and 16 GB of memory.
48-
# - arm64: For an aarch64 machine, recommended to have 2 CPUs and 8 GB of memory.
4988

5089
# https://cirrus-ci.org/guide/tips-and-tricks/#sharing-configuration-between-tasks
5190
filter_template: &FILTER_TEMPLATE
52-
skip: $CIRRUS_REPO_FULL_NAME == "BGL-core/gui" && $CIRRUS_PR == "" # No need to run on the read-only mirror, unless it is a PR. https://cirrus-ci.org/guide/writing-tasks/#conditional-task-execution
91+
# Allow forks to specify SKIP_BRANCH_PUSH=true and skip CI runs when a branch is pushed,
92+
# but still run CI when a PR is created.
93+
# https://cirrus-ci.org/guide/writing-tasks/#conditional-task-execution
94+
skip: $SKIP_BRANCH_PUSH == "true" && $CIRRUS_PR == ""
5395
stateful: false # https://cirrus-ci.org/guide/writing-tasks/#stateful-tasks
5496

5597
base_template: &BASE_TEMPLATE
@@ -58,43 +100,54 @@ base_template: &BASE_TEMPLATE
58100
# Unconditionally install git (used in fingerprint_script).
59101
- git --version || bash -c "$PACKAGE_MANAGER_INSTALL git"
60102
- if [ "$CIRRUS_PR" = "" ]; then exit 0; fi
61-
- git fetch --depth=1 $CIRRUS_REPO_CLONE_URL "pull/${CIRRUS_PR}/merge"
62-
- git checkout FETCH_HEAD # Use merged changes to detect silent merge conflicts
63-
# Also, the merge commit is used to lint COMMIT_RANGE="HEAD~..HEAD"
64-
65-
main_template: &MAIN_TEMPLATE
66-
timeout_in: 120m # https://cirrus-ci.org/faq/#instance-timed-out
67-
ci_script:
68-
- ./ci/test_run_all.sh
103+
- git fetch $CIRRUS_REPO_CLONE_URL $CIRRUS_BASE_BRANCH
104+
- git config --global user.email "[email protected]"
105+
- git config --global user.name "ci"
106+
- git merge FETCH_HEAD # Merge base to detect silent merge conflicts
69107

70-
global_task_template: &GLOBAL_TASK_TEMPLATE
71-
<< : *BASE_TEMPLATE
72-
<< : *MAIN_TEMPLATE
108+
env_matrix_snippet: &ENV_MATRIX_VALGRIND
109+
- env:
110+
ENABLE_FIELDS: "7,32,58"
111+
- env:
112+
BUILD: distcheck
113+
- env:
114+
EXEC_CMD: valgrind --error-exitcode=42
115+
TESTRUNS: 1
116+
BUILD:
73117

74-
compute_credits_template: &CREDITS_TEMPLATE
75-
# https://cirrus-ci.org/pricing/#compute-credits
76-
# Only use credits for pull requests to the main repo
77-
use_compute_credits: $CIRRUS_REPO_FULL_NAME == 'BGL/BGL' && $CIRRUS_PR != ""
118+
env_matrix_snippet: &ENV_MATRIX_SAN_VALGRIND
119+
- env:
120+
ENABLE_FIELDS: "11,64,37"
121+
- env:
122+
BUILD: distcheck
123+
- env:
124+
EXEC_CMD: valgrind --error-exitcode=42
125+
TESTRUNS: 1
126+
BUILD:
127+
- env:
128+
CXXFLAGS: "-fsanitize=undefined -fno-omit-frame-pointer"
129+
LDFLAGS: "-fsanitize=undefined -fno-omit-frame-pointer"
130+
UBSAN_OPTIONS: "print_stacktrace=1:halt_on_error=1"
131+
BENCH: no
78132

79133
task:
80134
name: 'lint'
81135
<< : *BASE_TEMPLATE
82136
container:
83-
image: debian:bookworm
84-
cpu: 1
85-
memory: 1G
86-
# For faster CI feedback, immediately schedule the linters
87-
<< : *CREDITS_TEMPLATE
88-
test_runner_cache:
89-
folder: "/lint_test_runner"
90-
fingerprint_script: echo $CIRRUS_TASK_NAME $(git rev-parse HEAD:test/lint/test_runner)
91-
python_cache:
92-
folder: "/python_build"
93-
fingerprint_script: cat .python-version /etc/os-release
94-
unshallow_script:
95-
- git fetch --unshallow --no-tags
96-
lint_script:
97-
- ./ci/lint_run_all.sh
137+
dockerfile: ci/linux-debian.Dockerfile
138+
memory: 2G
139+
cpu: 4
140+
matrix:
141+
<< : *ENV_MATRIX_SAN_VALGRIND
142+
matrix:
143+
- env:
144+
CXX: g++
145+
- env:
146+
CXX: clang++ -gdwarf-4
147+
<< : *MERGE_BASE
148+
test_script:
149+
- ./ci/cirrus.sh
150+
<< : *CAT_LOGS
98151

99152
task:
100153
name: 'tidy'
@@ -103,16 +156,54 @@ task:
103156
labels:
104157
type: medium
105158
env:
106-
FILE_ENV: "./ci/test/00_setup_env_native_tidy.sh"
159+
HOST: i686-linux-gnu
160+
matrix:
161+
<< : *ENV_MATRIX_VALGRIND
162+
matrix:
163+
- env:
164+
CXX: i686-linux-gnu-g++
165+
- env:
166+
CXX: clang++ --target=i686-linux-gnu -gdwarf-4
167+
CXXFLAGS: -g -O2 -isystem /usr/i686-linux-gnu/include -isystem /usr/i686-linux-gnu/include/c++/10/i686-linux-gnu
168+
test_script:
169+
- ./ci/cirrus.sh
170+
<< : *CAT_LOGS
107171

108172
task:
109-
name: 'ARM, unit tests, no functional tests'
110-
<< : *GLOBAL_TASK_TEMPLATE
111-
persistent_worker:
112-
labels:
113-
type: arm64 # Use arm64 worker to sidestep qemu and avoid a slow CI: https://github.com/bitcoin/bitcoin/pull/28087#issuecomment-1649399453
173+
name: "arm64: macOS Monterey"
174+
macos_instance:
175+
image: ghcr.io/cirruslabs/macos-monterey-base:latest
114176
env:
115-
FILE_ENV: "./ci/test/00_setup_env_arm.sh"
177+
# Cirrus gives us a fixed number of 4 virtual CPUs.
178+
MAKEFLAGS: -j5
179+
matrix:
180+
- env:
181+
CXX: g++-11
182+
# Homebrew's gcc for arm64 has no libubsan.
183+
matrix:
184+
- env:
185+
ENABLE_FIELDS: 28
186+
- env:
187+
BUILD: distcheck
188+
- env:
189+
CXX: clang++
190+
matrix:
191+
- env:
192+
ENABLE_FIELDS: 28
193+
- env:
194+
BUILD: distcheck
195+
- env:
196+
CXXFLAGS: "-fsanitize=undefined -fno-omit-frame-pointer"
197+
LDFLAGS: "-fsanitize=undefined -fno-omit-frame-pointer"
198+
UBSAN_OPTIONS: "print_stacktrace=1:halt_on_error=1"
199+
BENCH: no
200+
brew_script:
201+
- brew update
202+
- brew install automake libtool gcc@11
203+
<< : *MERGE_BASE
204+
test_script:
205+
- ./ci/cirrus.sh
206+
<< : *CAT_LOGS
116207

117208
task:
118209
name: 'Win64, unit tests, no gui tests, no functional tests'
@@ -121,7 +212,13 @@ task:
121212
labels:
122213
type: small
123214
env:
124-
FILE_ENV: "./ci/test/00_setup_env_win64.sh"
215+
EXEC_CMD: qemu-s390x
216+
HOST: s390x-linux-gnu
217+
BUILD:
218+
<< : *MERGE_BASE
219+
test_script:
220+
- ./ci/cirrus.sh
221+
<< : *CAT_LOGS
125222

126223
task:
127224
name: '32-bit CentOS, dash, gui'
@@ -160,19 +257,6 @@ task:
160257
env:
161258
FILE_ENV: "./ci/test/00_setup_env_native_msan.sh"
162259

163-
task:
164-
name: 'ASan + LSan + UBSan + integer, no depends, USDT'
165-
enable_bpfcc_script:
166-
# In the image build step, no external environment variables are available,
167-
# so any settings will need to be written to the settings env file:
168-
- sed -i "s|\${CIRRUS_CI}|true|g" ./ci/test/00_setup_env_native_asan.sh
169-
<< : *GLOBAL_TASK_TEMPLATE
170-
persistent_worker:
171-
labels:
172-
type: noble # Must use this specific worker (needed for USDT functional tests)
173-
env:
174-
FILE_ENV: "./ci/test/00_setup_env_native_asan.sh"
175-
176260
task:
177261
name: 'fuzzer,address,undefined,integer, no depends'
178262
<< : *GLOBAL_TASK_TEMPLATE
@@ -192,20 +276,13 @@ task:
192276
FILE_ENV: "./ci/test/00_setup_env_i686_multiprocess.sh"
193277

194278
task:
195-
name: "ARM64: Linux (Debian stable)"
279+
name: 'no wallet, libBGLkernel'
280+
<< : *GLOBAL_TASK_TEMPLATE
196281
persistent_worker:
197282
labels:
198-
type: arm64
283+
type: small
199284
env:
200-
ECDH: yes
201-
RECOVERY: yes
202-
SCHNORRSIG: yes
203-
ELLSWIFT: yes
204-
matrix:
205-
# Currently only gcc-snapshot, the other compilers are tested on GHA with QEMU
206-
- env: { CC: 'gcc-snapshot' }
207-
<< : *LINUX_ARM64_CONTAINER
208-
<< : *CAT_LOGS
285+
FILE_ENV: "./ci/test/00_setup_env_native_nowallet_libBGLkernel.sh"
209286

210287
task:
211288
name: 'macOS-cross, gui, no tests'

.github/actions/install-homebrew-valgrind/action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ runs:
1616
cat valgrind_fingerprint
1717
shell: bash
1818
19-
- uses: actions/cache@v3
19+
- uses: actions/cache@v4
2020
id: cache
2121
with:
2222
path: ${{ env.CI_HOMEBREW_CELLAR_VALGRIND }}

.github/actions/run-in-docker-action/action.yml

+5
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ runs:
3636
load: true
3737
cache-from: type=gha
3838

39+
- # Workaround for https://github.com/google/sanitizers/issues/1614 .
40+
# The underlying issue has been fixed in clang 18.1.3.
41+
run: sudo sysctl -w vm.mmap_rnd_bits=28
42+
shell: bash
43+
3944
- # Tell Docker to pass environment variables in `env` into the container.
4045
run: >
4146
docker run \

0 commit comments

Comments
 (0)