Commit Graph

728 Commits

Author SHA1 Message Date
MarcoFalke
fa474397b5
ci: Add missing linux-headers package to ASan task
Otherwise the task will throw in skip_if_no_python_bcc.

Also, adjust CI_CONTAINER_CAP for all needed permissions.
2023-08-01 17:33:36 +02:00
Jon Atack
bee2d57a65 script: update flake8 to 6.1.0
and touch up the spelling returned by lint-spelling.py
2023-07-31 12:14:06 -06:00
Hennadii Stepanov
79ceb161db
ci: Use documented CCACHE_MAXSIZE instead of CCACHE_SIZE
This change aims to:
1) Remove our own `CCACHE_SIZE` environment variable that violates
Ccache's `CCACHE_*` namespace.
2) Introduce the `CCACHE_MAXSIZE` environment variable that is
documented since v3.3, which makes its usage consistent with other ones,
such as `CCACHE_DIR` and `CCACHE_NOHASHDIR`.
2023-07-30 21:36:56 +01:00
fanquake
4c57e53a61
Merge bitcoin/bitcoin#28138: ci: Keep system env vars as-is (bugfix)
fabc04a4d9 ci: Keep system env vars as-is (MarcoFalke)
fa8dcdcc8b ci: Set PATH inside the CI env (MarcoFalke)
fac229ab1f ci: Remove P_CI_DIR and --workdir (MarcoFalke)

Pull request description:

  This fixes a bug where the `$PATH` from the host is used inside the container. This will lead to bugs when the `$PATH` is different. For example on a host of Fedora 38, and a container of `debian:bullseye`.

  This can be tested with the `FILE_ENV=./ci/test/00_setup_env_arm.sh` CI env. On master:

  ```
  Error: crun: executable file `bash` not found in $PATH: No such file or directory: OCI runtime attempted to invoke a command that was not found
  ```

  On this pull:

  (everything passes)

ACKs for top commit:
  TheCharlatan:
    lgtm ACK fabc04a4d9

Tree-SHA512: 51d2affed91624d0e5b43a3ee1e696313f934e05fde6b5a19e8ac4e6666c1e7b667a444bf3de3f77190bcd00e81efb7576196afb0f6b5e788d1a50e7ddb28d7e
2023-07-28 15:56:14 +01:00
fanquake
04f66ce500
Merge bitcoin/bitcoin#28092: ci: document that -Wreturn-type has been fixed upstream (mingw-w64)
08eb5f1b67 ci: document that -Wreturn-type has been fixed upstream (Windows) (fanquake)

