build: Treat obj/build.h as an intermediate file #22624

pull hebasto wants to merge 1 commits into bitcoin:master from hebasto:210804-obj changing 1 files +2 −2
  1. hebasto commented at 6:36 PM on August 4, 2021: member

    This PR prevents unneeded calls of the share/genbuild.sh script, e.g., while make install.

    Note for reviewers. Before testing this PR make sure your git tree is clean.

    Guix builds:

    $ find guix-build-$(git rev-parse --short=12 HEAD)/output/ -type f -print0 | env LC_ALL=C sort -z | xargs -r0 sha256sum
    672c0aa39773c6a8cf73cf882d629f3b341c6e27826e76408aa4a206e97e5549  guix-build-b621730d3324/output/aarch64-linux-gnu/SHA256SUMS.part
    b525150eff7c83ac048fa66d57cd0a329a5d535aac079db63a56e801478172de  guix-build-b621730d3324/output/aarch64-linux-gnu/bitcoin-b621730d3324-aarch64-linux-gnu-debug.tar.gz
    94db3e1511a0c964f4938e19761e5530b0eba6c64decb8079ea74bb044f646af  guix-build-b621730d3324/output/aarch64-linux-gnu/bitcoin-b621730d3324-aarch64-linux-gnu.tar.gz
    b2fc8e0f6961bc7cd7aa83cc78c7ee85c3a7c66b55074bac590fc74ef04b36cd  guix-build-b621730d3324/output/arm-linux-gnueabihf/SHA256SUMS.part
    e10eb07a360ac7569d3715145d7872d6e47d0a53ee7c5d0d55f1e5a183e3102f  guix-build-b621730d3324/output/arm-linux-gnueabihf/bitcoin-b621730d3324-arm-linux-gnueabihf-debug.tar.gz
    c3805d554ca0ac8069d8bac4dfdd5c5157db8f99ef39d622d333e3acd11ea05f  guix-build-b621730d3324/output/arm-linux-gnueabihf/bitcoin-b621730d3324-arm-linux-gnueabihf.tar.gz
    59e58f8f5f142decc2e65ec6537437c0fa4d3ce6d748f5653a0c14f5dd05848a  guix-build-b621730d3324/output/dist-archive/bitcoin-b621730d3324.tar.gz
    b6988c6b6f3f54a7a5954a79b8d698cddfdd0c1bea9d38c19258ac0939e9aa8c  guix-build-b621730d3324/output/powerpc64-linux-gnu/SHA256SUMS.part
    9b9a836110ffb9e6ec70deac8b7e309420245215343fdcf0a53ae8bc0c2baf2a  guix-build-b621730d3324/output/powerpc64-linux-gnu/bitcoin-b621730d3324-powerpc64-linux-gnu-debug.tar.gz
    b35c0bc90cecb93bf7bc4975a82dbb571a5c8f3751513dd9c5f98fd3726c0a17  guix-build-b621730d3324/output/powerpc64-linux-gnu/bitcoin-b621730d3324-powerpc64-linux-gnu.tar.gz
    6c877d3fd4788ff1566198eb902bb2f44320e4d0a19cb8c50cfb2870b32aeb1f  guix-build-b621730d3324/output/powerpc64le-linux-gnu/SHA256SUMS.part
    a899353e89daa6755089d3c1c9e80c4e0e736e020d21c88fa5fbae375b713b21  guix-build-b621730d3324/output/powerpc64le-linux-gnu/bitcoin-b621730d3324-powerpc64le-linux-gnu-debug.tar.gz
    5c736d8a873063cc2c8e167a1d2603da1d5ff2c69f65212c4f993fa2521e8342  guix-build-b621730d3324/output/powerpc64le-linux-gnu/bitcoin-b621730d3324-powerpc64le-linux-gnu.tar.gz
    6e3dcf47764429d7b5ec1834873f2ecf8cfe700e707a637dac279598867d0445  guix-build-b621730d3324/output/riscv64-linux-gnu/SHA256SUMS.part
    23a088edb241a3734e2c9bec04aeff777dba9f931ab81d18d4cac5c0bd5d3b93  guix-build-b621730d3324/output/riscv64-linux-gnu/bitcoin-b621730d3324-riscv64-linux-gnu-debug.tar.gz
    b7b916cc8b45852b75088cd8f3d19c8db92d9283d957d0c4094b14fc79656672  guix-build-b621730d3324/output/riscv64-linux-gnu/bitcoin-b621730d3324-riscv64-linux-gnu.tar.gz
    c09b70368ae96e16a05b2d3fe1c3bbaea7c67d036892138be5bf1da62aefff11  guix-build-b621730d3324/output/x86_64-apple-darwin18/SHA256SUMS.part
    43d0ae4a1104fa5d0b0a439f94f9df4fba27467d75bb8a20a9ea56047cbf5ea2  guix-build-b621730d3324/output/x86_64-apple-darwin18/bitcoin-b621730d3324-osx-unsigned.dmg
    1a603cef65c0d99a162a1f0636c76f53c94dc0a36f9ee208db2343563575f06b  guix-build-b621730d3324/output/x86_64-apple-darwin18/bitcoin-b621730d3324-osx-unsigned.tar.gz
    999bfd7fc9f4690766d661213b9999feb0c268983c3940c5cb3d456c92f78966  guix-build-b621730d3324/output/x86_64-apple-darwin18/bitcoin-b621730d3324-osx64.tar.gz
    a47b5aff04f1ad7b2719a71791c189d0e3fa275e9f2aca7f6477f808c3103df2  guix-build-b621730d3324/output/x86_64-linux-gnu/SHA256SUMS.part
    f1a9c9a5bee6ecc0cbc4ea49076c4e6e8dee151c94b44bcbd31e970b77315d23  guix-build-b621730d3324/output/x86_64-linux-gnu/bitcoin-b621730d3324-x86_64-linux-gnu-debug.tar.gz
    b3c6863b06d80d5abb98ff40c7b54f26a679242640a34d81c66edb3a6c03d257  guix-build-b621730d3324/output/x86_64-linux-gnu/bitcoin-b621730d3324-x86_64-linux-gnu.tar.gz
    d2204b42f767a19e811bf9d5d43cf9e230641d4fc877eeae6aca0a8dc8191921  guix-build-b621730d3324/output/x86_64-w64-mingw32/SHA256SUMS.part
    ee96b0862ce0e24230da05658e8ef5134b57fccd4e27fac987a450396a64e3dc  guix-build-b621730d3324/output/x86_64-w64-mingw32/bitcoin-b621730d3324-win-unsigned.tar.gz
    7293b713b52d3add8c54e378dc2b67712d26d36f094e904a87f0bc17778dc7b7  guix-build-b621730d3324/output/x86_64-w64-mingw32/bitcoin-b621730d3324-win64-debug.zip
    77960bb2ac7f16e5daaf99428617bd839b1351c638aab3f74006bd81ea81999b  guix-build-b621730d3324/output/x86_64-w64-mingw32/bitcoin-b621730d3324-win64-setup-unsigned.exe
    2de0cbe14e5cd9f243458489de685c496ba2110782cf9ba26500c9422e8af43c  guix-build-b621730d3324/output/x86_64-w64-mingw32/bitcoin-b621730d3324-win64.zip
    
  2. build: Treat obj/build.h as an intermediate file
    This change prevents unneeded calls of the share/genbuild.sh script,
    e.g., while `make install`.
    b621730d33
  3. hebasto added the label Build system on Aug 4, 2021
  4. MarcoFalke added the label DrahtBot Guix build requested on Aug 4, 2021
  5. DrahtBot removed the label DrahtBot Guix build requested on Aug 6, 2021
  6. laanwj commented at 1:53 PM on August 16, 2021: member

    I think the FORCE was there for a valid reason. Does this correctly regenerate the file when the git commit changes?

  7. hebasto commented at 2:08 PM on August 16, 2021: member

    @laanwj

    Does this correctly regenerate the file when the git commit changes?

    With this PR the obj/build.h file is now automatically deleted after each use. And it is generated every time it is required.

  8. laanwj commented at 2:31 PM on August 16, 2021: member

    With this PR the obj/build.h file is now automatically deleted after each use. And it is generated every time it is required.

    OK. Sorry, I don't know enough about make-isms to reason through all the subtleties with git and complexities of how we handle versioning to ACK this. @theuni maybe?

  9. jarolrod commented at 8:56 PM on August 18, 2021: member

    Contributing GUIX hashes, mine match @hebasto

    find guix-build-$(git rev-parse --short=12 HEAD)/output/ -type f -print0 | env LC_ALL=C sort -z | xargs -r0 sha256sum
    
    672c0aa39773c6a8cf73cf882d629f3b341c6e27826e76408aa4a206e97e5549  guix-build-b621730d3324/output/aarch64-linux-gnu/SHA256SUMS.part
    b525150eff7c83ac048fa66d57cd0a329a5d535aac079db63a56e801478172de  guix-build-b621730d3324/output/aarch64-linux-gnu/bitcoin-b621730d3324-aarch64-linux-gnu-debug.tar.gz
    94db3e1511a0c964f4938e19761e5530b0eba6c64decb8079ea74bb044f646af  guix-build-b621730d3324/output/aarch64-linux-gnu/bitcoin-b621730d3324-aarch64-linux-gnu.tar.gz
    b2fc8e0f6961bc7cd7aa83cc78c7ee85c3a7c66b55074bac590fc74ef04b36cd  guix-build-b621730d3324/output/arm-linux-gnueabihf/SHA256SUMS.part
    e10eb07a360ac7569d3715145d7872d6e47d0a53ee7c5d0d55f1e5a183e3102f  guix-build-b621730d3324/output/arm-linux-gnueabihf/bitcoin-b621730d3324-arm-linux-gnueabihf-debug.tar.gz
    c3805d554ca0ac8069d8bac4dfdd5c5157db8f99ef39d622d333e3acd11ea05f  guix-build-b621730d3324/output/arm-linux-gnueabihf/bitcoin-b621730d3324-arm-linux-gnueabihf.tar.gz
    59e58f8f5f142decc2e65ec6537437c0fa4d3ce6d748f5653a0c14f5dd05848a  guix-build-b621730d3324/output/dist-archive/bitcoin-b621730d3324.tar.gz
    b6988c6b6f3f54a7a5954a79b8d698cddfdd0c1bea9d38c19258ac0939e9aa8c  guix-build-b621730d3324/output/powerpc64-linux-gnu/SHA256SUMS.part
    9b9a836110ffb9e6ec70deac8b7e309420245215343fdcf0a53ae8bc0c2baf2a  guix-build-b621730d3324/output/powerpc64-linux-gnu/bitcoin-b621730d3324-powerpc64-linux-gnu-debug.tar.gz
    b35c0bc90cecb93bf7bc4975a82dbb571a5c8f3751513dd9c5f98fd3726c0a17  guix-build-b621730d3324/output/powerpc64-linux-gnu/bitcoin-b621730d3324-powerpc64-linux-gnu.tar.gz
    6c877d3fd4788ff1566198eb902bb2f44320e4d0a19cb8c50cfb2870b32aeb1f  guix-build-b621730d3324/output/powerpc64le-linux-gnu/SHA256SUMS.part
    a899353e89daa6755089d3c1c9e80c4e0e736e020d21c88fa5fbae375b713b21  guix-build-b621730d3324/output/powerpc64le-linux-gnu/bitcoin-b621730d3324-powerpc64le-linux-gnu-debug.tar.gz
    5c736d8a873063cc2c8e167a1d2603da1d5ff2c69f65212c4f993fa2521e8342  guix-build-b621730d3324/output/powerpc64le-linux-gnu/bitcoin-b621730d3324-powerpc64le-linux-gnu.tar.gz
    6e3dcf47764429d7b5ec1834873f2ecf8cfe700e707a637dac279598867d0445  guix-build-b621730d3324/output/riscv64-linux-gnu/SHA256SUMS.part
    23a088edb241a3734e2c9bec04aeff777dba9f931ab81d18d4cac5c0bd5d3b93  guix-build-b621730d3324/output/riscv64-linux-gnu/bitcoin-b621730d3324-riscv64-linux-gnu-debug.tar.gz
    b7b916cc8b45852b75088cd8f3d19c8db92d9283d957d0c4094b14fc79656672  guix-build-b621730d3324/output/riscv64-linux-gnu/bitcoin-b621730d3324-riscv64-linux-gnu.tar.gz
    c09b70368ae96e16a05b2d3fe1c3bbaea7c67d036892138be5bf1da62aefff11  guix-build-b621730d3324/output/x86_64-apple-darwin18/SHA256SUMS.part
    43d0ae4a1104fa5d0b0a439f94f9df4fba27467d75bb8a20a9ea56047cbf5ea2  guix-build-b621730d3324/output/x86_64-apple-darwin18/bitcoin-b621730d3324-osx-unsigned.dmg
    1a603cef65c0d99a162a1f0636c76f53c94dc0a36f9ee208db2343563575f06b  guix-build-b621730d3324/output/x86_64-apple-darwin18/bitcoin-b621730d3324-osx-unsigned.tar.gz
    999bfd7fc9f4690766d661213b9999feb0c268983c3940c5cb3d456c92f78966  guix-build-b621730d3324/output/x86_64-apple-darwin18/bitcoin-b621730d3324-osx64.tar.gz
    a47b5aff04f1ad7b2719a71791c189d0e3fa275e9f2aca7f6477f808c3103df2  guix-build-b621730d3324/output/x86_64-linux-gnu/SHA256SUMS.part
    f1a9c9a5bee6ecc0cbc4ea49076c4e6e8dee151c94b44bcbd31e970b77315d23  guix-build-b621730d3324/output/x86_64-linux-gnu/bitcoin-b621730d3324-x86_64-linux-gnu-debug.tar.gz
    b3c6863b06d80d5abb98ff40c7b54f26a679242640a34d81c66edb3a6c03d257  guix-build-b621730d3324/output/x86_64-linux-gnu/bitcoin-b621730d3324-x86_64-linux-gnu.tar.gz
    d2204b42f767a19e811bf9d5d43cf9e230641d4fc877eeae6aca0a8dc8191921  guix-build-b621730d3324/output/x86_64-w64-mingw32/SHA256SUMS.part
    ee96b0862ce0e24230da05658e8ef5134b57fccd4e27fac987a450396a64e3dc  guix-build-b621730d3324/output/x86_64-w64-mingw32/bitcoin-b621730d3324-win-unsigned.tar.gz
    7293b713b52d3add8c54e378dc2b67712d26d36f094e904a87f0bc17778dc7b7  guix-build-b621730d3324/output/x86_64-w64-mingw32/bitcoin-b621730d3324-win64-debug.zip
    77960bb2ac7f16e5daaf99428617bd839b1351c638aab3f74006bd81ea81999b  guix-build-b621730d3324/output/x86_64-w64-mingw32/bitcoin-b621730d3324-win64-setup-unsigned.exe
    2de0cbe14e5cd9f243458489de685c496ba2110782cf9ba26500c9422e8af43c  guix-build-b621730d3324/output/x86_64-w64-mingw32/bitcoin-b621730d3324-win64.zip
    
  10. luke-jr commented at 4:28 PM on September 12, 2021: member

    This will require changes to Gentoo packaging (which currently generates its own build.h), but shouldn't be an issue to update.

    tarball installs don't have git and need to get their info elsewhere, but that's already broken in Core, and the latest proposed fix (#18902) adapts genbuild.sh instead, so also shouldn't be affected by this.

    Unless I've missed anything, I don't see any problems with this change.

  11. laanwj requested review from dongcarl on Nov 10, 2021
  12. DrahtBot commented at 12:33 PM on July 7, 2022: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #25541 (tracing: macOS USDT support by kouloumos)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  13. MarcoFalke added the label DrahtBot Guix build requested on Jul 7, 2022
  14. bitcoin deleted a comment on Jul 7, 2022
  15. ryanofsky commented at 4:19 PM on July 7, 2022: contributor

    It does seem like things related to build.h are often built unnecessarily, but it would be good to have a code comment explaining how this is supposed to work.

    Some things I am confused about:

    • According to https://www.gnu.org/software/make/manual/html_node/Chained-Rules.html and https://www.gnu.org/software/make/manual/html_node/Special-Targets.html, intermediate files are automatically deleted by make if they didn't exist before make is invoked. Is this good or bad (or neutral)? At first read, this seems like it could make debugging harder and understanding what is in the file harder.

    • According to the same links, targets that depend on build.h will no longer get rebuilt automatically when build.h is generated and it didn't previously exist. This seems ok as long as there is some other rule that makes them get rebuild when the git status changes. But it's not clear what would cause that to happen.

    • If I delete src/obj/build.h and then git commit --amend to change the git hash, nothing gets rebuilt, either before this patch or after it. So if build.h is supposed to contain the current git hash, it seems a little broken in general.

    • If I run make with V=1 it seems like no output about generating build.h is shown (before or after this patch). Not sure how V=1 works exactly, but this seems counter to what it is supposed to do.

  16. DrahtBot commented at 12:02 PM on July 10, 2022: contributor

    <!--9cd9c72976c961c55c7acef8f6ba82cd-->

    Guix builds

    File commit 194710d8ff398838e4e5bb87b56e19ebed1d6c52<br>(master) commit 99355276ae4a6d6b8cd924ac7801be236262183b<br>(master and this pull)
    SHA256SUMS.part 270a716737120d5e... 0164275c3f924f2f...
    *-aarch64-linux-gnu-debug.tar.gz 295eeafb11b81286... 8326fbc9d89887f4...
    *-aarch64-linux-gnu.tar.gz fdad013976c25db8... c558557c8f4d3b2d...
    *-arm-linux-gnueabihf-debug.tar.gz 527372d0b58432da... 0ef1b816e053426e...
    *-arm-linux-gnueabihf.tar.gz f7ef4702b9e0c452... f427b3b2fd62773c...
    *-arm64-apple-darwin-unsigned.dmg 245aa34cc2955ec0... b70f845146535231...
    *-arm64-apple-darwin-unsigned.tar.gz 219d14ac03ad5fb3... 21bafea3e076f15a...
    *-arm64-apple-darwin.tar.gz 44a666ff3600a860... 597201359322e939...
    *-powerpc64-linux-gnu-debug.tar.gz 7133a9827bc5c6e6... 603610f4bd39f57f...
    *-powerpc64-linux-gnu.tar.gz e1cff86c35924a4f... 60dc7c76270959c7...
    *-powerpc64le-linux-gnu-debug.tar.gz c36cadb9e09749f6... b748f613acc3449c...
    *-powerpc64le-linux-gnu.tar.gz e72be1e4c841a0d4... c412f02659194da2...
    *-riscv64-linux-gnu-debug.tar.gz 78a7675ce5caf76e... 3316bb57ebe03cbc...
    *-riscv64-linux-gnu.tar.gz d1af0e3884650a81... 44108847dc05fe49...
    *-win64-debug.zip 58f88f76637c88b6... e9da49b4959866b0...
    *-win64-setup-unsigned.exe da1ff95287bc49d9... 581d3143a625e767...
    *-win64-unsigned.tar.gz d311772b8f89b249... 9fa0485dd1e4d110...
    *-win64.zip 2905e72d913c5ecf... 51da8163d6d90770...
    *-x86_64-apple-darwin-unsigned.dmg d51c41180da651a3... 22b20f026b1dfd17...
    *-x86_64-apple-darwin-unsigned.tar.gz de4be7610bc77a17... a234e3c3e243b1f8...
    *-x86_64-apple-darwin.tar.gz 05fdb8fc85248573... 18c15aa69acaf8c1...
    *-x86_64-linux-gnu-debug.tar.gz 3d29003cde1387fc... 8018f4bb4b146dd8...
    *-x86_64-linux-gnu.tar.gz 402cbb25ff7472be... 0ba2f3a20ab80f61...
    *.tar.gz ff82da8570cba35f... 16e051018a0b87c7...
    guix_build.log 2c8b50bc4ba25930... f28d9b2228df19cf...
    guix_build.log.diff 326ba7441e1cb55a...
  17. DrahtBot removed the label DrahtBot Guix build requested on Jul 10, 2022
  18. fanquake commented at 9:52 AM on October 3, 2022: member

    What's the state of this change? I think the points from the most recent comment should be addressed.

  19. hebasto commented at 10:07 AM on October 5, 2022: member

    Being focused on the future CMake-based build system, won't work on this PR soon.

    Closing.

  20. hebasto closed this on Oct 5, 2022

  21. bitcoin locked this on Oct 5, 2023

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-24 21:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me