Commit Graph

2657 Commits

Author SHA1 Message Date
merge-script
005ea9f42e Merge bitcoin/bitcoin#35778: scripted-diff: Use C.UTF-8 locale in all shell scripts
46654094be lint: Use C.UTF-8 locale only in shell scripts (Hennadii Stepanov)
982ee64938 lint: Skip `libmultiprocess` subtree in `lint-shell-locale.py` (Hennadii Stepanov)
1194918a5d scripted-diff: Use C.UTF-8 locale in all shell scripts (Hennadii Stepanov)

Pull request description:

  This unifies the used locales across the entire codebase.

  Additionally, the `test/lint/lint-shell-locale.py` linter has been adjusted accordingly.

  Also see https://github.com/bitcoin/bitcoin/pull/35775#issuecomment-5047323736.

ACKs for top commit:
  fanquake:
    ACK 46654094be

Tree-SHA512: e72e076614602937c5fe6ca27d0bb7bebe4464ef28455c43a1bd1d700ffeeea684365fa5749cb1e5fdad56178a1e88a544b5854783b57aef468efb105a03af57
2026-09-09 12:02:03 +01:00
Hennadii Stepanov
3b944f194f iwyu: Switch to generated Clang intrinsics mapping file 2026-09-07 12:09:05 +01:00
Hennadii Stepanov
1b5ee3be59 ci: Upgrade IWYU to 0.27 compatible with Clang 23
The new IWYU release includes several improvements and bug fixes,
including:
- https://github.com/include-what-you-use/include-what-you-use/pull/1991
- https://github.com/include-what-you-use/include-what-you-use/pull/2013
- https://github.com/include-what-you-use/include-what-you-use/pull/2014
- https://github.com/include-what-you-use/include-what-you-use/pull/2058
- https://github.com/include-what-you-use/include-what-you-use/pull/2062
- https://github.com/include-what-you-use/include-what-you-use/pull/2093
2026-09-07 12:00:04 +01:00
merge-script
204256c73f Merge bitcoin/bitcoin#35900: iwyu: Fix warnings in src/interfaces and treat them as errors
b3ff9c4d68 iwyu: Fix warnings in `src/interfaces` and treat them as errors (Hennadii Stepanov)
d564b0255f iwyu: Add temporary mapping to work around upstream bug (Hennadii Stepanov)