Pull request description:

  `noreturn` attributes have been added to the mingw-w64 headers, 1690994f51, meaning that [from 11.0.0 onwards](https://www.mingw-w64.org/changelog/), you'll no-longer see `-Wreturn-type` warnings when using `assert(false)`.

  Add -Wno-return-type to the Windows CI, where is should have been all
  along, and document why it's required. This can be dropped when we are
  using the fixed version of the mingw-w64 headers there.

  Drop the -Werror -Wno-return-type special case from our build system.
  -Wreturn-type is on by default in Clang and GCC.

  The new mingw-w64 header behaviour can be checked on Ubuntu mantic, [which ships with 11.0.0](https://packages.ubuntu.com/mantic/mingw-w64), using:
  ```cpp
  #include <cassert>

  int f(){ assert(false); }

  int main() {
  return 0;
  }
  ```

  On Mantic (with 11.0.0):
  ```bash
  x86_64-w64-mingw32-g++ test.cpp -Wreturn-type
  # nada
  ```

  On Lunar ([with 10.0.0](https://packages.ubuntu.com/lunar/mingw-w64)):
  ```bash
  x86_64-w64-mingw32-g++ test.cpp -Wreturn-type
  test.cpp: In function 'int f()':
  test.cpp:3:25: warning: no return statement in function returning non-void [-Wreturn-type]
      3 | int f(){ assert(false); }
        |                         ^
  ```

ACKs for top commit:
  TheCharlatan:
    ACK 08eb5f1b67

Tree-SHA512: 9cd4310a96abd87bf8ceb37949ad0259fe4adee3367c604f4c4ad521a0cf09bdcc5dd305db19a0f45ce74c85178b0d739e2fca5ad0fc841ac935523a23b28a7f
2023-07-27 11:21:49 +01:00
MarcoFalke
fabc04a4d9
ci: Keep system env vars as-is 2023-07-24 16:14:24 +02:00
MarcoFalke
fa8dcdcc8b
ci: Set PATH inside the CI env
This is needed for the next commit.

This also requires dropping CI_RETRY from the docker build step, which
is fine, because CI_RETRY should be called inside the build script, not
outside.

Also, fix a doc typo.
2023-07-24 16:14:24 +02:00
MarcoFalke
fac229ab1f
ci: Remove P_CI_DIR and --workdir
The --workdir setting to the docker run command is not needed. And
P_CI_DIR/PWD is equal to BASE_ROOT_DIR, so just use that directly.
2023-07-24 16:10:47 +02:00
MarcoFalke
ffff4b5dc5
lint: Add missing set -ex to ci/lint/06_script.sh
This is needed for the container-entrypoint.sh

Also, remove unused `source` from ci/lint_run_all.sh, since it is the
last step.
2023-07-19 11:39:50 +02:00
MarcoFalke
fadc5232f4
doc: Add doc comment to ci/test_imagefile
(Similar to the doc comment in ci/lint_imagefile)

Also, rename docker-entrypoint.sh to container-entrypoint.sh

Also, add copyright header to touched files.
2023-07-19 11:27:28 +02:00
fanquake
08eb5f1b67
ci: document that -Wreturn-type has been fixed upstream (Windows)
`noreturn` attributes have been added to the mingw-w64 headers, meaning
that from 11.0.0 onwards, you'll no-longer see `-Wreturn-type` warnings
when using assert(false):
1690994f51.

Add -Wno-return-type to the Windows CI, where is should have been all
along, and document why it's required. This can be dropped when we are
using the fixed version of the mingw-w64 headers there.

Drop the -Werror -Wno-return-type special case from our build system.
-Wreturn-type is on by default in Clang and GCC.
2023-07-18 14:27:30 +01:00
MarcoFalke
fa2f18ad8e
ci: Use DOCKER_BUILDKIT for lint image
Can be reviewed with:
--color-moved=dimmed-zebra  --ignore-all-space
2023-07-16 13:18:18 +02:00
MarcoFalke
fa4ccf1511
ci: Add missing -O2 to valgrind tasks 2023-07-12 15:41:49 +02:00
MarcoFalke
fa956d2048
ci: Print full lscpu output 2023-07-06 11:13:05 +02:00
fanquake
3367e1c850
Merge bitcoin/bitcoin#28009: script, test: python typing and linter updates
6c97757a48 script: appease spelling linter (Jon Atack)
1316119ce7 script: update ignored-words.txt (Jon Atack)
146c861da2 script: update linter dependencies (Jon Atack)
92408224a4 test: fix PEP484 no implicit optional argument types errors (Jon Atack)
f86a301433 script, test: add missing python type annotations (Jon Atack)

Pull request description:

  With these updates, `./test/lint/lint-python.py` and `./test/lint/lint-spelling.py` should be green again for developers using relatively recent Python dependencies, in particular mypy 0.991 (released 11/2022) and later. Please see the commit messages for details.

ACKs for top commit:
  fanquake:
    ACK 6c97757a48

Tree-SHA512: 8a46a4d36d5978affdcecf4f2ace20ca1b52d483e098304911a2169afe60ccb9b042fa90c04b762d94f3ce53d2cafe6f24476ae839867a770c7f31e7e7242d99
2023-06-30 16:20:37 +01:00
fanquake
9be4565c2d
ci: re-enable gui tests for s390x
These work for me now. If they still don't work in other setups,
maybe we can better document the issues.

```bash
time FILE_ENV="./ci/test/00_setup_env_s390x.sh" ./ci/test_run_all.sh
...
Running tests: coins_tests from test/coins_tests.cpp
PASS: qt/test/test_bitcoin-qt
Running tests: coinstatsindex_tests from test/coinstatsindex_tests.cpp
...
Stop and remove CI container by ID
+ docker container kill 617bef8accb87530e5fbb03ff07b3b9f0aa9e3030d4da424c9612d153ab98dbf
617bef8accb87530e5fbb03ff07b3b9f0aa9e3030d4da424c9612d153ab98dbf

real	51m37.809s
```
2023-06-30 11:15:57 +01:00
Jon Atack
146c861da2 script: update linter dependencies 2023-06-29 16:14:07 -06:00
fanquake
c6287faae4
Merge bitcoin/bitcoin#27996: ci: filter all subtrees from tidy output
62633b5046 ci: filter all subtrees from tidy output (fanquake)

Pull request description:

  We are currently dumping output for some. i.e:
  ```bash
  diff --git a/src/minisketch/src/fields/clmul_1byte.cpp b/src/minisketch/src/fields/clmul_1byte.cpp
  index 8826af9..7fd6f2a 100644
  --- a/src/minisketch/src/fields/clmul_1byte.cpp
  +++ b/src/minisketch/src/fields/clmul_1byte.cpp
  @@ -4,21 +4,16 @@
    * file LICENSE or http://www.opensource.org/licenses/mit-license.php.*
    **********************************************************************/

  -/* This file was substantially auto-generated by doc/gen_params.sage. */
  -#include "../fielddefines.h"
  -
  +class Sketch;
   #if defined(ENABLE_FIELD_BYTES_INT_1)
  ```

ACKs for top commit:
  hebasto:
    re-ACK 62633b5046

Tree-SHA512: fd0a17af6b37fc7641547dab329c2d14ec784941c4d100db1e80d232aff39e45ad9c588982810a2cfc54b4fe820bfe0d50638b53209fec6774fd556b9b0ae180
2023-06-29 13:35:47 +01:00
fanquake
3d51f7c9a8
Merge bitcoin/bitcoin#27932: test: Fuzz on macOS
fae7c50d20 test: Run fuzz tests on macOS (MarcoFalke)

Pull request description:

  Any reason not to?

ACKs for top commit:
  jamesob:
    Github ACK fae7c50d20
  dergoegge:
    utACK fae7c50d20

Tree-SHA512: e45122d73fafb17cea312258314b826cb0745e08daadd28465f687ec02d4c127d2f8cbe20179a9fff5712038850c02c968abb4838fa088b7555e28709317d3a3
2023-06-29 13:08:58 +01:00
fanquake
62633b5046
ci: filter all subtrees from tidy output
We are currently dumping output for some. i.e:
```bash
diff --git a/src/minisketch/src/fields/clmul_1byte.cpp b/src/minisketch/src/fields/clmul_1byte.cpp
index 8826af9..7fd6f2a 100644
--- a/src/minisketch/src/fields/clmul_1byte.cpp
+++ b/src/minisketch/src/fields/clmul_1byte.cpp
@@ -4,21 +4,16 @@
  * file LICENSE or http://www.opensource.org/licenses/mit-license.php.*
  **********************************************************************/

-/* This file was substantially auto-generated by doc/gen_params.sage. */
-#include "../fielddefines.h"
-
+class Sketch;
 #if defined(ENABLE_FIELD_BYTES_INT_1)
```
2023-06-29 11:59:31 +01:00
fanquake
248a17addf
ci: remove duplicate python3 from CI configs 2023-06-28 11:10:51 +01:00
fanquake
b50767fdde
ci: remove duplicate bsdmainutils from CI configs 2023-06-28 10:07:51 +01:00
Andrew Chow
caff95a023
Merge bitcoin/bitcoin#27896: Remove the syscall sandbox
32e2ffc393 Remove the syscall sandbox (fanquake)

Pull request description:

  After initially being merged in #20487, it's no-longer clear that an internal syscall sandboxing mechanism is something that Bitcoin Core should have/maintain, especially when compared to better maintained/supported alterantives, i.e [firejail](https://github.com/netblue30/firejail).

  There is more related discussion in #24771.

  Note that given where it's used, the sandbox also gets dragged into the kernel.

  If it's removed, this should not require any sort of deprecation, as this was only ever an opt-in, experimental feature.

  Closes #24771.

ACKs for top commit:
  davidgumberg:
     crACK 32e2ffc393
  achow101:
    ACK 32e2ffc393
  dergoegge:
    ACK 32e2ffc393

Tree-SHA512: 8cf71c5623bb642cb515531d4a2545d806e503b9d57bfc15a996597632b06103d60d985fd7f843a3c1da6528bc38d0298d6b8bcf0be6f851795a8040d71faf16
2023-06-27 18:19:21 -04:00
MarcoFalke
fae7c50d20
test: Run fuzz tests on macOS
Also, fix a few bugs:

* Error: RPC command "enumeratesigners" not found in RPC_COMMANDS_SAFE_FOR_FUZZING or RPC_COMMANDS_NOT_SAFE_FOR_FUZZING. Please update test/fuzz/rpc.cpp.
* in run_once: ...format(" ".join(result.args), ... TypeError: sequence item 2: expected str instance, PosixPath found
2023-06-22 13:54:17 +02:00
fanquake
0c84a0e484
Merge bitcoin/bitcoin#27798: depends: modernize clang flags for Darwin
cbee1d7091 depends: modernize clang flags (Cory Fields)
2a85857ce5 ci: disable false-positive warnings for now (Cory Fields)

Pull request description:

  This is a cleaner and simpler alternative to #25098. Inspired by [this conversation](https://github.com/bitcoin/bitcoin/pull/27737#issuecomment-1562543301). The diff is large but the change itself is quite small.

  Fixes builds with llvm >= 11 in guix by working around the problem. As a bonus, this is much cleaner and more maintainable than what we had before.

  See the updated comment for more info. At a high level: rather than playing tricks and trying to work around clang's default includes, disable them and re-add what we want.

ACKs for top commit:
  fanquake:
    ACK cbee1d7091 - tested Guix and the depends cross-compile. Would like to move this along, to unblock #27676, which itself might be a blocker for #27897. Note that macOS might seem somewhat in flux for the moment, but once we finish the migration to LLVM Clang + LLD, things will be must simpler, and ultimately more maintainable.
  TheCharlatan:
    ACK cbee1d7091

Tree-SHA512: 5a8300be528f550e15ab23d869e77df7a62201c6d40c0384795a9eecee38118a676e0b79b2b76c5e597597181443caada54a01b75a544dbcde76da1deba8e3a4
2023-06-22 09:47:30 +01:00
fanquake
a596bdf3e9
Merge bitcoin/bitcoin#27919: ci: Run fuzz target even if input folder is empty
0000f55293 ci: Run fuzz target even if input folder is empty (MarcoFalke)

Pull request description:

  This should catch trivial integer sanitizer bugs if the author and all reviewers forget to look for them.

ACKs for top commit:
  brunoerg:
    reACK 0000f55293
  dergoegge:
    reACK 0000f55293

Tree-SHA512: f139b9d56f0cf1aae339c2890721c77c88d1fea77b73d492c1386ec99b4f393c5b664029919ff4a22e4e8a2929f085699a148c6acc2cc3e40df8a72fd39ff474
2023-06-21 10:08:53 +01:00
Cory Fields
2a85857ce5 ci: disable false-positive warnings for now
clang <=17 warns on -nostdlibinc, which causes an error on our -Werror builds.

Note that this breaks the "-fPIE" check in configure because it relies on
catching warnings, but that is not a problem for macOS.
2023-06-20 19:55:02 +00:00
MarcoFalke
0000f55293
ci: Run fuzz target even if input folder is empty 2023-06-20 18:19:01 +02:00
fanquake
682274aab0
ci: install llvm-symbolizer in MSAN jobs 2023-06-20 17:16:22 +01:00
fanquake
96527cd51e
ci: use LLVM 16.0.6 in MSAN jobs 2023-06-20 17:14:06 +01:00
fanquake
32e2ffc393
Remove the syscall sandbox
After initially being merged in #20487, it's no-longer clear that an
internal syscall sandboxing mechanism is something that Bitcoin Core
should have/maintain, especially when compared to better
maintained/supported alterantives, i.e firejail.

Note that given where it's used, the sandbox also gets dragged into the
kernel.

There is some related discussion in #24771.

This should not require any sort of deprecation, as this was only ever
an opt-in, experimental feature.

Closes #24771.
2023-06-16 10:38:19 +01:00
fanquake
3b2acfcfec
build: suppress external warnings by default 2023-06-15 14:12:10 +01:00
MarcoFalke
fa70e85e00
ci: Bump macOS cross task to ubuntu:jammy 2023-06-14 10:49:27 +02:00
MarcoFalke
faaa62754e
ci: Use podman stop over podman kill
This should avoid a race where the kill is not done when spinning up the
new container. podman stop waits 10 seconds by default.
2023-06-09 16:58:38 +02:00
MarcoFalke
fac7f4ab5e
ci: Invalidate Cirrus CI docker cache 2023-06-08 10:28:38 +02:00
fanquake
2ebeb421dd
ci: enable AArch64 target in MSAN jobs
Use Native.
2023-06-05 15:39:51 +01:00
fanquake
c93bfc54e8
ci: use LLVM 16.0.5 in MSAN jobs 2023-06-05 11:23:25 +01:00
fanquake
8a972813ba
Merge bitcoin/bitcoin#27737: ci: compile Clang and compiler-rt in msan jobs
5763b232e6 ci: return to using Ubuntu 22.04 in MSAN jobs (fanquake)
d3cbcbf626 ci: compile clang and compiler-rt in MSAN jobs (fanquake)
796bd1d0d1 ci: use LLVM 16.0.4 in MSAN jobs (fanquake)
883bc9f561 ci: remove extra CC & CXX from MSAN jobs (fanquake)
2d4f4b8f29 ci: standardize custom libc++ usage in MSAN jobs (fanquake)

Pull request description:

  This reworks the MSAN CIs, to first compile Clang and compiler-rt (using GCC 12), and then, compile an MSAN instrumented libc++ using the just-built Clang 16. This fixes the `native_fuzz_with_msan` job, working around https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1005341, by not using the Debian provided Clang/LLVM.

  Also included are changes to streamline how we use our "custom libc++", according to upstream: https://releases.llvm.org/16.0.0/projects/libcxx/docs/UsingLibcxx.html#using-a-custom-built-libc, as well as other minor cleanups in the CI configs.

  An example job is currently running in the qa-assets repo: https://github.com/bitcoin-core/qa-assets/pull/129 (https://cirrus-ci.com/task/4632561431871488).

ACKs for top commit:
  dergoegge:
    utACK 5763b232e6

Tree-SHA512: 4f2a6e0b796bb1830b8346dd1e55eaa86a79037b8b4f16a336c1e29f4fc460acca2ecba076635459370bcbb4009333cb79d27ef1521c1fb5db7599cd5bdf558c
2023-06-02 10:42:05 +01:00
fanquake
f08bde7f71
Merge bitcoin/bitcoin#27778: ci: Enable float-divide-by-zero check
fa3ab45203 ci: Enable float-divide-by-zero check (MarcoFalke)

Pull request description:

  Enable it, because

  * It is enabled on OSS-Fuzz, so to be able to catch bugs earlier, enable it here as well.
  * It makes sense to enable, because when a float is divided by zero, it may be a logic bug in our code, so it should be suppressed in the suppressions file.

ACKs for top commit:
  willcl-ark:
    utACK fa3ab45203
  dergoegge:
    ACK fa3ab45203

Tree-SHA512: 2c2c025af4fe3ec267b3cfa38f25495e9da678cf6c529a6438ec923ef09a06ad37fa4503c30cbacc83578ac2856a7f729ef70a24befffd61d10ec075132d1ee0
2023-05-31 14:42:46 +01:00
fanquake
08722f20c2
Merge bitcoin/bitcoin#27777: ci: Prune dangling images on RESTART_CI_DOCKER_BEFORE_RUN
fa123077bc ci: Use podman for persistent workers (MarcoFalke)
fa9c65a74c ci: Prune dangling images on RESTART_CI_DOCKER_BEFORE_RUN (MarcoFalke)

Pull request description:

  This should prevent the persistent workers from running out of disk space. Containers are already removed, but not images. This is required since CI images are built and cached.

ACKs for top commit:
  hebasto:
    ACK fa123077bc

Tree-SHA512: 07c4faec57d659d1762e4e6d776c882ee48d4bac6ce6d438d56d9ab13277be3e39d6aa38816165a5a3e0938ac5d47674ee2921b6e115a4bb54e3e4910b34c4b6
2023-05-31 09:56:31 +01:00
MarcoFalke
fa3ab45203
ci: Enable float-divide-by-zero check 2023-05-30 12:01:38 +02:00
MarcoFalke
fa123077bc
ci: Use podman for persistent workers 2023-05-30 10:27:23 +02:00
MarcoFalke
fa9c65a74c
ci: Prune dangling images on RESTART_CI_DOCKER_BEFORE_RUN 2023-05-30 08:51:53 +02:00
fanquake
5763b232e6
ci: return to using Ubuntu 22.04 in MSAN jobs
We no-longer need to use 23.04, now that we aren't installing clang-16
and friends.
2023-05-29 17:20:50 +01:00
fanquake
d3cbcbf626
ci: compile clang and compiler-rt in MSAN jobs
This works around https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1005341.
2023-05-29 17:20:50 +01:00
fanquake
796bd1d0d1
ci: use LLVM 16.0.4 in MSAN jobs 2023-05-29 17:20:49 +01:00
fanquake
883bc9f561
ci: remove extra CC & CXX from MSAN jobs
This is passed through from depends.
2023-05-29 17:20:47 +01:00
fanquake
2d4f4b8f29
ci: standardize custom libc++ usage in MSAN jobs
Use `-isystem` & `-nostd*` flags, which is the preferred way to use a
custom libc++ (ours is libc++ build with MSAN) with Clang, as opposed to
our current ad-hoc flags.

See: https://releases.llvm.org/16.0.0/projects/libcxx/docs/UsingLibcxx.html#using-a-custom-built-libc
for more info.
2023-05-29 17:19:42 +01:00
fanquake
6cf47a8f44
Merge bitcoin/bitcoin#27507: lint: stop ignoring LIEF imports
015cc5e588 lint: stop ignoring LIEF imports (fanquake)

Pull request description:

  Type stubs are now available as of 0.13.0.
  See https://github.com/lief-project/LIEF/issues/650.

ACKs for top commit:
  TheCharlatan:
    ACK 015cc5e588

Tree-SHA512: ebb754f293c2a61a0ef64c3552f7c700ceb3054b50fd3f1573e4a9e87773ddeba47bd9875f6ab055043012dbc20aeb71e4d76cd3da535c76651dfb1fbfc66e89
2023-05-29 17:11:31 +01:00
fanquake
fb4f047686
Merge bitcoin/bitcoin#27724: build: disable boost multi index safe mode in debug mode
59c8944749 build: disable boost multi index safe mode (willcl-ark)

Pull request description:

  Fixes #27586

  Disable boost multi index safe mode by default when configuring with
  --enable-debug.

  This option can cause transactions to take a long time to be accepted
  into the mempool under certain conditions; iterator destruction takes
  O(n) time vs O(1) as they are stored in a singly linked list. See
  27586 and the [boost docs](https://www.boost.org/doc/libs/1_58_0/boost/multi_index/detail/safe_mode.hpp) for more information.

  Re-enable it on the CI builds which previously had it enabled.

  Re-enable it on the msan fuzz task so that we have fuzz tasks testing
  with it enabled and disabled in this repo.

ACKs for top commit:
  hebasto:
    ~ACK 59c89447499bd9d6202269879555b8bc37373aa2~
  fanquake:
    ACK 59c8944749

Tree-SHA512: ed654f63dbebdd02e4414d1f81147d92a4d490dbb5a2e0376858e3129097645f3a2df45191d6b40c410a76e803b0d28796d1a01c1d2fd995b94e8b7eb3949027
2023-05-29 17:09:47 +01:00
fanquake
dfe658009d
Merge bitcoin/bitcoin#27759: Fix #includes in src/wallet
1f97572b9c Fix `#include`s in `src/wallet` (Hennadii Stepanov)

Pull request description:

  This PR is a minimum required changes to fix https://github.com/bitcoin/bitcoin/pull/27571#discussion_r1195497290.

ACKs for top commit:
  MarcoFalke:
    lgtm ACK 1f97572b9c

Tree-SHA512: de885210076d23f3394c42ca50e6ae2470c0ae6523399a2fa3ebb7c06383bdacef9c26166fa19747200396bed796c8772165e24416eb30ed8edd024e3394b2fe
2023-05-29 16:33:14 +01:00
fanquake
015cc5e588
lint: stop ignoring LIEF imports
Type stubs are now available as of 0.13.0.
See https://github.com/lief-project/LIEF/issues/650.
2023-05-29 10:23:52 +01:00
MarcoFalke
fa12558d21
ci: Avoid leaking HOME var into CI pod
This will lead to a duplicate install, see https://github.com/bitcoin/bitcoin/pull/27739#issuecomment-1564122573
2023-05-29 09:16:43 +02:00
MarcoFalke
aaaa432603
ci: Remove "default" test env
It is unclear what the point is of maintaining a "default", the meaning
of which is unclear.
2023-05-29 09:16:21 +02:00
MarcoFalke
fa7a87bc7c
ci: Add missing set -e to 01_base_install.sh
Also, set -x for easier debugging.

Also, do the same for ci/test/00_setup_env.sh
2023-05-29 09:16:10 +02:00
Hennadii Stepanov
1f97572b9c
Fix #includes in src/wallet 2023-05-25 15:52:08 +01:00
willcl-ark
59c8944749
build: disable boost multi index safe mode
Disable boost multi index safe mode by default when configuring with
--enable-debug.

This option can cause transactions to take a long time to be accepted
into the mempool under certain conditions; iterator destruction takes
O(n) time vs O(1) as they are stored in a singly linked list. See
27586 for more information.

Re-enable it on the CI builds which previously had it enabled.

Re-enable it on the msan fuzz target so that we have fuzz tasks testing
with it enabeld and disabled in this repo.
2023-05-23 13:44:07 +01:00
fanquake
456701420b
Merge bitcoin/bitcoin#27672: fuzz: Print error message when FUZZ is missing
fa1b3abc83 ci: Log qa-assets repo last commit (MarcoFalke)
fa22966f33 fuzz: Print error message when FUZZ is missing (MarcoFalke)

Pull request description:

  Some trivial UX improvements.

  * Change the exit code for `PRINT_ALL_FUZZ_TARGETS_AND_ABORT` and `WRITE_ALL_FUZZ_TARGETS_AND_ABORT` to `EXIT_SUCCESS` instead of `Aborted (core dumped)`.
  * Print readable error message when `FUZZ` is missing instead of `Aborted (core dumped)`.
  * Clarify that a fuzz target needs to be compiled into the executable.

ACKs for top commit:
  dergoegge:
    ACK fa1b3abc83

Tree-SHA512: 065ef8920449c64b3516f89a61cb397b505eccf531318c4f3830895d5ff6cd7ae2525cb857320481e3d0ed0b2f8a522cd8f7835e69f021241b6ec297a6102fc8
2023-05-22 12:55:18 +01:00
fanquake
09351f51d2
Merge bitcoin/bitcoin#27699: random: drop syscall wrapper usage for getrandom()
5228223e1f ci: remove MSAN getrandom syscall workaround (fanquake)
d5e06919db random: switch to using getrandom() directly (fanquake)
c2ba3f5b0c random: add [[maybe_unused]] to GetDevURandom (fanquake)
c13c97dbf8 random: getentropy on macOS does not need unistd.h (fanquake)

Pull request description:

  This requires a linux kernel of `3.17`+, which seems entirely
  reasonable. `3.17` went EOL in 2015, and the last supported `3.x` kernel
  (`3.16`) went EOL > 4 years ago, in 2020. For reference, the current
  oldest maintained kernel is `4.14` (released 2017, going EOL Jan 2024).

  Support for `getrandom()` (and `getentropy()`) was added to
  glibc `2.25` https://sourceware.org/legacy-ml/libc-alpha/2017-02/msg00079.html:
  > * The getentropy and getrandom functions, and the <sys/random.h> header
    file have been added.

  and we already require `2.27` or later.

  All that being said, I don't think you would encounter a current day (+~6 months from now)
  system, running with kernel headers older than 3.17 (released 2014) but also having a
  glibc of 2.27+ (released 2018)?

  Removing this (our only) use of `syscall()` also means we can drop a workaround in our MSAN jobs.
  If this is merged, I'll drop the [same workaround in oss-fuzz](25946a5448/projects/bitcoin-core/build.sh (L49-L56)).

ACKs for top commit:
  josibake:
    ACK 5228223e1f
  hebasto:
    ACK 5228223e1f, I've tested build system changes on Ubuntu 22.04 and macOS Monterey 12.6.6 (x86_64).

Tree-SHA512: cc978e08510c461b875ca8c08ae176b4519fa1108f0efd74dcb7474518945357e0184e54423282c9a496de195e4ddc3e221ee78623bd63e24c50cc86acdf32e2
2023-05-22 11:34:58 +01:00
fanquake
f998eb7662
Merge bitcoin/bitcoin#27683: ci: remove RUN_SECURITY_TESTS
6a936580d1 ci: remove RUN_SECURITY_TESTS (fanquake)

Pull request description:

  We no-longer run any security/symbol checks in the CI, and doubt we will in future (if we do, it'll be via Guix, where this var would be redundant in any case). The CI environment doesn't (exactly) match the release build environment (and is semi-regularly changing), and the binaries produced in the CI don't match how we build release binaries, so there is no point trying to run these checks, especially as we add more involved tests, i.e #26953.

ACKs for top commit:
  josibake:
    code review ACK 6a936580d1
  TheCharlatan:
    ACK 6a936580d1

Tree-SHA512: c0eec61a4b873bac487ba9321b50116a215b4796bd7d416d98ffcd09969dbf635c2cb5aeb225c89d1e6462838fa2a48565048ebe730f48d76d3db46b64855a91
2023-05-22 09:52:27 +01:00
MarcoFalke
fa1b3abc83
ci: Log qa-assets repo last commit
This documents the state in the CI output and may help debugging in case
of failure.
2023-05-22 10:02:40 +02:00
fanquake
5228223e1f
ci: remove MSAN getrandom syscall workaround
The corresponding workaround will also be dropped in oss-fuzz:
25946a5448/projects/bitcoin-core/build.sh (L49).
2023-05-20 17:20:06 +01:00
Hennadii Stepanov
98ea798411
ci, iwyu: Double maximum line length for includes 2023-05-20 13:16:26 +01:00
MarcoFalke
fa953f15bf
build: Bump minimum supported GCC to g++-9
Also, update the code to use constexpr, which does not work in g++-8.

Also, drop the no longer needed build-aux/m4/l_filesystem.m4.
2023-05-18 12:24:40 +02:00
MarcoFalke
fa69955e74
ci: Bump centos:stream8 to centos:stream9
This is required for the next commit. Also, drop CI_RETRY_EXE before
"dnf install", because it requires getopt, which will only be installed
later on via util-linux
2023-05-18 12:24:38 +02:00
MarcoFalke
fa6a755d9f
ci: Document the false positive error for g++-9 2023-05-18 12:24:28 +02:00
fanquake
77b0a80ce7
Merge bitcoin/bitcoin#27682: build: Bump minimum supported Clang to clang-10
fa199ee614 ci: Drop NO_WERROR=1 for clang-10 build (MarcoFalke)
fad2c200f4 build: Bump minimum Clang to clang-10 (MarcoFalke)
fad7cfee8d doc: Remove outdated CentOS comment (MarcoFalke)

Pull request description:

  It doesn't make sense to support a minimum clang version that is difficult to install on all supported operating systems, which generally ship a later version:

  * Ubuntu Focal 20.04: https://packages.ubuntu.com/focal/clang-10 and https://packages.ubuntu.com/focal/clang-12
  * Debian Bullseye: https://packages.debian.org/bullseye/clang-13
  * CentOS 8 Stream: All Clang versions from 11.0 to 15.0

  Also, it allows to drop build code, which means it won't waste review when rolling over into cmake (`cmake/module/CheckStdFilesystem.cmake`).

ACKs for top commit:
  hebasto:
    ACK fa199ee614
  fanquake:
    ACK fa199ee614

Tree-SHA512: c1a0e8f191a6db866b8be3c9d254dc3f576fa021e2eaaeb68f3354554a8b38eaa90bbf9871ff92351b715e62a6b7b98cf94eba6dc53d7c951bddb6ad49ba7716
2023-05-18 11:05:08 +01:00
fanquake
4c3d67a2d0
Merge bitcoin/bitcoin#27571: ci: Run iwyu on all src files
ddddf4957b ci: Run iwyu on all src files (MarcoFalke)

Pull request description:

  This makes it easier to look at the CI output of a file without having to manually add it first to the list.

ACKs for top commit:
  hebasto:
    ACK ddddf4957b

Tree-SHA512: 342b52838ae45ea343731c30058cdd5595d5ea5601a1f396de4466ccdd63f7ab07b3a193df3669e4dca7cb535557dcc98f866b3cf986b98176b20ecead123868
2023-05-17 13:06:23 +01:00
fanquake
6a936580d1
ci: remove RUN_SECURITY_TESTS
We no-longer run any security/syymbol checks in the CI, and doubt we
will in future (if we do, it'll be via Guix, where this var would be
redundant in any case). The CI environment doesn't (exactly) match the
release build environment (and is semi-regularly changing), and the
binaries produced in the CI don't match how we build release binaries,
so there is no point trying to run these checks, especially as we add
more involved tests, i.e #26953.
2023-05-17 10:57:39 +01:00
MarcoFalke
fa199ee614
ci: Drop NO_WERROR=1 for clang-10 build
This partially reverts commit 71383f2fad.
This should be fine, because if warnings are issues again in the future,
it can be disabled again, along with a list of the false warnings.
2023-05-17 10:55:03 +02:00
MarcoFalke
fad2c200f4
build: Bump minimum Clang to clang-10 2023-05-17 10:30:41 +02:00
MarcoFalke
fad7cfee8d
doc: Remove outdated CentOS comment
No longer applicable after CONFIG_SHELL must be explicitly set to dash
after commit fafc55a489.
2023-05-17 09:54:31 +02:00
fanquake
904631e0fc
Merge bitcoin/bitcoin#27667: ci: Remove unused errtrace trap ERR
fad09b703f ci: Remove unused errtrace trap ERR (MarcoFalke)

Pull request description:

  This was added in commit 069752b726, presumably at a time when the functional tests wouldn't capture stderr.

  Now that all tests capture and print stderr on failure, it can be removed. Reference:

  * Unit tests capture via `2>&1`:

  d7700d3a26/src/Makefile.test.include (L421)

  * Functional tests capture as well:

  d7700d3a26/test/functional/test_framework/test_node.py (L356)

ACKs for top commit:
  fanquake:
    ACK fad09b703f
  hebasto:
    ACK fad09b703f, tested on Ubuntu 22.04: I can still see warnings from the sanitizers in both unit and functional tests.

Tree-SHA512: 1e786eee432a7a50eb9f78b06b2b157321cc16f91b613e3b476e9e51572592fe4bcf4dc15df176e5f019f24497ac68cf332d2037b55b57498c93f4e19613163c
2023-05-16 15:28:04 +01:00
Hennadii Stepanov
5d49d98731
ci: Fix "Number of CPUs" output 2023-05-16 12:45:32 +01:00
MarcoFalke
fad09b703f
ci: Remove unused errtrace trap ERR 2023-05-16 10:00:47 +02:00
fanquake
3a63ef5020
Merge bitcoin/bitcoin#27616: ci: Remove CI_EXEC bloat
fa01c3c59c ci: Remove CI_EXEC bloat (MarcoFalke)
fa8a428c92 move-only: Move almost all CI_EXEC code to 06_script_b.sh (MarcoFalke)

Pull request description:

  `CI_EXEC` has many issues:

  * It is roughly equivalent to `bash -c "$*"`, meaning that the full command will be treated as a single string, ignoring tokens.
  * It must be put in front of (almost) every command, making it easy to forget, hard to debug the resulting failure, and the code verbose.

  Fix all issues by removing it almost completely.

ACKs for top commit:
  TheCharlatan:
    ACK fa01c3c59c

Tree-SHA512: 4a65d61f5c35ca945d31f270dba3e96305fd83333a7713f0452c67f02a78e1901113e9f18d21e1dc016403c0033eb32038a9308d0a0ded7ee6b970d18381a1c2
2023-05-15 11:15:25 +01:00
MarcoFalke
ddddf4957b
ci: Run iwyu on all src files
This makes it easier to look at the CI output of a file without having
to manually add it first.
2023-05-13 10:45:52 +02:00
TheCharlatan
a498d699e3
refactor/iwyu: Complete includes for blockmanager_args 2023-05-10 19:07:30 +02:00
MarcoFalke
fa01c3c59c
ci: Remove CI_EXEC bloat 2023-05-10 15:28:19 +02:00
MarcoFalke
fa8a428c92
move-only: Move almost all CI_EXEC code to 06_script_b.sh
[WARN] The commit is obviously broken and will not run the CI system. In
the rare case this is hit in a git bisect, just skip the commit.

The goal here was to make it trivial to review with the git option:
--color-moved=dimmed-zebra

It is required to move everything into one file because "exit 0" will
otherwise stop working as intended when the containing bash script is no
longer executed with "source ...".

If there is desire to split up 06_script_b.sh into logical chunks in the
future, it will also be easier after the following commit.
2023-05-10 14:10:38 +02:00
MarcoFalke
fa1dbd04ca
ci: Remove CI_EXEC bloat in test/06_script_b.sh 2023-05-05 08:51:43 +02:00
MarcoFalke
fae8de926a
ci: Move CI container kill out of 06_script_b.sh
This cleans up 06_script_b.sh to only contain code to be executed inside
the CI pod, which avoids confusion and is needed for the next commit.
2023-05-05 08:50:39 +02:00
MarcoFalke
fa7d75540e
ci: Pass full env to CI pod to avoid missing a var
Instead of enumerating each passed env var, just pass all. This avoids
the risk of missing to enumerate one. Also, it is less code.

The risk could be that an env var causes non-deterministic behavior, but
this can be fixed by explicitly excluding it once the issue is known.

Values with newlines can not be stored in the file and parsed by
docker/podman, so they are excluded.
2023-05-05 08:46:35 +02:00
fanquake
f952e679cd
ci: remove usage of untrusted bpfcc-tools
We've migrated this job to Ubuntu 23.04, which
ships with newer versions of the tools:
https://packages.ubuntu.com/lunar/bpfcc-tools.
2023-05-02 12:02:45 +01:00
fanquake
1232c2f6b9
ci: use LLVM/clang-16 in native_asan job
Similar to #27298.
2023-05-02 12:02:23 +01:00
fanquake
d89aca1bdb
Merge bitcoin/bitcoin#27483: Bump python minimum version to 3.8
fac395e5eb ci: Bump ci/lint/Dockerfile (MarcoFalke)
fa6eb65167 test: Use python3.8 pow() (MarcoFalke)
88881cf7ac Bump python minimum version to 3.8 (MarcoFalke)

Pull request description:

  There is no pressing reason to drop support for 3.7, however there are several maintenance issues:

  * There is no supported operating system that ships 3.7 by default. (debian:buster is EOL and unmaintained to the extent that it doesn't run in the CI environment. See https://github.com/bitcoin/bitcoin/pull/27340#issuecomment-1484988445)
  * Compiling python 3.7 from source is also unsupported on at least macos, according to https://github.com/bitcoin/bitcoin/pull/24017#issuecomment-1107820790
  * Recent versions of lief require 3.8, see https://github.com/bitcoin/bitcoin/pull/27507#issuecomment-1517561645

  Fix all maintenance issues by bumping the minimum.

ACKs for top commit:
  RandyMcMillan:
    ACK fac395e
  fjahr:
    ACK fac395e5eb
  fanquake:
    ACK fac395e5eb

Tree-SHA512: c198decdbbe29d186d73ea3f6549d8a38479383495d14a965a2f9211ce39637b43f13a4c2a5d3bf56e2d468be4bbe49b4ee8e8e19ec69936ff43ddf2b714c712
2023-04-28 10:22:20 +01:00
MarcoFalke
fac395e5eb
ci: Bump ci/lint/Dockerfile
This bump should not be needed, see discussion starting at
https://github.com/bitcoin/bitcoin/pull/27483#issuecomment-1517739626
2023-04-21 14:31:13 +02:00
fanquake
669af32632
Merge bitcoin/bitcoin#27419: move-only: Extract common/args from util/system
be55f545d5 move-only: Extract common/args and common/config.cpp from util/system (TheCharlatan)

Pull request description:

  This pull request is part of the `libbitcoinkernel` project https://github.com/bitcoin/bitcoin/issues/24303 https://github.com/bitcoin/bitcoin/projects/18 and more specifically its "Step 2: Decouple most non-consensus code from libbitcoinkernel". It is part of a series of patches splitting up the `util/system` files. Its preceding pull request is https://github.com/bitcoin/bitcoin/pull/27254.

  The pull request contains an extraction of ArgsManager related functions from util/system into their own common/ file.

  The background of this commit is an ongoing effort to decouple the libbitcoinkernel library from the ArgsManager. The ArgsManager belongs into the common library, since the kernel library should not depend on it. See [doc/design/libraries.md](https://github.com/bitcoin/bitcoin/blob/master/doc/design/libraries.md) for more information on this rationale.

ACKs for top commit:
  MarcoFalke:
    re-ACK be55f545d5  🚲
  ryanofsky:
    Code review ACK be55f545d5. Just small cleanups since the last review.
  hebasto:
    ACK be55f545d5, I have reviewed the code and it looks OK, I agree it can be merged.

Tree-SHA512: 90eb03334af0155b823030b4f2ecf286d35058d700ee2ddbbaa445be19e31eb0fe982656f35bd14ecee3ad2c3d0db3746855cb8f3777eff7253713e42873e111
2023-04-21 11:19:08 +01:00
MarcoFalke
88881cf7ac
Bump python minimum version to 3.8
Also, switch ci_native_qt5 to g++-9 (from g++-8) to work around bugs.
This should be fine, because the i686_centos task still checks for g++-8
compatibility.

See
https://github.com/bitcoin/bitcoin/pull/27483#issuecomment-1513477050
for the list of bugs.
2023-04-21 10:18:19 +02:00
fanquake
4de9c2a65f
ci: build libc++ with assertions in MSAN jobs 2023-04-19 11:54:44 +01:00
fanquake
23b8b2026a
ci: build libc++ in DEBUG mode in MSAN jobs 2023-04-19 11:54:44 +01:00
TheCharlatan
be55f545d5
move-only: Extract common/args and common/config.cpp from util/system
This is an extraction of ArgsManager related functions from util/system
into their own common file.

Config file related functions are moved to common/config.cpp.

The background of this commit is an ongoing effort to decouple the
libbitcoinkernel library from the ArgsManager. The ArgsManager belongs
into the common library, since the kernel library should not depend on
it. See doc/design/libraries.md for more information on this rationale.
2023-04-19 10:48:30 +02:00
fanquake
5165984afc
Merge bitcoin/bitcoin#27340: ci: Use Cirrus CI dockerfile env
fa4a46de0b ci: Bump nowallet_libbitcoinkernel task to ubuntu:focal (MarcoFalke)
fabc7d90a9 ci: Use credits in more tasks (MarcoFalke)
facae3b149 ci: Use Cirrus CI dockerfile env (MarcoFalke)

Pull request description:

  Currently the CI env has many intermittent issues:

  * The Ubuntu package servers are frequently down
  * Occasionally other stuff is down, such as dnf, pip, or the android sdk
  * Installing packages is slower than downloading them, at least on Cirrus, which has a fast download speed

  Fix all issues by using the Cirrus CI dockerfile env.

ACKs for top commit:
  josibake:
    code review ACK fa4a46de0b

Tree-SHA512: fea5663f7b6dc1c4ea9f87188026ec542b9269bac8ee3398cd58d4df6c86a0af9d275f1876e03f92fb1f6166ec49b817d9e588e6fe1ed54b77592502c2eccd9d
2023-04-18 10:39:39 +01:00
fanquake
2c60826b50
ci: explicitly install libclang-rt-dev in valgrind jobs
This fixes some cases, i.e under --no-install-recommends, where
libclang-rt-dev wouldn't be installed, and configuring would then fail.

Followup to #27444.
2023-04-13 11:22:39 +01:00
fanquake
ba29143d98
ci: use Debian Bookworm and Valgrind 3.19 in Valgrind jobs
https://packages.debian.org/bookworm/valgrind
2023-04-12 17:45:14 +01:00
MarcoFalke
fa4a46de0b
ci: Bump nowallet_libbitcoinkernel task to ubuntu:focal
This is needed to work around
https://github.com/bitcoin/bitcoin/pull/27340#issuecomment-1484988445

The only change should be that python3.7 is bumped to 3.8, but this is
fine because ci/test/00_setup_env_native_qt5.sh still checks for
python3.7 compatibility.
2023-04-11 14:12:37 +02:00
fanquake
676671527f
test: LLVM/Clang 16 for MSAN jobs
Sync up with other CI infra.
2023-04-10 10:57:05 +01:00
MarcoFalke
fa5af94de6
ci: Run base install at most once
This should avoid errors when running it twice. For example, network
errors on the second invocation of 'apt update'; or unguarded
modifications such as APPEND_APT_SOURCES_LIST, which will append the
same string repeatedly.

The base install may be run twice in Cirrus CI with dockerfiles, or
locally when running twice with DANGER_RUN_CI_ON_HOST specified.
2023-04-06 11:52:30 +02:00
fanquake
5a8bd45056
Merge bitcoin/bitcoin#27423: ci: fix git dubious permissions error
ed4a8339b8 ci: fix git dubious permissions error (josibake)

Pull request description:

  fixes https://github.com/bitcoin/bitcoin/pull/27376#issuecomment-1496449588

  this appears to be caused by a more recent version of git being sensitive to mismatched permissions on directories. we didn't notice this before because we were using two separate user accounts to fix up dir permissions in the container , but the second account was removed in #27376

  there might be a more elegant way to do this, but this does the trick and seems to be the way others are fixing this issue around the internets.

ACKs for top commit:
  RandyMcMillan:
    ACK ed4a833
  hebasto:
    re-ACK ed4a8339b8

Tree-SHA512: dad467deca101a24f3ed34b3e26a1db5099a5bd5c3e9c9a22771c59848f7d7e7843c7386348e6fdf86d5a556e4706e5e20005d7a6637193e1c8aef7a5ff7fb19
2023-04-06 10:04:01 +01:00
josibake
ed4a8339b8
ci: fix git dubious permissions error 2023-04-05 14:25:13 +02:00
fanquake
a56c96507a
ci: use clang-16 in tidy task 2023-04-05 11:43:42 +01:00
MarcoFalke
fafe3a8e38
ci: Remove second user account 2023-03-31 08:28:38 +02:00
fanquake
45be6af694
Merge bitcoin/bitcoin#27333: ci: cleanup of CI_EXEC & CI_EXEC_ROOT
b5ef1419ec ci: cleanup of CI_EXEC & CI_EXEC_ROOT (refs #27321) (Vasil Stoyanov)

Pull request description:

  Basically it removes the above-mentioned env-vars as per MarcoFalke's instructions. The only deviation from the plan laid out there was that I double-quoted the last instance of $ANDROID_HOME for the sake of consistency and future-proofing and the rest of the non-quoted vars due to lint failing the build.

  Fixes #27321.

ACKs for top commit:
  josibake:
    ACK b5ef1419ec
  hernanmarino:
    untested ACK b5ef1419ec. LGTM

Tree-SHA512: a79776bf64a2fa8b38195cc84445e171fd689f156aac5a1e5d39040300567eb9f4c2ebd00fbf3fa0e55b68793f8f752d94f7d817f6097ed9dd3a8ea57651b981
2023-03-30 18:55:27 +01:00
fanquake
a634c288c3
ci: use LLVM/clang-16 in native_fuzz (ASAN) job
Similar to #27298.
2023-03-29 16:05:59 +01:00
fanquake
220008604f
Merge bitcoin/bitcoin#27298: ci: Use TSan new runtime (llvm-16, take 3)
faf4aca15a ci: Use TSan new runtime (llvm-16, take 3) (MarcoFalke)

Pull request description:

  The previous two attempts failed:
  * llvm-14: Failed in https://github.com/bitcoin/bitcoin/pull/24572
  * llvm-15: Failed in https://github.com/bitcoin/bitcoin/pull/26775

  However, now that the bug is known and fixed, it should be good to go. See also https://github.com/bitcoin/bitcoin/pull/26775#issuecomment-1380590669

ACKs for top commit:
  fanquake:
    ACK faf4aca15a - I still see [this](https://github.com/bitcoin/bitcoin/pull/27298#issuecomment-1480041089) failure on aarch64, but that isn't really a regression, as running this tests was already broken for me. I'll open a separate issue, and we can follow up.

Tree-SHA512: 372b53c4d42ca7f527dae4a2b5bc5ab33c816930daf7a3479d20ea7749159a0b19cfd8d76244b95b03130e4a3d12ddbbb74668b8f7e9fc272cf1084f53b7ff9b
2023-03-28 14:17:30 +01:00
MarcoFalke
faf4aca15a
ci: Use TSan new runtime (llvm-16, take 3) 2023-03-28 10:01:47 +02:00
Vasil Stoyanov
b5ef1419ec ci: cleanup of CI_EXEC & CI_EXEC_ROOT (refs #27321) 2023-03-27 20:45:17 +03:00
MarcoFalke
faf8dc496e
fuzz: Remove legacy int parse fuzz tests 2023-03-27 16:37:31 +02:00
MarcoFalke
faa0839837
ci: Cache more stuff in the ci images: msan, iwyu, pip, sdks 2023-03-24 10:19:25 +01:00
Hennadii Stepanov
8fe27fbed8
ci: Use clang-15 in "tidy" task 2023-03-22 15:21:39 +00:00
Ben Woosley
e7333b420e
refactor: Extract util/exception from util/system
This is a minimal extraction of a single function, but also the only use
of std::exception in util/system.

The background of this commit is an ongoing effort to decouple the
libbitcoinkernel library from the ArgsManager defined in system.h.
Moving the function out of system.h allows including it from a separate
source file without including the ArgsManager definitions from system.h.
2023-03-13 17:09:47 +01:00
Andrew Chow
23e2bfcbc4
Merge bitcoin/bitcoin#25696: build: Re-enable external signer on Windows
1a0d8e178c build: Re-enable external signer on Windows (Hennadii Stepanov)
989451d068 configure: Detect compatibility of Boost.Process rather than hardcode non-Windows (Luke Dashjr)

Pull request description:

  As https://github.com/boostorg/process/issues/207 has been resolved, it is possible now to re-enable external signer on Windows when cross-compiling.

  Guix build hashes:
  ```
  78f69ea7e0dbc8338981a92c0352220ccd7c2272d8cbff6a3b082a1412a935c5  guix-build-1a0d8e178c7b/output/aarch64-linux-gnu/SHA256SUMS.part
  ee17456ec818ddf5a175182508966e622573ccb518807cca43a40fa1dceda092  guix-build-1a0d8e178c7b/output/aarch64-linux-gnu/bitcoin-1a0d8e178c7b-aarch64-linux-gnu-debug.tar.gz
  5080551bde379c746cc67b10429aef33b9f9e49d2d4e21ee1c3bfd9c1c845d46  guix-build-1a0d8e178c7b/output/aarch64-linux-gnu/bitcoin-1a0d8e178c7b-aarch64-linux-gnu.tar.gz
  dfab220ce76a40bf7dcf07aab352a616a91b516503639455fe7e1b137bad3e85  guix-build-1a0d8e178c7b/output/arm-linux-gnueabihf/SHA256SUMS.part
  516ceb822571a8bd88fe107dca434ef596b1e4328ccbda1d51e1d482d3050396  guix-build-1a0d8e178c7b/output/arm-linux-gnueabihf/bitcoin-1a0d8e178c7b-arm-linux-gnueabihf-debug.tar.gz
  21325380638f817107c203b9a1aedb808d1a4a2b4041493753ca4cbf19aa4f2c  guix-build-1a0d8e178c7b/output/arm-linux-gnueabihf/bitcoin-1a0d8e178c7b-arm-linux-gnueabihf.tar.gz
  cf48ed78fcfceaeb3610ccf22326d735a129dcbf9d50b557b3de359169aefdfd  guix-build-1a0d8e178c7b/output/arm64-apple-darwin/SHA256SUMS.part
  d4d51e136148bac6a20bb3adb402c499967647736acb420bfdeb71603aba57da  guix-build-1a0d8e178c7b/output/arm64-apple-darwin/bitcoin-1a0d8e178c7b-arm64-apple-darwin-unsigned.dmg
  95bb62d24f860e08a392ddb74d5860ccf27e8baa183e6749af877d26a3bd6b0b  guix-build-1a0d8e178c7b/output/arm64-apple-darwin/bitcoin-1a0d8e178c7b-arm64-apple-darwin-unsigned.tar.gz
  68da4c92f37bb802df37141af194f47c16da1d84f77a0fbb1016013ae0338502  guix-build-1a0d8e178c7b/output/arm64-apple-darwin/bitcoin-1a0d8e178c7b-arm64-apple-darwin.tar.gz
  6704e38c2d3f11321403797598d05f062648fec6f2d76900ba250dab481e29da  guix-build-1a0d8e178c7b/output/dist-archive/bitcoin-1a0d8e178c7b.tar.gz
  64b936bc90d1e01fe8f276511edc9bb945dcebe70332aa37d3a786348443b8e7  guix-build-1a0d8e178c7b/output/powerpc64-linux-gnu/SHA256SUMS.part
  3d03532e54b6e42498ea240c86b8567e94fd462f56087b869c3d6f09e2dde878  guix-build-1a0d8e178c7b/output/powerpc64-linux-gnu/bitcoin-1a0d8e178c7b-powerpc64-linux-gnu-debug.tar.gz
  c5843d79a58b0a864fe723458dab4eee54ad11f4b1f7960975b086eeedc0d541  guix-build-1a0d8e178c7b/output/powerpc64-linux-gnu/bitcoin-1a0d8e178c7b-powerpc64-linux-gnu.tar.gz
  f861ff519bd5e3d6d5ce1646ee0a06bcef1288ddb804a4a600e4dbfe5d5be521  guix-build-1a0d8e178c7b/output/powerpc64le-linux-gnu/SHA256SUMS.part
  5f477da21980dbcf9696081903dc1ba8a3f79ce3579641d208e69a6f598c8eb9  guix-build-1a0d8e178c7b/output/powerpc64le-linux-gnu/bitcoin-1a0d8e178c7b-powerpc64le-linux-gnu-debug.tar.gz
  b3757b11c614136934158acea5139e8abd0c5c9cdfda72ae44db436f21716b33  guix-build-1a0d8e178c7b/output/powerpc64le-linux-gnu/bitcoin-1a0d8e178c7b-powerpc64le-linux-gnu.tar.gz
  1c21bdb17fe3436e685e88c62423e630fe2b3c41dd00025a99fd80d97817ac2f  guix-build-1a0d8e178c7b/output/riscv64-linux-gnu/SHA256SUMS.part
  f36ae98473f086ae8f0dc66223b5ec407d57dc4d8d45ae284401520ff5c0b273  guix-build-1a0d8e178c7b/output/riscv64-linux-gnu/bitcoin-1a0d8e178c7b-riscv64-linux-gnu-debug.tar.gz
  1603e4d0e869eb47a1dc2d26b67772d0016d90f7ba5e50d2009365cc02cb8169  guix-build-1a0d8e178c7b/output/riscv64-linux-gnu/bitcoin-1a0d8e178c7b-riscv64-linux-gnu.tar.gz
  f86ef652102f022827b70477bffa0a44008c6300cf62ca7b3595146cf2ed91ba  guix-build-1a0d8e178c7b/output/x86_64-apple-darwin/SHA256SUMS.part
  f84d435d8e4709bf29bc7ac7ed8dc6b8af4077cef05e520b468b2896ce10876a  guix-build-1a0d8e178c7b/output/x86_64-apple-darwin/bitcoin-1a0d8e178c7b-x86_64-apple-darwin-unsigned.dmg
  af2aab969b7ed7aeea0e02adbcc9e3b438086bf76b6bfc36146c53e05a27bd57  guix-build-1a0d8e178c7b/output/x86_64-apple-darwin/bitcoin-1a0d8e178c7b-x86_64-apple-darwin-unsigned.tar.gz
  32a5109ba28ab74ff66238e6a8f8a04e455ebce382a3be287df92a227818fe72  guix-build-1a0d8e178c7b/output/x86_64-apple-darwin/bitcoin-1a0d8e178c7b-x86_64-apple-darwin.tar.gz
  377462e9a96f4aba72c915dd5df5159a4301a1fa8ed0ee48faa6c71573de80c3  guix-build-1a0d8e178c7b/output/x86_64-linux-gnu/SHA256SUMS.part
  a3bf62e828d2350a483b2d16205014f66e8884597b0b72e178042a958c548336  guix-build-1a0d8e178c7b/output/x86_64-linux-gnu/bitcoin-1a0d8e178c7b-x86_64-linux-gnu-debug.tar.gz
  66cda980188ea1941a7d66c8b03c447580af33db55abe3bbe3581823ae0534a3  guix-build-1a0d8e178c7b/output/x86_64-linux-gnu/bitcoin-1a0d8e178c7b-x86_64-linux-gnu.tar.gz
  2117f0dd9baeb4d585f841592e94c088f4487bf2008b8f281d0c3ceee92ff6cc  guix-build-1a0d8e178c7b/output/x86_64-w64-mingw32/SHA256SUMS.part
  d40d5dec3287f467c42232c05d82f7fb538cda34bd2e63ff7e1876f471c3a790  guix-build-1a0d8e178c7b/output/x86_64-w64-mingw32/bitcoin-1a0d8e178c7b-win64-debug.zip
  92dcc92765fbc07b1cc8258bfa69280541e1b4553cc41fed18672c2c6931d5c0  guix-build-1a0d8e178c7b/output/x86_64-w64-mingw32/bitcoin-1a0d8e178c7b-win64-setup-unsigned.exe
  a6dd9b4d29f21d3a18cf64556cb03446ef17bf801eb6ac257b65d27cbd95080f  guix-build-1a0d8e178c7b/output/x86_64-w64-mingw32/bitcoin-1a0d8e178c7b-win64-unsigned.tar.gz
  a4022e595d955198f73530473ef8e90a708746089ee2dd27de794176873330c1  guix-build-1a0d8e178c7b/output/x86_64-w64-mingw32/bitcoin-1a0d8e178c7b-win64.zip
  ```

ACKs for top commit:
  Sjors:
    tACK 1a0d8e178c
  achow101:
    ACK 1a0d8e178c

Tree-SHA512: db7319259b1e1571cfab4bb3b99ae10a2f744e62757cae5059fd6f4dd6d5586eb09feb63a0c4bb07f7128b283f1dc281ed435224bc8e40da577fd4f04cde489a
2023-03-08 21:01:53 -05:00
fanquake
2de0559f2c
Merge bitcoin/bitcoin#27189: util: Use steady clock in SeedStrengthen, FindBestImplementation, FlushStateToDisk
fa1b4e5c32 Use steady clock in FlushStateToDisk (MarcoFalke)
1111e2f8b4 Use steady clock in SeedStrengthen and FindBestImplementation (MarcoFalke)

Pull request description:

  There may be a theoretical deadlock for the duration of the offset when the system clock is adjusted into a past time while executing `SeedStrengthen`.

  Fix this by using steady clock.

  Do the same in `FindBestImplementation`, which shouldn't be affected, because it discards outlier measurements. However, doing the same there for consistency seems fine.

  Do the same in `FlushStateToDisk`, which should make the flushes more steady, if the system clock is adjusted by a large offset.

ACKs for top commit:
  john-moffett:
    ACK fa1b4e5c32
  willcl-ark:
    ACK fa1b4e5c3

Tree-SHA512: cc625e796b186accd53222bd64eb57d0512bc7e588312d254349b542bbc5e5daac348ff2b3b3f7dc5ae0bbbae2ec11fdbf3022cf2164211633765a4b0108e83e
2023-03-08 08:48:41 +01:00
Andrew Chow
fc037c8c83
Merge bitcoin/bitcoin#27150: Deduplicate bitcoind and bitcoin-qt init code
802cc1ef53 Deduplicate bitcoind and bitcoin-qt init code (Ryan Ofsky)
d172b5c671 Add InitError(error, details) overload (Ryan Ofsky)
3db2874bd7 Extend bilingual_str support for tinyformat (Ryan Ofsky)
c361df90b9 scripted-diff: Remove double newlines after some init errors (Ryan Ofsky)

Pull request description:

  Add common InitConfig function to deduplicate bitcoind and bitcoin-qt code reading config files and creating the datadir.

  Noticed the duplicate code while reviewing #27073 and want to remove it because difference in bitcoin-qt and bitcoind behavior make it hard to evaluate changes like #27073

  There are a few minor changes in behavior:

  - In bitcoin-qt, when there is a problem reading the configuration file, the GUI error text has changed from "Error: Cannot parse configuration file:" to "Error reading configuration file:" to be consistent with bitcoind.
  - In bitcoind, when there is a problem reading the settings.json file, the error text has changed from "Failed loading settings file" to "Settings file could not be read" to be consistent with bitcoin-qt.
  - In bitcoind, when there is a problem writing the settings.json file, the error text has changed from "Failed saving settings file" to "Settings file could not be written" to be consistent with bitcoin-qt.
  - In bitcoin-qt, if there datadir is not accessible (e.g. no permission to read), there is an normal error dialog showing "Error: filesystem error: status: Permission denied [.../settings.json]", instead of an uncaught exception.

ACKs for top commit:
  Sjors:
    Light review ACK 802cc1ef53
  TheCharlatan:
    ACK 802cc1ef53
  achow101:
    ACK 802cc1ef53

Tree-SHA512: 9c78d277e9ed595fa8ce286b97d2806e1ec06ddbbe7bd3434bd9dd7b456faf8d989f71231e97311f36edb9caaec645a50c730bd7514b8e0fe6e6f7741b13d981
2023-03-07 13:05:01 -05:00
glozow
2a0c05defd
Merge bitcoin/bitcoin#27209: ci: Remove unused EXPECTED_TESTS_DURATION_IN_SECONDS env var
3fffff50f6 ci: Remove unused EXPECTED_TESTS_DURATION_IN_SECONDS env var (MarcoFalke)

Pull request description:

  Remove long unused travis leftover

ACKs for top commit:
  fanquake:
    ACK 3fffff50f6
  dergoegge:
    ACK 3fffff50f6

Tree-SHA512: 34b85a18c0d34f54bbc6ff5c2454307318e4747145e11f52f08baddefef9e1b80d8f6c85efcad97e575380162fd193f2aa837e99b156ed7e3e95370b635ddf4e
2023-03-06 14:00:36 +00:00
MarcoFalke
1111e2f8b4
Use steady clock in SeedStrengthen and FindBestImplementation 2023-03-02 14:48:28 +01:00
Ryan Ofsky
802cc1ef53 Deduplicate bitcoind and bitcoin-qt init code
Add common InitConfig function to deduplicate bitcoind and bitcoin-qt code
reading config files and creating the datadir.

There are a few minor changes in behavior:

- In bitcoin-qt, when there is a problem reading the configuration file, the
  GUI error text has changed from "Error: Cannot parse configuration file:" to
  "Error reading configuration file:" to be consistent with bitcoind.
- In bitcoind, when there is a problem reading the settings.json file, the
  error text has changed from "Failed loading settings file" to "Settings
  file could not be read" to be consistent with bitcoin-qt.
- In bitcoind, when there is a problem writing the settings.json file, the
  error text has changed from "Failed saving settings file" to "Settings file
  could not be written" to be consistent with bitcoin-qt.
- In bitcoin-qt, if there datadir is not accessible (e.g. no permission to read),
  there is an normal error dialog showing "Error: filesystem error: status:
  Permission denied [.../settings.json]", instead of an uncaught exception
2023-02-28 12:04:47 -05:00
Andrew Chow
a245429d68
Merge bitcoin/bitcoin#26940: test: create random and coins utils, add amount helper, dedupe add_coin
4275195606 De-duplicate add_coin methods to a test util helper (Jon Atack)
9d92c3d7f4 Create InsecureRandMoneyAmount() test util helper (Jon Atack)
81f5ade2a3 Move random test util code from setup_common to random (Jon Atack)

Pull request description:

  - Move random test utilities from `setup_common` to a new `random` file, as many tests don't use this code.

  - Create a helper to generate semi-random CAmounts up to `MONEY_RANGE` rather than only uint32, and use the helper in the unit tests.

  - De-duplicate a shared `add_coin` method by extracting it to a `coins` test utility.

ACKs for top commit:
  pinheadmz:
    ACK 4275195606
  achow101:
    ACK 4275195606
  john-moffett:
    ACK 4275195606

Tree-SHA512: 3ed974251149c7417f935ef2f8865aa0dcc33b281b47522b0f96f1979dff94bb8527957f098fe4d210f40d715c00f29512f2ffe189097102229023b7284a3a27
2023-02-17 17:28:14 -05:00
merge-script
141115a060
Merge bitcoin/bitcoin#27033: ci: Cache stuff in volumes, not host folders
fa8e92c022 doc: Update ci docs (721217.xyz)
5fffff54e9 ci: Cache stuff in volumes, not host folders (MarcoFalke)

Pull request description:

  Storing cached stuff in host system folders may lead to unexpected issues when the ci-built stuff is used for a non-ci build or a ci task leaks into another ci task.

ACKs for top commit:
  john-moffett:
    ACK fa8e92c022

Tree-SHA512: 8b0c9019452fbe507a272c1037c3dce3c178c21f85ab1096ed3372ad9d4b3c7aa27d89e5bf80c9a6260ea652e0268be0cbe61d6a4fcb3add569fa38076d32287
2023-02-13 11:53:50 +01:00
721217.xyz
fa8e92c022
doc: Update ci docs 2023-02-10 17:05:39 +01:00
Jon Atack
4275195606 De-duplicate add_coin methods to a test util helper 2023-02-09 15:03:36 -08:00
Hennadii Stepanov
887bb53b67
ci: Use the latest Ubuntu LTS for "ARM64 Android APK" task 2023-02-08 14:15:13 +00:00
MarcoFalke
5fffff54e9
ci: Cache stuff in volumes, not host folders 2023-02-08 11:21:23 +01:00
Andrew Chow
52ddbd52f9
Merge bitcoin/bitcoin#26345: refactor: modernize the implementation of uint256.*
935acdcc79 refactor: modernize the implementation of uint256.* (pasta)

Pull request description:

  - Constructors of uint256 to utilize Span instead of requiring a std::vector
  - converts m_data into a std::array
  - Prefers using `WIDTH` instead of `sizeof(m_data)`
  - make all the things constexpr
  - replace C style functions with c++ equivalents
      - memset -> std::fill
          This may also be replaced by std::memset, but I think that std::fill is more idiomatic of modern c++ and readable.
      - memcpy -> std::copy
          Note: In practice, implementations of std::copy avoid multiple assignments and use bulk copy functions such as std::memmove if the value type is TriviallyCopyable and the iterator types satisfy LegacyContiguousIterator. (https://en.cppreference.com/w/cpp/algorithm/copy)
          This could also likely be replaced by std::memcpy, but as said above, I believe the using std::copy is the more c++ way to do anything and is almost guaranteed to compile to the same asm
      - memcmp -> std::memcmp

ACKs for top commit:
  achow101:
    ACK 935acdcc79
  hebasto:
    Approach ACK 935acdcc79.
  aureleoules:
    reACK 935acdcc79
  john-moffett:
    ACK 935acdcc79
  stickies-v:
    Approach ACK 935acdcc7

Tree-SHA512: 4f1ba54ff2198eea0e505d41e73d552c84c60f6878d5c85a94a8ab57f39afc94ef8d79258e7afd01fa84ec2a99f4404bb877eecd671f65e1ee9273f3129fc650
2023-02-06 13:56:51 -05:00
fanquake
c2028f98ae
Merge bitcoin/bitcoin#27012: ci: Print iwyu patch in git diff format
fa6986a66b ci: Print iwyu patch in git diff format (MarcoFalke)

Pull request description:

  Seems more dev friendly to also have a patch to copy-paste

ACKs for top commit:
  hebasto:
    ACK fa6986a66b, tested on Ubuntu 22.04 locally.
  fanquake:
    ACK fa6986a66b - did not test but example CI output looks ok.
  stickies-v:
    utACK fa6986a66b

Tree-SHA512: 7cfd8584bf12e03c28af23f4712c6bcafd648d87ddb92788b9cd35455b2db49f4bd4aef8ad4711f75c7f11ad2bb2492c2eb6044007086c20e36016575c060603
2023-02-02 15:48:20 +00:00
MarcoFalke
3fffff50f6
ci: Remove unused EXPECTED_TESTS_DURATION_IN_SECONDS env var 2023-02-02 16:26:16 +01:00
MarcoFalke
b3ef329199
Merge bitcoin/bitcoin#26976: ci: Cache package manager install step
fa486de212 ci: Cache package manager install step (MarcoFalke)

Pull request description:

  Use the local podman or docker image cache to skip the slow `apt` step

ACKs for top commit:
  jamesob:
    ACK fa486de212 ([`jamesob/ackr/26976.1.MarcoFalke.ci_cache_package_manager`](https://github.com/jamesob/bitcoin/tree/ackr/26976.1.MarcoFalke.ci_cache_package_manager))

Tree-SHA512: 3495346c6c862b63296d2691cc492bf52a0a99ee7fae798887c792609904546013eba788045cd508a5f669f2c52e3479c122c18a5275c87af38237a1b5c9da17
2023-02-02 16:09:23 +01:00
fanquake
71383f2fad
ci: avoid using -Werror for older compilers
Don't enable `-Werror` (in the CI) for compilers at least older than
our current release compiler (GCC 10). It provides little-to-no value,
other than turning compiler bugs & false positives into build failures,
and we aren't going to mutate perfectly fine/working code, for the sake
of avoid a warning that shouldn't even exist.

I also do not see the point of playing whack-a-mole and turning off various
warnings/trying to further work around the broken compiler, just to
acheive warningless builds for the sake of warningless builds.

One anecdote from "How SQLite Is Tested":
> Static analysis has found a few bugs in SQLite, but those are the
> exceptions. More bugs have been introduced into SQLite while trying
> to get it to compile without warnings than have been found by static
> analysis.

https://www.sqlite.org/testing.html.
2023-02-01 15:22:24 +00:00
MarcoFalke
fa6986a66b
ci: Print iwyu patch in git diff format 2023-02-01 14:11:48 +01:00
fanquake
b5868f4b1f
Merge bitcoin/bitcoin#23670: build: Build minisketch test in make check, not in make
6d58117a31 build: Build minisketch test in `make check`, not in `make` (Hennadii Stepanov)

Pull request description:

  On master (d1e42659bb):
  ```
  $ ./autogen.sh && ./configure --without-gui --disable-wallet && make clean
  $ make 2>&1 | grep LD | grep -v .la
    CXXLD    bitcoind
    CXXLD    bitcoin-cli
    CXXLD    bitcoin-tx
    CXXLD    bitcoin-util
    CXXLD    test/test_bitcoin
    CXXLD    bench/bench_bitcoin
    CXXLD    minisketch/test
    CXXLD    test/fuzz/fuzz
    CXXLD    univalue/test/object
    CXXLD    univalue/test/unitester
  $ make check 2>&1 | grep LD
    CCLD     exhaustive_tests
    CCLD     tests
  ```

  With this PR:
  ```
  $ ./autogen.sh && ./configure --without-gui --disable-wallet && make clean
  $ make 2>&1 | grep LD | grep -v .la
    CXXLD    bitcoind
    CXXLD    bitcoin-cli
    CXXLD    bitcoin-tx
    CXXLD    bitcoin-util
    CXXLD    test/test_bitcoin
    CXXLD    bench/bench_bitcoin
    CXXLD    test/fuzz/fuzz
    CXXLD    univalue/test/object
    CXXLD    univalue/test/unitester
  $ make check 2>&1 | grep LD
    CXXLD    minisketch/test
    CCLD     exhaustive_tests
    CCLD     tests
  ```

  In fact, this PR restores behavior that was before bitcoin/bitcoin#22646, and that behavior looks more optimal.

  As an outcome, the `contrib/guix/libexec/build.sh` does not spend resources to build binaries which are not a part of the release package.

ACKs for top commit:
  TheCharlatan:
    ACK 6d58117a31

Tree-SHA512: 4957c8f88a01aca005813bf4c1c26f433756bf68ea0c958481c638ead229fa8e23ecae3a8ac31ea555876ba6f2cc10ecd91caf2e2f664de5cb529ec05fb38fa7
2023-01-31 17:55:44 +00:00
fanquake
7241b936c5
Merge bitcoin/bitcoin#26965: refactor: Remove stray cs_main redundant declaration
faba08b5b4 refactor: Remove stray cs_main redundant declaration (MarcoFalke)
fa02591edf doc: Export threadsafety.h from sync.h (MarcoFalke)

Pull request description:

  Looks like this was forgotten when introducing kernel/cs_main ?

  Also, there is a commit to export threadsafety.h from sync.h.

ACKs for top commit:
  hebasto:
    ACK faba08b5b4

Tree-SHA512: 0aa58e7693b6fcd504f9da7339f8baa463a6407f67b27f68002db705f4642321ac3765f16c3d906c925ee24085591b79160a62fa5f4aaf6f2e5dcc788411800d
2023-01-30 17:27:44 +00:00
fanquake
228edafc66
Merge bitcoin/bitcoin#23619: build: Propagate user-defined flags to host packages
a3a2bd9e8a ci: Drop no longer needed package-specific flags (Hennadii Stepanov)
071eef1e97 build: Propagate user-defined flags to host packages (Hennadii Stepanov)

Pull request description:

  On master (4f8b1f8759) `{CPP,C,CXX,LD}FLAGS` that are specified in the command line are not propagated to packages:
  ```
  $ make --no-print-directory -C depends print-libevent_cxxflags CXXFLAGS=-some-fancy-flag
  libevent_cxxflags=-pipe -O2
  ```

  This PR:
  - propagates `{CPP,C,CXX,LD}FLAGS` to host packages:
  ```
  $ make --no-print-directory -C depends print-libevent_cxxflags CXXFLAGS=-some-fancy-flag
  libevent_cxxflags= -some-fancy-flag
  ```
  - does not propagate `{CPP,C,CXX,LD}FLAGS` to native packages:
  ```
  $ make --no-print-directory -C depends print-native_b2_cxxflags CXXFLAGS=-some-fancy-flag
  native_b2_cxxflags=
  ```
  - actually addresses the https://github.com/bitcoin/bitcoin/pull/23551#issuecomment-973896518

ACKs for top commit:
  TheCharlatan:
    Code review ACK a3a2bd9e8a

Tree-SHA512: 243d6b1b0e9c5de46debc36de62a77b6b4d6f638940fd530040c219956ec624e321b0c25290fed164e3a8c88befa7b97b20f765d7b9a428c269b3720f21da099
2023-01-30 14:32:32 +00:00
MarcoFalke
fa486de212
ci: Cache package manager install step 2023-01-28 17:59:07 +01:00
MarcoFalke
faba08b5b4
refactor: Remove stray cs_main redundant declaration 2023-01-25 09:56:26 +01:00
MarcoFalke
fa88d42123
ci: Fix APPEND_APT_SOURCES_LIST trying to modify the host system 2023-01-24 20:33:55 +01:00
MarcoFalke
250598a905
Merge bitcoin/bitcoin#26906: test: add an easy way to run linters locally
b68e5a7fef lint: specify the right commit range when running locally (James O'Beirne)
dff7ed5732 test: add an easy way to run linters locally (James O'Beirne)

Pull request description:

  Adds a Dockerfile configuration ~~(originally written mostly by fanquake)~~ that allows straightforward running of linters with compatible versions locally. This removes a ton of annoyance when trying to appease CI, because many of the linter versions are quite old and difficult to maintain locally.

  I realize that people may not be thrilled to add more ancillary tooling to the repo, but I think this makes a lot of sense given the linter versions listed in this container configuration are dictated by this repo (within the CI configuration), so having these things live in two separate places is a recipe for version mismatches.

  Eventually we can likely just use this container on CI directly to avoid any chance of inconsistencies between local dev experience and CI.

ACKs for top commit:
  aureleoules:
    ACK b68e5a7fef
  stickies-v:
    ACK b68e5a7fe
  john-moffett:
    ACK b68e5a7fef

Tree-SHA512: 7ef7a5dae023d81fdb6296d5d92dfa074ee321c7993e607c9f014d0f21c91558611aa00fc3ce1edc7b5e68371aea0d27fa1931291a79bb867a6c783bb536775f
2023-01-19 19:01:28 +01:00
James O'Beirne
b68e5a7fef lint: specify the right commit range when running locally
When running lints on Cirrus, a special envvar is set ($CIRRUS_PR);
emulate this when running linters locally by setting $LOCAL_BRANCH
to any value.
2023-01-18 09:48:14 -05:00
James O'Beirne
dff7ed5732 test: add an easy way to run linters locally
Adds a Dockerfile configuration
that allows straightforward running of linters with compatible versions
locally. This removes a ton of annoyance when trying to appease CI,
because many of the linter versions are quite old and difficult to
maintain locally.

I realize that people may not be thrilled to more ancillary tooling to
the repo, but I think this makes a lot of sense given the linter
versions listed in this container configuration are dictated by this
repo (within the CI configuration), so having these things live in
two separate places is a recipe for version mismatches.

Eventually we can likely just use this container on CI directly to avoid
any chance of inconsistencies between local dev experience and CI.
2023-01-18 09:48:08 -05:00
MarcoFalke
dddd462137
Bump minimum python version to 3.7 2023-01-18 12:59:11 +01:00
fanquake
c9db788a11
Merge bitcoin/bitcoin#26908: ci: Add missing lint dependency (gpg)
fa87d71872 ci: Add missing lint dependency (MarcoFalke)

Pull request description:

  Also, document each dependency.

  Adding `gpg` avoids errors when running a release or dev branch in the CI:

  01ec5308bf/ci/lint/06_script.sh (L30-L42)

  ```
  bash: line 1: gpg: command not found
  ```

  https://cirrus-ci.com/task/4582854860996608?logs=lint#L185

ACKs for top commit:
  hebasto:
    ACK fa87d71872

Tree-SHA512: 869a3d2feab764b2c8d47d481359680a1d2c54a33b13ca26c5f8ce56cf2f368d4c74637dcbc53fdbf323f10940965c1c0e592e2fb4ce725d5cd467e77e62b6e5
2023-01-18 11:41:12 +00:00
MarcoFalke
faddb7373a
ci: Bump --combinedlogslen to debug intermittent issues 2023-01-18 09:35:47 +01:00
MarcoFalke
fa87d71872
ci: Add missing lint dependency 2023-01-17 19:09:44 +01:00
MarcoFalke
01ec5308bf
Merge bitcoin/bitcoin#26716: ci: Build python from source in "lint" task
123043e99c ci: Bump lint task image to Ubuntu Jammy (Hennadii Stepanov)
9b86114058 ci: Use pyenv's `python-build` to install Python in lint task (Hennadii Stepanov)

Pull request description:

  This PR:
  - is an alternative to bitcoin/bitcoin#26581 and bitcoin/bitcoin#26637
  - closes bitcoin/bitcoin#26548

  Key advantages of this PR over others:
  - it uses pyenv's `python-build` [standalone](https://github.com/pyenv/pyenv/tree/master/plugins/python-build#using-python-build-standalone)
  - requires no additional computational resources

  Note for testing. The lint task must success regardless of whether the `python_cache` is populated or invalidated.

ACKs for top commit:
  MarcoFalke:
    ACK 123043e99c
  fanquake:
    ACK 123043e99c

Tree-SHA512: ba0fcdd4f2939a59692b173dcd1f5704444cfcfbb8111538c6f8160056d0536bba250e4f9b0f8c66f8b454e52034bf36ffe6afae76cdc0f7cc5b58b576d790ba
2023-01-17 18:35:47 +01:00
Hennadii Stepanov
123043e99c
ci: Bump lint task image to Ubuntu Jammy 2023-01-16 13:30:00 +00:00
Hennadii Stepanov
9b86114058
ci: Use pyenv's python-build to install Python in lint task 2023-01-16 13:29:44 +00:00
MarcoFalke
fa0584eb82
ci: Stop and remove CI container 2023-01-11 10:49:39 +01:00
MarcoFalke
fa5dccba32
scripted-diff: ci: Rework docker naming
DOCKER in names is confusingly used as synonym for "image", "container",
and "ci". Fix the confusion by picking the term that fits the context.

-BEGIN VERIFY SCRIPT-
 ren() { sed -i "s:$1:$2:g" $( git grep -l "$1" ) ; }

 ren DOCKER_PACKAGES CI_BASE_PACKAGES
 # This better reflects that they are the common base for all CI
 # containers.

 ren DOCKER_ID CI_CONTAINER_ID
 # This is according to the documentation of "--detach , -d: Run
 # container in background and print container ID".

 ren DOCKER_NAME_TAG CI_IMAGE_NAME_TAG
 # This avoids confusing with CONTAINER_NAME and clarifies that it is an
 # image.

 ren DOCKER_ADMIN CI_CONTAINER_CAP
 # This clarifies that it is a capability added to the container.

 ren DOCKER_CI_CMD_PREFIX CI_EXEC_CMD_PREFIX
 # This brings it in line with the CI_EXEC naming.

-END VERIFY SCRIPT-
2023-01-11 10:49:18 +01:00
MarcoFalke
fadfae42f1
ci: Remove unused busybox workaround
The find workaround is no longer needed after commit
d3d547c545
2023-01-09 12:40:45 +01:00
MarcoFalke
fac424fce7
ci: Create named symbol for BINS_SCRATCH_DIR
Also, create the dir a bit earlier, right after it was put in the PATH.
2023-01-09 11:53:20 +01:00
MarcoFalke
fa4e98c77f
ci: Fix ci_native_fuzz_msan CONTAINER_NAME 2023-01-07 11:47:38 +01:00