Commit Graph

2203 Commits

Author SHA1 Message Date
Hodlinator
c06f2368e2
refactor: Hand-replace some uint256S -> uint256
chainparams.cpp - workaround for MSVC bug triggering C7595 - Calling consteval constructors in initializer lists fails, but works on GCC (13.2.0) & Clang (17.0.6).
2024-08-05 14:51:47 +02:00
merge-script
2401a24387
Merge bitcoin/bitcoin#30452: guix: bump time-machine to efc26826400762207cde9f23802cfe75a737963c
6ee000e56f guix: bump time-machine to efc26826400762207cde9f23802cfe75a737963c (fanquake)
cbeb2c20e1 guix: patch /gnu/store paths out of winpthreads (fanquake)

Pull request description:

  Needed for https://github.com/bitcoin/bitcoin/issues/30210. This doesn't switch runtimes, because upstream is
  still configured to use the old runtime. See:
  https://git.savannah.gnu.org/cgit/guix.git/commit/?id=17188be0f723e00377b21b767f5447d7938a116e.

  git-mimimal `2.45.1` -> `2.45.2`
  Kernel Headers `6.1.92` -> `6.1.100`
  LLVM `18.1.6` -> `18.1.8`
  mingw-w64 `11.0.1` -> `12.0.0`
  NSIS `3.09` -> `3.10`
  patch `2.7.6` -> `2.7.6-0.f144b35`

ACKs for top commit:
  TheCharlatan:
    ACK 6ee000e56f

Tree-SHA512: f4f99d16dd8cab5b2b7c5d82111af86de20e1669cc3b4054d72ab4a67b2956757df170f0df28c96d18653c1c9d2ebdd0ecc441005726a20cd963d98513b4a851
2024-07-31 09:50:10 +01:00
merge-script
4c62f4b535
Merge bitcoin/bitcoin#30451: depends: remove Darwin ENV unsetting
bda537f7c4 depends: remove ENV unsetting for darwin (fanquake)
1807760f09 guix: improve ENV unsetting for macOS (fanquake)
0b2aeee21d depends: patch explicit -lm usage out of Qt tools (fanquake)

Pull request description:

  Now that we use the native compiler, and have fixed Qt, and these vars
  are (almost) unset in Guix, we can remove the unsetting from our compiler
  command here.

  I couldn't manage to make a darwin-clang-cross only exclusion of `-lm` work properly
  for Qt, so opted for just removing the explicit link entirely. I do not think this should have
  any other unwanted side-effects.

  Fixes #21552.

ACKs for top commit:
  TheCharlatan:
    ACK bda537f7c4

Tree-SHA512: 97a2d85de7d4b1d65717ecb521399ecba5f53863b8aef21af62ede5ceee59ee1a9392663da3a3852cad1b6d8b420dd4b0b5f0eea38d30a81785d8b2718620b5f
2024-07-30 14:32:14 +01:00
fanquake
e6df3485ed
guix: move bison from global scope, to Linux
This is only needed for the Qt build, on Linux, so does not need to be
built/present for the macOS or Windows builds.
2024-07-26 17:17:45 +01:00
fanquake
6ee000e56f
guix: bump time-machine to efc26826400762207cde9f23802cfe75a737963c
Needed for 30210. This doesn't switch runtimes, because upstream is
still configured to use the old runtime. See:
https://git.savannah.gnu.org/cgit/guix.git/commit/?id=17188be0f723e00377b21b767f5447d7938a116e.

git-mimimal 2.45.1 -> 2.45.2
Kernel Headers 6.1.92 -> 6.1.100
LLVM 18.1.6 -> 18.1.8
mingw-w64 11.0.1 -> 12.0.0
NSIS 3.09 -> 3.10
patch 2.7.6 -> 2.7.6-0.f144b35
2024-07-26 09:31:16 +01:00
fanquake
cbeb2c20e1
guix: patch /gnu/store paths out of winpthreads
At the same time, align the docs for all patches that do the same thing.
2024-07-26 09:30:47 +01:00
fanquake
1807760f09
guix: improve ENV unsetting for macOS 2024-07-25 14:18:22 +01:00
merge-script
ab8e05eb53
Merge bitcoin/bitcoin#30511: guix: GCC 12 consolidation
d1592d2eee guix: use gcc-12 to compile winpthreads (fanquake)
b23690e821 guix: use GCC 12.4.0 over 12.3.0 (fanquake)
8b41ede55e guix: consolidate back to GCC 12 toolchain for all HOSTS (fanquake)

