merge-script d406cffafd Merge bitcoin/bitcoin#34228: depends: Unset SOURCE_DATE_EPOCH in gen_id script
9f7a2293c4 depends: Unset `SOURCE_DATE_EPOCH` in `gen_id` script (Hennadii Stepanov)

Pull request description:

  When performing Guix builds for `{x86_64,arm64}-apple-darwin` hosts across different commits, all packages in `depends` are rebuilt even if there are no changes in either the  `depends` or `contrib/guix` subdirectories.

  This occurs because the `SOURCE_DATE_EPOCH` environment variable enables Clang's `-source-date-epoch` option, which then appears in the output of `clang -v -E -xc -o /dev/null - < /dev/null`. For example:
  ```
  $ SOURCE_DATE_EPOCH=1767855465 clang -v -E -xc++ -o /dev/null - < /dev/null
  clang version 21.1.7 (Fedora 21.1.7-1.fc43)
  Target: x86_64-redhat-linux-gnu
  Thread model: posix
  InstalledDir: /usr/bin
  Configuration file: /etc/clang/x86_64-redhat-linux-gnu-clang.cfg
  System configuration file directory: /etc/clang/
  Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-redhat-linux/14
  Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-redhat-linux/15
  Selected GCC installation: /usr/bin/../lib/gcc/x86_64-redhat-linux/15
  Candidate multilib: .;@m64
  Candidate multilib: 32;@m32
  Selected multilib: .;@m64
   (in-process)
   "/usr/bin/clang-21" -cc1 -triple x86_64-redhat-linux-gnu -E -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name - -mrelocation-model static -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/home/hebasto -v -fcoverage-compilation-dir=/home/hebasto -resource-dir /usr/bin/../lib/clang/21 -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/15/../../../../include/c++/15 -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/15/../../../../include/c++/15/x86_64-redhat-linux -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/15/../../../../include/c++/15/backward -internal-isystem /usr/bin/../lib/clang/21/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-redhat-linux/15/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -source-date-epoch 1767855465 -fdeprecated-macro -ferror-limit 19 -fmessage-length=180 -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -fcxx-exceptions -fexceptions -fcolor-diagnostics -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /dev/null -x c++ -
  clang -cc1 version 21.1.7 based upon LLVM 21.1.7 default target x86_64-redhat-linux-gnu
  ignoring nonexistent directory "/usr/bin/../lib/gcc/x86_64-redhat-linux/15/../../../../x86_64-redhat-linux/include"
  ignoring nonexistent directory "/include"
  #include "..." search starts here:
  #include <...> search starts here:
   /usr/bin/../lib/gcc/x86_64-redhat-linux/15/../../../../include/c++/15
   /usr/bin/../lib/gcc/x86_64-redhat-linux/15/../../../../include/c++/15/x86_64-redhat-linux
   /usr/bin/../lib/gcc/x86_64-redhat-linux/15/../../../../include/c++/15/backward
   /usr/bin/../lib/clang/21/include
   /usr/local/include
   /usr/include
  End of search list.
  ```

  As a result, each package id differs between builds, which causes the script to treat the toolchain as changed and triggers unnecessary rebuilds.

  This PR resolves this issue by [clobbering](https://github.com/bitcoin/bitcoin/pull/34228#issuecomment-4387135450) the `SOURCE_DATE_EPOCH` value in the `gen_id` script.

  ---

  Suggested testing scenario:
  ```
  $ env HOSTS=arm64-apple-darwin ./contrib/guix/guix-build
  $ git commit --allow-empty -m "Trigger rebuild"
  $ env HOSTS=arm64-apple-darwin ./contrib/guix/guix-build
  ````

  The last command will rebuild depends on the master branch, but will successfully use the cached built packages on this PR.

ACKs for top commit:
  maflcko:
    lgtm ACK 9f7a2293c4
  fanquake:
    ACK 9f7a2293c4

Tree-SHA512: d5fa90100edfd88024ad949a9d75c8af274a054c0926ae4ddea6ecf1c38fae833670b360c56c740a7565cf393a92597823749fe75c85a27ae1ebebead4093853
2026-05-08 12:09:10 +02:00
2026-05-07 12:18:50 +02:00
2026-05-06 13:16:10 +01:00

Bitcoin Core integration/staging tree

https://bitcoincore.org

For an immediately usable, binary version of the Bitcoin Core software, see https://bitcoincore.org/en/download/.

What is Bitcoin Core?

Bitcoin Core connects to the Bitcoin peer-to-peer network to download and fully validate blocks and transactions. It also includes a wallet and graphical user interface, which can be optionally built.

Further information about Bitcoin Core is available in the doc folder.

License

Bitcoin Core is released under the terms of the MIT license. See COPYING for more information or see https://opensource.org/license/MIT.

Development Process

The master branch is regularly built (see doc/build-*.md for instructions) and tested, but it is not guaranteed to be completely stable. Tags are created regularly from release branches to indicate new official, stable release versions of Bitcoin Core.

The https://github.com/bitcoin-core/gui repository is used exclusively for the development of the GUI. Its master branch is identical in all monotree repositories. Release branches and tags do not exist, so please do not fork that repository unless it is for development reasons.

The contribution workflow is described in CONTRIBUTING.md and useful hints for developers can be found in doc/developer-notes.md.

Testing

Testing and code review is the bottleneck for development; we get more pull requests than we can review and test on short notice. Please be patient and help out by testing other people's pull requests, and remember this is a security-critical project where any mistake might cost people lots of money.

Automated Testing

Developers are strongly encouraged to write unit tests for new code, and to submit new unit tests for old code. Unit tests can be compiled and run (assuming they weren't disabled during the generation of the build system) with: ctest. Further details on running and extending unit tests can be found in /src/test/README.md.

There are also regression and integration tests, written in Python. These tests can be run (if the test dependencies are installed) with: build/test/functional/test_runner.py (assuming build is your build directory).

The CI (Continuous Integration) systems make sure that every pull request is tested on Windows, Linux, and macOS. The CI must pass on all commits before merge to avoid unrelated CI failures on new pull requests.

Manual Quality Assurance (QA) Testing

Changes should be tested by somebody other than the developer who wrote the code. This is especially important for large or high-risk changes. It is useful to add a test plan to the pull request description if testing the changes is not straightforward.

Translations

Changes to translations as well as new translations can be submitted to Bitcoin Core's Transifex page.

Translations are periodically pulled from Transifex and merged into the git repository. See the translation process for details on how this works.

Important: We do not accept translation changes as GitHub pull requests because the next pull from Transifex would automatically overwrite them again.

Description
Languages
C++ 64.6%
Python 18.8%
C 12.8%
CMake 1.2%
Shell 0.9%
Other 1.4%