Pull request description:

  This PR continues the ongoing effort to enforce IWYU warnings.

  See [Developer Notes](https://github.com/bitcoin/bitcoin/blob/master/doc/developer-notes.md#using-iwyu).

ACKs for top commit:
  maflcko:
    review ACK b3ff9c4d68 🖋

Tree-SHA512: 9359854c7b6e6ec93022947e78ef57fc68728326df874371028997a550fd1b6ef08e4b09271163b9d5c921c9e01deadf92b0eb5ae3f620d797e4f9bdea8f4727
2026-08-27 14:55:53 +01:00
merge-script
04cf9ecee4 Merge bitcoin/bitcoin#35978: contrib/init: fix unused variables in openrc script
d837bb38a4 contrib/init: fix unused variables in openrc script (jpk68)

Pull request description:

  - Makes it so that `${BITCOIND_BIN}` is actually used as `command=`, rather than the hardcoded `/usr/bin/bitcoind`.
  - Passes `BITCOIND_GROUP` to `start-stop-daemon`, so that the daemon process itself runs under it.

ACKs for top commit:
  jeanpablojp:
    utACK d837bb38a4
  thomasbuilds:
    ACK d837bb38
  winterrdog:
    utACK d837bb38a4

Tree-SHA512: 78c237224d65cc47ade606df4808fbf4ca70109d95301c35d1b336eead1b25138a83ce6f2314775b8a11a6745af2220af9027640530b9edb7e0167ccea081b6b
2026-08-24 19:51:29 +01:00
Hennadii Stepanov
d564b0255f iwyu: Add temporary mapping to work around upstream bug 2026-08-22 10:45:24 +01:00
merge-script
56db08d529 Merge bitcoin/bitcoin#35877: build: ci/doc win64-cross build via nix
fa8762da62 build: ci/doc win64-cross build via nix (MarcoFalke)
fafe7205cc doc: Clarify that cygwin/msys2 are not tested/supported (MarcoFalke)

Pull request description:

  Release cross-builds to win64 are done in guix. There are also docs to use Debian/Ubuntu for those cross-builds and this approach is used in CI. However, there are many problems:

  * The CI is intended to mirror the guix build, but often it is not possible to find the major versions used for mingw and GCC in the guix build in the `apt` packages for an LTS distro.
  * Users on older distro releases may lack released bugfixes, such as 8e06daa36d in mingw 13  (e.g. Debian Trixie with mingw 12, https://packages.debian.org/trixie/mingw-w64-x86-64-dev).
  * When using the UCRT variant of the build, this uncovers bugs such as https://bugs.launchpad.net/ubuntu/+source/mingw-w64/+bug/2106420 or https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1121403.

  So add a way to use nix to do the cross build. This allows to closer mimic the guix build.

  Also, clarify that cygwin/msys2 are not tested/supported.

ACKs for top commit:
  willcl-ark:
    reACK fa8762da62
  hebasto:
    re-ACK fa8762da62.

Tree-SHA512: de94f8bc4bb6ed9a75352cd909aa227c5954e336bf9b14969d7412b5cedfbe6cd6b2d8b476d5b1b0bcfc93bdb32fc229015855082350c8c507189e34b9b3ef3f
2026-08-20 15:26:53 +01:00
merge-script
a07f1313b1 Merge bitcoin/bitcoin#35980: contrib: reject divergent verify-commits history
465bca734e contrib: reject divergent verify-commits history (Lőrinc)
b3d1dca338 contrib: fail on verify-commits ancestry errors (Lőrinc)

Pull request description:

  **Problem:** `verify-commits.py` checks a Git commit's history for trusted signatures and tree hashes back to configured roots.
  The documented workflow runs this check after fetching a commit and before checkout, proceeding only when the script succeeds.
  A commit that is an ancestor of a configured root is intentionally accepted without checking earlier history.
  The script also takes this success path after Git errors or for divergent commits, even though neither establishes that relationship.

  **Fix:** Require Git to prove the ancestor relationship before taking this success path.

  **Reproducers:** Each commit can be validated manually.
  <details><summary>Manual reproducer: Git error</summary>

  Run this on `master` and at this PR's head:

  ```bash
  contrib/verify-commits/verify-commits.py 0000000000000000000000000000000000000000 && echo  || echo 
  ```

  `master` exits successfully without verifying the missing commit, while the PR head rejects the Git error.
  </details>

  <details><summary>Manual reproducer: divergent history</summary>

  On `master` and at this PR's head, create an unreferenced sibling of the trusted root and run the verifier:

  ```bash
  root=$(head -n1 contrib/verify-commits/trusted-git-root)
  divergent_commit=$(git commit-tree "$root^{tree}" -p "$root^" -m 'divergent commit')
  contrib/verify-commits/verify-commits.py "$divergent_commit" && echo  || echo 
  ```

  `master` exits successfully without verifying the sibling commit, while the PR head rejects divergent history.
  </details>

  This issue was also found and disclosed responsibly by the Red Team 🟥.

ACKs for top commit:
  151henry151:
    tACK 465bca734e
  jeanpablojp:
    tACK 465bca734e
  achow101:
    ACK 465bca734e
  sedited:
    ACK 465bca734e
  maflcko:
    review ACK 465bca734e 🥜

Tree-SHA512: 72b8cd9902d881e59a1d99fda8e5d511806826fa27c05a2c21a7d2eb62b2a5a0b1b6bdc67e8d19d57f9171278f4858fd019eb7890b960df0475ba4713683f0ac
2026-08-19 18:37:24 +02:00
MarcoFalke
fa8762da62 build: ci/doc win64-cross build via nix 2026-08-19 15:39:50 +02:00
merge-script
fe5e2a6319 Merge bitcoin/bitcoin#32162: depends: Switch from multilib to platform-specific toolchains
de9b436ba3 depends: Switch from multilib to platform-specific toolchains (Hennadii Stepanov)

Pull request description:

  Using the multilib GCC toolchain, as currently documented in [`depends/README.md`](4c1906a500/depends/README.md), has several issues, such as:

  1. The [`g++-multilib`](https://packages.ubuntu.com/noble/g++-multilib) package conflicts with platform-specific cross-compiler packages. This means it is not possible to cross compile for `i686` and other platforms using the same set of installed packages.

  2. The [`g++-multilib`](https://packages.ubuntu.com/noble/g++-multilib) package is not available for `arm64`:
  ```sh
  $ sudo apt install g++-multilib
  Reading package lists... Done
  Building dependency tree... Done
  Reading state information... Done
  E: Unable to locate package g++-multilib
  ```

  3. Managing the multilib GCC toolchain requires additional code in both depends and Guix scripts.

  This PR addresses all the issues mentioned above by switching from multilib to platform-specific toolchains.

  Also see https://github.com/bitcoin/bitcoin/pull/22456.

  ---

  Here are examples of building for different scenarions:

  - Linux, `x86_64` or `arm64`, building with depends natively:
  ```sh
  $ gmake -C depends -j $(nproc)
  $ cmake -B build --toolchain depends/$(./depends/config.sub $(./depends/config.guess))/toolchain.cmake
  $ cmake --build build -j $(nproc)
  ```

  - Linux, `x86_64` or `arm64`, cross compiling for `i686-pc-linux-gnu`:
  ```sh
  $ sudo apt install g++-i686-linux-gnu binutils-i686-linux-gnu
  $ export HOST=i686-linux-gnu
  $ gmake -C depends -j $(nproc)
  $ cmake -B build-${HOST} --toolchain depends/${HOST}/toolchain.cmake
  $ cmake --build build-${HOST} -j $(nproc)
  ```

  - Linux, `x86_64`, cross compiling for `arm64`:
  ```sh
  $ sudo apt install g++-aarch64-linux-gnu binutils-aarch64-linux-gnu
  $ export HOST=aarch64-linux-gnu
  $ gmake -C depends -j $(nproc)
  $ cmake -B build-${HOST} --toolchain depends/${HOST}/toolchain.cmake
  $ cmake --build build-${HOST} -j $(nproc)
  ```

  - Linux, `arm64`, cross compiling for `x86_64`:
  ```sh
  $ sudo apt install g++-x86-64-linux-gnu binutils-x86-64-linux-gnu
  $ export HOST=x86_64-linux-gnu
  $ gmake -C depends -j $(nproc)
  $ cmake -B build-${HOST} --toolchain depends/${HOST}/toolchain.cmake
  $ cmake --build build-${HOST} -j $(nproc)
  ```

ACKs for top commit:
  fanquake:
    ACK de9b436ba3
  BrandonOdiwuor:
    ACK de9b436ba3

Tree-SHA512: 453b4744974cdf56d6edfdbe93bb11e3bae3f9bc9cd99b9c57aee74e65fcdd3ac011a1dcc19f485ea3be427f4e9c6c6b0d704881369f719620f0cb299123e561
2026-08-19 14:19:47 +01:00
fanquake
5548818115 guix: build glibc with --enable-kernel=3.17.0 2026-08-17 12:29:15 +01:00
Lőrinc
465bca734e contrib: reject divergent verify-commits history
`verify-commits.py` must not authorize checkout for a commit whose history diverges from configured trust roots.
Require proof that the commit is an ancestor of a root before skipping checks, and identify the failing root in errors.

Co-authored-by: Rob Hamilton <6456095+Rob1Ham@users.noreply.github.com>
2026-08-14 17:24:59 -07:00
Lőrinc
b3d1dca338 contrib: fail on verify-commits ancestry errors
`verify-commits.py` must not authorize checkout when Git cannot inspect the requested commit or its ancestry.
Reject ancestry command errors and validate the exact trusted root through Git before reporting success.

Co-authored-by: Rob Hamilton <6456095+Rob1Ham@users.noreply.github.com>
2026-08-14 17:24:37 -07:00
jpk68
d837bb38a4 contrib/init: fix unused variables in openrc script 2026-08-14 19:01:16 -04:00
MarcoFalke
fa08bbed8d contrib: Adjust generate-seeds.py to write inline constexpr
Otherwise, the changes in the previous commit will be reverted when this
script regenerates the header.

Co-Authored-By: l0rinc <pap.lorinc@gmail.com>
2026-08-05 08:34:38 +02:00
fanquake
b75eb938a0 guix: move python-minimal to GUI build 2026-08-03 14:47:39 +01:00
fanquake
101400b28f guix: remove -Werror=dev
Otherwise the build will fail with warnings about missing Python (removed
in the next commit). However the non-gui build does not need Python.

Note that #25573 contains the same change, because the use of -static-pie
causes warnings when combined with our/CMakes own PIE handling.
2026-08-03 13:32:07 +01:00
fanquake
594a02c3ae lint: re-add guix scripts to mypy linting
These were no-longer being linted after #32458.

suppress `[union-attr]` warning. i.e:
```bash
contrib/guix/symbol-check.py:309: error: Item "None" of "lief.PE.Binary | lief.ELF.Binary | lief.MachO.Binary | lief.COFF.Binary | None" has no attribute "format"  [union-attr]
contrib/guix/security-check.py:284: error: Item "lief.COFF.Binary" of "lief.PE.Binary | lief.ELF.Binary | lief.MachO.Binary | lief.COFF.Binary | None" has no attribute "abstract"  [union-attr]
```
2026-08-03 11:52:14 +01:00
fanquake
683ae4c520 guix: consolidate config flags 2026-07-29 11:16:58 +01:00
fanquake
665f11d04a guix: consolidate gcc toolchain setup 2026-07-29 11:16:58 +01:00
fanquake
288f76ed0f guix: consolidate mingw-w64 toolchain setup 2026-07-29 11:16:58 +01:00
fanquake
cc9b0f2266 guix: consolidate LLVM toolchain setup 2026-07-29 11:16:58 +01:00
fanquake
b12a70f330 guix: turn linux/win linker warnings into errors
Can do this now that the GUI has been split out.

riscv64-linux-gnu failus due to
https://github.com/boostorg/test/issues/345:
```bash
[102%] Linking CXX executable ../../bin/test_bitcoin
/gnu/store/r03804zpq5i6wsalx0yaqrr5jb7pqrmv-binutils-cross-riscv64-linux-gnu-2.46.0/bin/riscv64-linux-gnu-ld: CMakeFiles/test_bitcoin.dir/main.cpp.o: in function `boost::fpe::disable(unsigned int)':
/bitcoin/depends/riscv64-linux-gnu/boost/include/boost/test/impl/execution_monitor.ipp:1538:(.text+0x9dc8): warning: fedisableexcept is not implemented and will always fail
/gnu/store/r03804zpq5i6wsalx0yaqrr5jb7pqrmv-binutils-cross-riscv64-linux-gnu-2.46.0/bin/riscv64-linux-gnu-ld: CMakeFiles/test_bitcoin.dir/main.cpp.o: in function `boost::fpe::enable(unsigned int)':
/bitcoin/depends/riscv64-linux-gnu/boost/include/boost/test/impl/execution_monitor.ipp:1502:(.text+0x9d76): warning: feenableexcept is not implemented and will always fail
collect2: error: ld returned 1 exit status
```

Darwin could be done after something like
https://github.com/bitcoin/bitcoin/pull/35756.
2026-07-29 11:16:58 +01:00
merge-script
a2aab6df97 Merge bitcoin/bitcoin#35810: guix: Drop unused (guix licenses) import from manifest_build.scm
a92e93429e guix: Drop unused `(guix licenses)` import from `manifest_build.scm` (Hennadii Stepanov)

Pull request description:

  This was overlooked in bitcoin/bitcoin#34948.

ACKs for top commit:
  fanquake:
    ACK a92e93429e

Tree-SHA512: ab1ff63b49da104b21c4731ea06d3a4db009712be7c50f907cd46d0ad2936f7a236915bbe436801f02ea32bd781dfb5f38d349dda0a99a563701bef1089f35a6
2026-07-27 12:00:49 +01:00
Hennadii Stepanov
1194918a5d scripted-diff: Use C.UTF-8 locale in all shell scripts
There is no reason to avoid it nowadays.

-BEGIN VERIFY SCRIPT-

sed -i "s/\<export LC_ALL=C\>/export LC_ALL=C.UTF-8/g" \
 $( git grep -l "^export LC_ALL=C$" -- ':!src/ipc/libmultiprocess' ':!src/minisketch' ':!src/secp256k1' )

-END VERIFY SCRIPT-
2026-07-26 16:42:48 +01:00
Hennadii Stepanov
a92e93429e guix: Drop unused (guix licenses) import from manifest_build.scm
This was overlooked in bitcoin/bitcoin#34948.
2026-07-26 15:42:53 +01:00
fanquake
baa5a2ce43 guix: pass --disable-tm-clone-registry to base GCC
We don't need support for transactional memory.

> Disable TM clone registry in libgcc. It is enabled in libgcc by default.
> This option helps to reduce code size for embedded targets which do
> not use transactional memory.

https://gcc.gnu.org/install/configure.html
2026-07-24 10:26:22 +01:00
fanquake
9c2589630f guix: mirror some arguments from linux-gcc to mingw-w64-gcc 2026-07-24 10:26:22 +01:00
fanquake
e0b8fbde89 guix: disable-nls in *-base-gcc 2026-07-24 10:26:22 +01:00
fanquake
7dc87f8e1e guix: disable-lto in *-base-gcc 2026-07-24 10:26:22 +01:00
fanquake
9ed3d6ef2a guix: modernise style in *-base-gcc 2026-07-24 10:26:21 +01:00
merge-script
290cb2f17e Merge bitcoin/bitcoin#35775: scripted-diff: Use C.UTF-8 locale in Guix scripts
2cb3bfa8df scripted-diff: Use long form of shell options in Guix scripts (Hennadii Stepanov)
711eb10f08 guix: Add copyright headers to Guix scripts (Hennadii Stepanov)
80f831494e guix: Fix `glibc` version in comment (Hennadii Stepanov)
8916f7967e scripted-diff: Use C.UTF-8 locale in Guix scripts (Hennadii Stepanov)

Pull request description:

  The C.UTF-8 locale is set by default in `guix shell`, and there is no reason to avoid it nowadays. This PR also silences superfluous warnings from Qt tools, making build logs cleaner and other issues easier to spot. For example:
  ```
  Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8.
  Qt depends on a UTF-8 locale, and has switched to "C.UTF-8" instead.
  If this causes problems, reconfigure your locale. See the locale(1) manual
  for more information.
  ```

  Locales in the `guix-*` launch scripts have been updated as well for consistency with the rest of the codebase.

  Additionally, the headers of the Guix scripts have been adjusted for [uniformity](https://github.com/bitcoin/bitcoin/pull/35775#discussion_r3636959268).

ACKs for top commit:
  fanquake:
    ACK 2cb3bfa8df

Tree-SHA512: 9e21d4ad50f5d583efdd8f79d9f96d45a92f1982ea3a422565bceea38aa50bbd9a9360972b37a1b49907e67523d68f3d1f889cb26179ce735453eb4fae4d3fa4
2026-07-23 14:33:55 +01:00
Hennadii Stepanov
2cb3bfa8df scripted-diff: Use long form of shell options in Guix scripts
This improves readability and consistency across all Guix scripts.

-BEGIN VERIFY SCRIPT-

sed -i "s/^set -e\>/set -o errexit/g" \
 $( git grep -l "set -e" ./contrib/guix )

-END VERIFY SCRIPT-
2026-07-23 12:31:31 +01:00
Hennadii Stepanov
711eb10f08 guix: Add copyright headers to Guix scripts 2026-07-23 11:13:22 +01:00
Hennadii Stepanov
8a90c7cd97 guix: Build for macOS using LLVM toolchain only 2026-07-22 20:20:10 +01:00
Hennadii Stepanov
80f831494e guix: Fix glibc version in comment
At the current time-machine commit
c5eee3336cc1d10a3cc1c97fde2809c3451624d3, the default `glibc` package
version is 2.41.
2026-07-22 15:29:26 +01:00
Hennadii Stepanov
8916f7967e scripted-diff: Use C.UTF-8 locale in Guix scripts
The C.UTF-8 locale is set by default in `guix shell`, and there is no
reason to avoid it nowadays. This change also silences superfluous
warnings from Qt tools, making build logs cleaner and other issues
easier to spot.

Locales in the `guix-*` launch scripts have been updated as well for
consistency with the rest of the codebase.

-BEGIN VERIFY SCRIPT-

sed -i "s/\<export LC_ALL=C\>/export LC_ALL=C.UTF-8/g" \
 $( git grep -l "export LC_ALL=C" ./contrib/guix/* )

-END VERIFY SCRIPT-
2026-07-22 15:29:18 +01:00
Hennadii Stepanov
7e1a750d45 guix, refactor: Use target variable instead of hardcoded value 2026-07-21 13:52:46 +01:00
Hennadii Stepanov
de9b436ba3 depends: Switch from multilib to platform-specific toolchains 2026-07-21 13:33:24 +01:00
fanquake
0b0785daa0 guix: split macOS and win builds
Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
2026-07-20 09:28:35 +01:00
fanquake
008a3e29c8 guix: split builds into Linux(gui) and macOS/Windows 2026-07-20 09:28:29 +01:00
Pieter Wuille
d908063980 chainparams: delete my DNS seed 2026-07-09 14:05:28 -04:00
Hennadii Stepanov
059edf1908 guix: Fix "Ignoring empty string" CMake warning for non-Linux hosts
Using shell parameter expansion ensures that on non-Linux hosts the
build script won't pass an empty string argument to CMake. This resolves
the "Ignoring empty string" warning.
2026-06-15 15:38:07 +01:00
Hennadii Stepanov
2d86083fd4 guix: Drop redundant CMake --verbose options
CMake's verbose output is already controlled by the `VERBOSE`
environment variable, which has been exported since commit 85f4a4b082.
2026-06-15 15:38:01 +01:00
fanquake
9bfdde74b5 guix: add package.sh
Split out packaging code, so that it can be re-used by
build scripts.
2026-06-12 12:03:55 +02:00
fanquake
54de023a7c guix: add setup.sh
Split out setup & tarball creation code, so that it can be re-used by
build scripts.
2026-06-04 10:09:19 +01:00
Hennadii Stepanov
53388773af guix: Remove redundant ShellCheck source directives 2026-05-28 12:26:48 +01:00
Hennadii Stepanov
62cf7bc53f guix, refactor: Add BASE argument to *_for_host functions 2026-05-28 12:21:37 +01:00
Hennadii Stepanov
5d46429e32 guix, refactor: Move distsrc_for_host() to prelude.bash
The `distsrc_for_host()` function now accepts a second optional
argument, `SUFFIX`, making it consistent with other similar functions.
2026-05-28 12:17:55 +01:00
Hennadii Stepanov
cab65ea9c6 guix, refactor: Move duplicated profiledir_for_host() to prelude.bash 2026-05-28 12:17:19 +01:00