Pull request description:

  This PR contains 3 changes:

  * Bump GCC in Guix from [12.3.0 to 12.4.0](https://gcc.gnu.org/gcc-12/). A patch was sent upstream, https://lists.gnu.org/archive/html/guix-patches/2024-06/msg01025.html, but has not landed.
  * Consolidate all build environments back to using a GCC 12 toolchain. After #21778, the macOS environment is no-longer pinned to 11 (12 would otherwise cause issues building cctools). So, instead of requiring all builders to compile an additional GCC toolchain, use 12.
  * Use GCC 12 to compile winpthreads. Currently, GCC 11 is used; which became apparent in https://github.com/bitcoin/bitcoin/pull/30452#issuecomment-2244715566.

ACKs for top commit:
  TheCharlatan:
    ACK d1592d2eee
  hebasto:
    ACK d1592d2eee.

Tree-SHA512: e3aa1fa3e69500c93180e07cb4684661247ec6bc45245f746538d81406ff1d8777131590307496dda3287a112b6633e4991168586ca4c2036fa3a57b1efa9c87
2024-07-25 13:58:34 +01:00
fanquake
d1592d2eee
guix: use gcc-12 to compile winpthreads
Currently, winpthreads is compiled with GCC 11, when we want to be using
GCC 12 for all compilation.
2024-07-23 16:57:02 +01:00
fanquake
b23690e821
guix: use GCC 12.4.0 over 12.3.0
Our patch might be merged upstream soon:
https://lists.gnu.org/archive/html/guix-patches/2024-06/msg01025.html.

In the mean time, it's easy us for us to use the newer version of GCC.
2024-07-23 14:37:28 +01:00
fanquake
8b41ede55e
guix: consolidate back to GCC 12 toolchain for all HOSTS
Using GCC 11 for the macOS build hasn't been required since #21778, and
at this point, given a toolchain is still needed (#30206), it makes more
sense to (re-)use 12, rather than make all builders compile another
GCC toolchain.
2024-07-23 13:54:14 +01:00
fanquake
1bc9f64bee
contrib: assume binary existence in sec/sym checks
If the binaries don't exist, the Guix build has failed for some other
reason.

There's no need to check for unknown architectures, or executable
formats, as the only ones that could be built are those that we've
configured toolchains for in Guix.

We've also been doing this inconsistently across the two scripts.
2024-07-18 14:05:09 +01:00
fanquake
51d8f435c9
contrib: simplify ELF test-security-check 2024-07-18 10:31:05 +01:00
fanquake
1810e20677
contrib: simplify PE test-security-check 2024-07-18 10:31:01 +01:00
fanquake
6c9746ff92
contrib: simplify MACHO test-security-check 2024-07-18 09:49:51 +01:00
merge-script
5f538f2a7c
Merge bitcoin/bitcoin#30387: contrib: use c++ compiler rather than c compiler for binary checks
9010b1343b contrib: c++ify test stubs after switching to c++ compilers (Cory Fields)
261f770333 contrib: rename cc to cxx in binary checking scripts (Cory Fields)
a38c960005 contrib: use c++ rather than c for binary tests (Cory Fields)

Pull request description:

  From hebasto's CMake repo. See discussion here: https://github.com/hebasto/bitcoin/pull/252#discussion_r1664657488

  Use CXX/CXXFLAGS rather than CC/CFLAGS to test our actual compiler for binary checks rather than the one we only forward to secp256k1.

ACKs for top commit:
  hebasto:
    ACK 9010b1343b.
  fanquake:
    ACK 9010b1343b

Tree-SHA512: 7b8788d7d3760103062eff10056c995e1ad14c0c487d9414683ad54d816c255d0ca751f4d0e2d2ad7f9e8a7101d8c7f1e9333fa5b137558ed68fa593c4b4ce6d
2024-07-16 09:48:11 +01:00
merge-script
c2c0b4f002
Merge bitcoin/bitcoin#30146: Add clang-tidy check for thread_local vars
34c9cee380 clang-tidy: add check for non-trivial thread_local vars (Cory Fields)

Pull request description:

  Forbid thread_local vars with non-trivial destructors.

  This is a follow-up from: https://github.com/bitcoin/bitcoin/pull/30095#discussion_r1608423170

ACKs for top commit:
  maflcko:
    ACK 34c9cee380
  TheCharlatan:
    Re-ACK 34c9cee380

Tree-SHA512: 3a798607fb189a5bbc714ed6e86dea462fe29d366b790e96d10a7b4ffcf1f194da9b8f4cd0b82154408709b8e3c58d3f613d6311903bd65a76d8b556ab230d21
2024-07-11 18:59:49 +01:00
Cory Fields
9010b1343b contrib: c++ify test stubs after switching to c++ compilers 2024-07-11 17:29:06 +00:00
Cory Fields
261f770333 contrib: rename cc to cxx in binary checking scripts 2024-07-04 20:16:16 +00:00
Cory Fields
a38c960005 contrib: use c++ rather than c for binary tests
We don't actually use a c compiler as part of Core's build (only for secp).
We should be testing against what we're actually using instead.
2024-07-04 20:16:16 +00:00
merge-script
0c57a798b5
Merge bitcoin/bitcoin#29987: guix: build with glibc 2.31
b5fc6d46a3 guix: use glibc 2.31 (fanquake)

Pull request description:

  Set minimum required glibc to 2.31.
  The glibc 2.31 branch is still maintained: https://sourceware.org/git/?p=glibc.git;a=shortlog;h=refs/heads/release/2.31/master.

  Remove the stack-protector check from test-security-check, as the test
  no-longer fails, and given the control we have of the end, the actual
  security-check test seems sufficient (this might also be applied to some
  of the other checks).

  Drops runtime support for Ubuntu Bionic 18.04 and RHEL-8 from the release binaries.

ACKs for top commit:
  TheCharlatan:
    ACK b5fc6d46a3

Tree-SHA512: ba7e727240fa0ebebfb8b749024c71cbfdec37c33b39627866d78f9318ccdc687fd5103a63ee0e98cf809d9954dde56b1b305691c33d1de275ed0519f716c921
2024-06-26 15:21:44 +01:00
merge-script
2cd7c6bd93
Merge bitcoin/bitcoin#30147: contrib: Fixup verify-binaries OS platform parsing
3ab2520190 contrib: Fixup verify-binaries OS platform parsing (Ben Westgate)

Pull request description:

  Closes #30145.

  This PR solves two major issues in the `parse_version_string` function of verify-binaries:
  1. `-aarch64` binaries cannot be specifically downloaded. The -platform string gets interpreted as a release candidate that doesn't exist due to containing sub-string "rc".
  2. Specifying a platform with a "-" in the name causes the parser to ignore both "-platform" AND "-rcN" and download the potentially wrong (non-rc) version for every platform. This also prevented specifying just one platform binary the user wished to download.

  It also updates the accompanying `test.py` to cover problem two and adds two examples that were formerly broken to `README.md` to show what is now possible. Including the most useful case of downloading only 1 specific platform's binary.

  This improves the Bitcoin verify-binaries tools user experience by not:
  1. Failing to download for inexplicable reasons,
  2. Downloading more files than what the user told it to, or in the worst case
  3. Downloading only the wrong files.

  * A test was added to cover the command `verify-binaries/verify.py pub 22.0-x86_64-linux-gnu.tar.gz` which checks that _bitcoin-22.0-x86_64-linux-gnu.tar.gz_ downloads successfully AND ONLY _bitcoin-22.0-x86_64-linux-gnu.tar.gz_ downloads.
  * The steps to reproduce each bug are in the referenced issue #30145. Explanation of the potential issue as well as reasoning for the way the bug was fixed are in my commit descriptions.
  * This delivers the promised feature of "only download the binaries for a certain platform", by allowing strings with '-' to be accepted, allowing for single file downloads for any specific platform which was not always possible before.
  * Removes 6 lines of code from the offending `parse_version_string` function, while fixing the bugs/errors, and extending the functionality to be practical for users with slow connections.
  * Makes the error message more helpful when no file matches the provided platform string, now prints "Did you mean: `closest-match`" to help correct typos.

  Thanks for reading my PR. I look forward to getting this helpful tool in its best shape yet.

  Log of this branch passing the new test.py:
  ```
  python3 test.py
  ✓ 'Nonexistent version should fail' passed
  ✓ 'Malformed version should fail' passed
  ✓ '--min-good-sigs 20 should fail' passed
  - testing verification (22.0-x86_64-linux-gnu.tar.gz)
  ✓ '22.0-x86_64-linux-gnu.tar.gz should succeed' passed
  - testing verification (22.0)
  ✓ '22.0 should succeed' passed
  ```

  Log of master failing the new test.py:
  ```
  python3 test.py
  ✓ 'Nonexistent version should fail' passed
  ✓ 'Malformed version should fail' passed
  ✓ '--min-good-sigs 20 should fail' passed
  - testing verification (22.0-x86_64-linux-gnu.tar.gz)
  ✓ '22.0-x86_64-linux-gnu.tar.gz should succeed' passed
  Traceback (most recent call last):
    File "/home/ben/Documents/GitHub/bitcoin/contrib/verify-binaries/test.py", line 74, in <module>
      main()
    File "/home/ben/Documents/GitHub/bitcoin/contrib/verify-binaries/test.py", line 27, in main
      assert len(v) == 1
             ^^^^^^^^^^^
  AssertionError
  ```

ACKs for top commit:
  stickies-v:
    re-ACK 3ab2520190
  willcl-ark:
    re-ACK 3ab2520190

Tree-SHA512: 6093228bb876cd0ac84d1cd2630074e17a3f09c4b23325b9419d859a5721a802f928844575233b135df52b882287dd18d6fadf4419d88ec0a2cdf82db315329e
2024-06-26 10:28:44 +01:00
Ben Westgate
3ab2520190 contrib: Fixup verify-binaries OS platform parsing
Parse platform strings with "-" or '.' correctly such as "linux-gnu" or
"x86_64-linux-gnu.tar.gz" to download the matching files or file. String
partition() is used to tolerate more dashes. Update `VERSION_EXAMPLE`
with a new string parsed correctly now. Fix "-aarch64" interpreted as a
release candidate due to sub-string "rc", causing all downloads to fail.
Now "rc" must immediately follow first "-" to indicate an [-rc] string.
Local variables `version_rc`, `version_os` renamed to `rc`, `platform`.
If "-rcN" is specified, `platform` is reassigned to remove the '-rcN'.

Changes are useful to only download one bitcoin core binary on slow
connections. Making `verify.py pub` more intuitive, robust, and
versatile. Closes #30145

When user types a platform string not found in any filename lets help
and say the platform closest to what they typed in a `f"No files
matched the platform specified. Did you mean: {closest_match}"` log.
Improves UX when unaware how we name our files.
Uses the difflib Python built-in which was already imported elsewhere.

Update test.py to test single file verification
verify-binaries/verify.py can accept an entire filename filter for its
"-platform" parameter now so let us test that it succeeds and downloads
and verifies only one file. `verify.py pub 22.0-x86_64-linux-gnu.tar.gz`
should get and verify only the requested binary. It is placed before the
existing <version> wide verification as it is a faster test and possibly
easier to break.

Update doc with examples now possible after bugfix
Add example to show release candidates now work with "-platform" strings
containing "-" and string provided can be from the middle of filename:
`./contrib/verify-binaries/verify.py --json pub 23.0-rc5-linux-gnu`
Change example 5 to not match example 3.
New examples to show platform can now be provided specifically enough to
download only a single binary down to its file extension:
`./contrib/verify-binaries/verify.py pub 25.2-x86_64-linux`
`./contrib/verify-binaries/verify.py pub 24.1-rc1-darwin`
`./contrib/verify-binaries/verify.py pub 27.0-win64-setup.exe`
This is the most common use if not verifying all files so users see it
as the first example for "only download the binaries for a certain
architecture and/or platform". Downloading one file is intuitively what
most will think this meant and this change delivers on that expectation.

Co-authored-by: stickies-v
2024-06-25 11:32:56 -05:00
fanquake
4289dd02cc
contrib: add R(UN)PATH check to ELF symbol-check
Our binaries shouldn't contains any rpaths, or runpaths, so check that
at release time.
2024-06-20 12:32:07 +01:00
merge-script
9c5cdf07f3
Merge bitcoin/bitcoin#30287: macOS: rewrite some docs & swap mmacosx-version-min for mmacos-version-min
7c298fe0df doc: rewrite some of the macdeploy docs (fanquake)
d042230f7a depends: swap mmacosx-version-min for mmacos-version-min (fanquake)

Pull request description:

  Whilst `-mmacosx-version-min` and `-mmacos-version-min` remain aliases for each other, the later is preferred,
  and I assume the former will be removed at some point in the future; see: https://github.com/llvm/llvm-project/pull/95374.

  Somewhat of a followup to #21778. Rewrite some of the mac deploy docs.

ACKs for top commit:
  theuni:
    utACK 7c298fe0df
  TheCharlatan:
    ACK 7c298fe0df
  hebasto:
    ACK 7c298fe0df.

Tree-SHA512: 6493f087fde93e0eec319af0e105d163b3f047d8a03f7d4b0d6cd7c64b58d0a978b7d67c6b8dba5c6ccf8b10e188aab5dc98eec400b0546dc9ee801a689b4332
2024-06-18 10:55:46 +01:00
fanquake
7c298fe0df
doc: rewrite some of the macdeploy docs
Somewhat of a followup to #21778.
2024-06-14 09:43:36 +01:00
fanquake
b03a45b13e
Revert "contrib: macdeploy: monkey-patch gen-sdk to be deterministic"
This reverts commit ba30a5407e.
2024-06-13 13:48:26 +01:00
Ava Chow
011a895a82
Merge bitcoin/bitcoin#29015: kernel: Streamline util library
c7376babd1 doc: Clarify distinction between util and common libraries in libraries.md (Ryan Ofsky)
4f74c59334 util: Move util/string.h functions to util namespace (Ryan Ofsky)
4d05d3f3b4 util: add TransactionError includes and namespace declarations (Ryan Ofsky)
680eafdc74 util: move fees.h and error.h to common/messages.h (Ryan Ofsky)
02e62c6c9a common: Add PSBTError enum (Ryan Ofsky)
0d44c44ae3 util: move error.h TransactionError enum to node/types.h (Ryan Ofsky)
9bcce2608d util: move spanparsing.h to script/parsing.h (Ryan Ofsky)
6dd2ad4792 util: move spanparsing.h Split functions to string.h (Ryan Ofsky)
23cc8ddff4 util: move HexStr and HexDigit from util to crypto (TheCharlatan)
6861f954f8 util: move util/message to common/signmessage (Ryan Ofsky)
cc5f29fbea build: move memory_cleanse from util to crypto (Ryan Ofsky)
5b9309420c build: move chainparamsbase from util to common (Ryan Ofsky)
ffa27af24d test: Add check-deps.sh script to check for unexpected library dependencies (Ryan Ofsky)

Pull request description:

  Remove `fees.h`, `errors.h`, and `spanparsing.h` from the util library. Specifically:

  - Move `Split` functions from `util/spanparsing.h` to `util/string.h`, using `util` namespace for clarity.
  - Move remaining spanparsing functions to `script/parsing.h` since they are used for descriptor and miniscript parsing.
  - Combine `util/fees.h` and `util/errors.h` into `common/messages.h` so there is a place for simple functions that generate user messages to live, and these functions are not part of the util library.

  Motivation for this change is that the util library is a dependency of the kernel, and we should remove functionality from util that shouldn't be called by kernel code or kernel applications. These changes should also improve code organization and make functions easier to discover. Some of these same moves are (or were) part of #28690, but did not help with code organization, or made it worse, so it is better to move them and clean them up in the same PR so code only has to change one time.

ACKs for top commit:
  achow101:
    ACK c7376babd1
  TheCharlatan:
    Re-ACK c7376babd1
  hebasto:
    re-ACK c7376babd1.

Tree-SHA512: 5bcef16c1255463b1b69270548711e7ff78ca0dd34e300b95e3ca1ce52ceb34f83d9ddb2839e83800ba36b200de30396e504bbb04fa02c6d0c24a16d06ae523d
2024-06-12 17:12:54 -04:00
fanquake
b5fc6d46a3
guix: use glibc 2.31
Set minimum required glibc to 2.31.
The glibc 2.31 branch is still maintained:
https://sourceware.org/git/?p=glibc.git;a=shortlog;h=refs/heads/release/2.31/master.

Remove the stack-protector check from test-security-check, as the test
no-longer fails, and given the control we have of the end, the actual
security-check test seems sufficient (this might also be applied to some
of the other checks).

Drops runtime support for Ubuntu Bionic 18.04 and RHEL-8 from the release binaries.
2024-06-12 10:33:17 +01:00
merge-script
5ee6b76c69
Merge bitcoin/bitcoin#29325: consensus: Store transaction nVersion as uint32_t
429ec1aaaa refactor: Rename CTransaction::nVersion to version (Ava Chow)
27e70f1f5b consensus: Store transaction nVersion as uint32_t (Ava Chow)

Pull request description:

  Given that the use of a transaction's nVersion is always as an unsigned int, it doesn't make sense to store it as signed and then cast it to unsigned everywhere it is used and displayed.

  Since a few alternative implementations have recently been revealed to have made an error with this signedness that would have resulted in consensus failure, I think it makes sense for us to just make this always unsigned to make it clear that the version is treated as unsigned. This would also help us avoid future potential issues with signedness of this value.

  I believe that this is safe and does not actually change what transactions would or would not be considered both standard and consensus valid. Within consensus, the only use of the version in consensus is in BIP68 validation which was already casting it to uint32_t. Within policy, although it is used as a signed int for the transaction version number check, I do not think that this change would change standardness. Standard transactions are limited to the range [1, 2]. Negative numbers would have fallen under the < 1 condition, but by making it unsigned, they are still non-standard under the > 2 condition.

  Unsigned and signed ints are serialized and unserialized the same way so there is no change in serialization.

ACKs for top commit:
  maflcko:
    ACK 429ec1aaaa 🐿
  glozow:
    ACK 429ec1aaaa
  shaavan:
    ACK 429ec1aaaa 💯

Tree-SHA512: 0bcd92a245d7d16c3665d2d4e815a4ef28207ad4a1fb46c6f0203cdafeab1b82c4e95e4bdce7805d80a4f4a46074f6542abad708e970550d38a00d759e3dcef1
2024-06-12 10:32:31 +01:00
fanquake
7cbfd7a7ce
refactor: rename (macho) ld64 to lld
Change some references to the macho ld64 to lld, which is now what is
used.
2024-06-10 13:20:54 +01:00
fanquake
e9a44faf14
depends: remove FORCE_USE_SYSTEM_CLANG 2024-06-10 13:15:23 +01:00
fanquake
9946618f61
guix: use clang-toolchain-18 for macOS build
Version is 18.1.6.
2024-06-10 13:15:22 +01:00
merge-script
2ad6e8efa3
Merge bitcoin/bitcoin#30231: guix: bump time-machine to f0bb724211872cd6158fce6162e0b8c73efed126
2599655c1f guix: bump time-machine to f0bb724211872cd6158fce6162e0b8c73efed126 (fanquake)

Pull request description:

  Includes:
  LLVM 18.1.x (#30201)
  GCC 13.x (#29881)

  git-minimal 2.41.0 -> 2.45.1
  Kernel Headers 6.1.80 -> 6.1.92
  moreutils 0.68 -> 0.69

  Commits like https://git.savannah.gnu.org/cgit/guix.git/commit/?id=7b0f145802f0c2c785014293d748721678fef824, which should improve the bootstrap situation (#30042). This can somewhat be visualised by comparing the (simplified) dependencies of guix itself, between the two time-machines.

  Master:
  ![master_2](https://github.com/bitcoin/bitcoin/assets/863730/714402a2-345e-43c7-974b-5112d03d44c2)

  PR:
  ![pr](https://github.com/bitcoin/bitcoin/assets/863730/7079a155-e013-4d59-9ea1-21a64d71e2d8)

  Note that in the case of this PR, we are better off, no-longer having to build a number of tex packages, ruby, cairo, graphics libs, openssl 1.x etc.

ACKs for top commit:
  TheCharlatan:
    ACK 2599655c1f

Tree-SHA512: 9c5675a5d563c17744c89c8a392bc7865aa1c9e71a5e3044c23f31e51458dac28c0c238d2055c86dc732df595dae60bcbc8b85266b23b7991c4c770d56f7d23a
2024-06-08 09:29:39 +01:00
Ava Chow
429ec1aaaa refactor: Rename CTransaction::nVersion to version
In order to ensure that the change of nVersion to a uint32_t in the
previous commit has no effect, rename nVersion to version in this commit
so that reviewers can easily spot if a spot was missed or if there is a
check somewhere whose semantics have changed.
2024-06-07 13:55:23 -04:00
Ava Chow
4a020ca443
Merge bitcoin/bitcoin#29401: test: Remove struct.pack from almost all places
fa52e13ee8 test: Remove struct.pack from almost all places (MarcoFalke)
fa826db477 scripted-diff: test: Use int.to_bytes over struct packing (MarcoFalke)
faf2a975ad test: Use int.to_bytes over struct packing (MarcoFalke)
faf3cd659a test: Normalize struct.pack format (MarcoFalke)

Pull request description:

  `struct.pack` has many issues:

  * The format string consists of characters that may be confusing and may need to be looked up in the documentation, as opposed to using easy to understand self-documenting code.

  This lead to many test bugs, which weren't hit, which is fine, but still confusing. Ref: https://github.com/bitcoin/bitcoin/pull/29400, https://github.com/bitcoin/bitcoin/pull/29399, https://github.com/bitcoin/bitcoin/pull/29363, fa3886b7c6, ...

  Fix all issues by using the built-in `int` helpers `to_bytes` via a scripted diff.

  Review notes:

  * For `struct.pack` and `int.to_bytes` the error behavior is the same, although the error messages are not identical.
  * Two `struct.pack` remain. One for float serialization in a C++ code comment, and one for native serialization.

ACKs for top commit:
  achow101:
    ACK fa52e13ee8
  rkrux:
    tACK [fa52e13](fa52e13ee8)
  theStack:
    Code-review ACK fa52e13ee8

Tree-SHA512: ee80d935b68ae43d1654b047e84ceb80abbd20306df35cca848b3f7874634b518560ddcbc7e714e2e7a19241e153dee64556dc4701287ae811e26e4f8c57fe3e
2024-06-06 19:18:55 -04:00
fanquake
2599655c1f
guix: bump time-machine to f0bb724211872cd6158fce6162e0b8c73efed126
Includes:
LLVM 18.1.x (#30201)
GCC 13.x (#29881)

git-minimal 2.41.0 -> 2.45.1
Kernel Headers 6.1.80 -> 6.1.92
moreutils 0.68 -> 0.69

Commits like
https://git.savannah.gnu.org/cgit/guix.git/commit/?id=7b0f145802f0c2c785014293d748721678fef824,
which should improve the bootstrap situation (#30042).
2024-06-05 14:15:10 +01:00
fanquake
5f2c1d84e3
guix: show *_FLAGS variables in pre-build output
For example:
```bash
ADDITIONAL_GUIX_COMMON_FLAGS set in the ENV
ADDITIONAL_GUIX_ENVIRONMENT_FLAGS="--emulate-fhs" ./contrib/guix/guix-build
<snip>
INFO: Building f75199182133 for platform triple x86_64-linux-gnu:
      ...using reference timestamp: 1716905119
      ...running at most 10 jobs
      ...from worktree directory: '/bitcoin'
          ...bind-mounted in container to: '/bitcoin'
      ...in build directory: '/bitcoin/guix-build-f75199182133/distsrc-f75199182133-x86_64-linux-gnu'
          ...bind-mounted in container to: '/distsrc-base/distsrc-f75199182133-x86_64-linux-gnu'
      ...outputting in: '/bitcoin/guix-build-f75199182133/output/x86_64-linux-gnu'
          ...bind-mounted in container to: '/outdir-base/x86_64-linux-gnu'
      ADDITIONAL FLAGS (if set)
          ADDITIONAL_GUIX_COMMON_FLAGS: --no-substitutes
          ADDITIONAL_GUIX_ENVIRONMENT_FLAGS: --emulate-fhs
          ADDITIONAL_GUIX_TIMEMACHINE_FLAGS:
```
2024-06-03 11:56:40 +01:00
merge-script
be100cf4c7
Merge bitcoin/bitcoin#21778: build: LLD based macOS toolchain
e8c25e8a35 guix: drop binutils from macOS env (fanquake)
555fddf646 guix: use GUIX_LD_WRAPPER_DISABLE_RPATH for all HOSTS (fanquake)
9ec238d0f3 guix: remove ZERO_AR_DATE export (fanquake)
f836f7e9b3 depends: remove cctools & libtapi (fanquake)
4a0536c5d9 build: switch to using lld for macOS builds (fanquake)
c6a6b2d6fd build: add lld into macOS build environment(s) (fanquake)
437e908ebd depends: swap cctools-x for llvm-x (fanquake)
bab287d1ba depends: don't use -no_warning_for_no_symbols in macOS qt build (fanquake)

Pull request description:

  This switches us to using a [LLD](https://lld.llvm.org/) based toolchain for macOS builds.

  ### Benefits
  * Less complicated macOS toolchain.
  * No longer beholden to Apple releasing it's [source](https://opensource.apple.com/source/) for [cctools](https://opensource.apple.com/source/cctools/), [ld64](https://opensource.apple.com/source/ld64/) & [libtapi](https://opensource.apple.com/source/tapi/).
  * No more reliance on third parties to modify those sources for us. i.e [apple-libtapi](https://github.com/tpoechtrager/apple-libtapi), [cctools-port](https://github.com/tpoechtrager/cctools-port) (cctools + ld64).

ACKs for top commit:
  theuni:
    Tentative ACK e8c25e8a35.

Tree-SHA512: ec73304e8a2cd4c71041f7863d7d2e4e0408787299fb4fa3745076853156e8f64e4742e16f30d65e3a27f1e9c0d19cdf802248366b72a4fcb4ea821f92bb7a00
2024-05-29 09:42:05 +01:00
Cory Fields
34c9cee380 clang-tidy: add check for non-trivial thread_local vars
Do not allow thread_local vars with non-trivial destructors
2024-05-22 13:47:09 +00:00
fanquake
e8c25e8a35
guix: drop binutils from macOS env 2024-05-22 08:51:34 +01:00
fanquake
555fddf646
guix: use GUIX_LD_WRAPPER_DISABLE_RPATH for all HOSTS 2024-05-22 08:51:33 +01:00
fanquake
9ec238d0f3
guix: remove ZERO_AR_DATE export
LLD enables ZERO_AR_DATE by default, setting it to zero would enable
non-determinism, setting it to any other value is ignored.

See:
https://github.com/llvm/llvm-project/blob/main/lld/docs/MachO/ld64-vs-lld.rst.
2024-05-22 08:51:33 +01:00
fanquake
f836f7e9b3
depends: remove cctools & libtapi 2024-05-22 08:51:33 +01:00
fanquake
4a0536c5d9
build: switch to using lld for macOS builds
Adjust the security check for:
ld64.lld: warning: Option `-allow_stack_execute' is not yet implemented.
ld64.lld: error: -fixup_chains is incompatible with -no_pie
and to account for the embedding of LLVMs version number.
2024-05-22 08:51:33 +01:00
fanquake
c6a6b2d6fd
build: add lld into macOS build environment(s) 2024-05-22 08:51:33 +01:00
Ava Chow
9f4ff1e965 windeploy: Renew certificate 2024-05-21 23:19:51 -04:00
Ryan Ofsky
ffa27af24d test: Add check-deps.sh script to check for unexpected library dependencies 2024-05-16 11:16:08 -04:00
merge-script
695d80126f
Merge bitcoin/bitcoin#30074: contrib: use ENV flags in get_arch
b59a027d95 contrib: drop dead get_machine from test sym check (fanquake)
e6aba463ad contrib: use env_flags in get_arch (fanquake)

Pull request description:

  This isn't an issue right now (because the get_arch check is simple), but becomes one as soon as we want to use `lld` for linking, and need LDFLAGS (otherwise we call `ld` and fail, see it's usage in #21778). So I've split this out for review. It also makes sense to use the same flags for all compilation in these checks.

  Also drops some dead code in test-symbol-check.

ACKs for top commit:
  TheCharlatan:
    ACK b59a027d95

Tree-SHA512: d8afc4144815369aae63cf6dc6e983af46f208c7043d6ea5c9c811152649c256a8e67eb6864ea9d385d87b6b049fece07710a84b90da325da7fc3f05efcaacd6
2024-05-15 09:02:32 +08:00
merge-script
4d3f1d08db
Merge bitcoin/bitcoin#29739: build: swap cctools otool for llvm-objdump
7f5ac4520d build: swap otool for (llvm-)objdump (fanquake)

Pull request description:

  This tool is used in GUI packaging on macOS, and also somewhat of a blocker for #21778. The main issue is that some distros don't really ship this tool in a standard ways, i.e Ubuntu only ships `llvm-otool` with a version suffix, i.e `llvm-otool-17`, which makes it hard to find and use. Rather than trying to deal with that mess, switch to using the equivalent LLVM tool (objdump), which is a drop-in replacement.

ACKs for top commit:
  TheCharlatan:
    ACK 7f5ac4520d
  theuni:
    ACK 7f5ac4520d. Tested `make deploy` on native macOS. Looks good.
  hebasto:
    ACK 7f5ac4520d.

Tree-SHA512: ac978043f14fb448010542a4a7ce8c6c74b4cbd90f83b4cb4d0bff55974010f10a70b5354f65b239a8bd961d7a3aca22ca165b42954ca87879b9e0524db5f879
2024-05-11 18:34:42 +08:00