Quick version string hack that was never fixed #16588

issue dongcarl openend this issue on August 12, 2019
  1. dongcarl commented at 7:14 pm on August 12, 2019: member

    In #11097 we added a quick version string hack that seems to do the following:


    When Gitian building, after generating the source tarball (a la make dist), we invoke make -C src obj/build.h, as make dist does not: https://github.com/bitcoin/bitcoin/blob/b499d8576f30d13dfe9000852afe47ee1c28cfbe/src/Makefile.am#L245-L248 We can see that this calls share/genbuild.sh, which generates a src/obj/build.h containing version information obtained from git: https://github.com/bitcoin/bitcoin/blob/b499d8576f30d13dfe9000852afe47ee1c28cfbe/share/genbuild.sh#L1-L53

    Then, for each architecture we build, we neuter share/genbuild.sh (as normal make will try to regenerate obj/build.h, but now lacks the build information as we’re not in a git repository anymore) and copy over the generated src/obj/build.h mentioned above. All of this is being done before configureing, makeing, and make installing for the architecture: https://github.com/bitcoin/bitcoin/blob/b499d8576f30d13dfe9000852afe47ee1c28cfbe/contrib/gitian-descriptors/gitian-linux.yml#L168-L177


    Perhaps what we can do is simply add src/obj/build.h to EXTRA_DIST, and generate it in a dist-hook? Do non-existent files in EXTRA_DIST get their targets called? Source: https://www.gnu.org/software/automake/manual/html_node/The-dist-Hook.html @theuni @luke-jr would love some more context here.

  2. dongcarl added the label Build system on Aug 12, 2019
  3. laanwj referenced this in commit b6e9ff8996 on Aug 14, 2019
  4. MarcoFalke commented at 1:12 pm on August 14, 2019: member

    Can this be moved to the make dist stage and also made to fail when no git is available? I think that makes most sense.

    Is it supported to call make dist recursively? I guess not, so we can probably safely assume that git is always available at build time.

  5. hebasto commented at 5:09 pm on August 14, 2019: member

    Perhaps what we can do is simply add src/obj/build.h to EXTRA_DIST, and generate it in a dist-hook?

    Will gitian builds have CLIENT_BUILD set correctly?

  6. luke-jr commented at 11:08 pm on August 14, 2019: member

    make will try to update it if it thinks the timestamps are meeting some criteria.

    I think we want to just disable the rule to generate build.h if there’s no git info…

  7. dongcarl commented at 6:22 pm on August 15, 2019: member
    Some discussion in another thread: #16611 (comment)
  8. laanwj referenced this in commit e00ecb3d7a on Aug 19, 2019
  9. sidhujag referenced this in commit 7bdb59d9cd on Aug 19, 2019
  10. MarcoFalke commented at 6:00 pm on August 23, 2019: member

    If I build Bitcoin Core with make distdir VERSION=master && cd bitcoin-master I get:

    02019-08-23T17:36:07Z Bitcoin Core version v0.18.99.0-unk (debug build)
    

    I presume (hope) this is not the case when building from the gitian produced distribution tar. Regardless, this sounds like a bug that should be fixed.

  11. HashUnlimited referenced this in commit c25ebdd1ad on Aug 30, 2019
  12. fanquake closed this on Apr 28, 2020

  13. fanquake commented at 8:45 am on April 28, 2020: member
    @dongcarl I know GitHub has autoclosed this. Can you confirm that there’s nothing left to do here after #18556.
  14. sidhujag referenced this in commit 3d6b60d09e on Apr 28, 2020
  15. dongcarl commented at 6:43 pm on April 28, 2020: member

    I think this is fixed right now, and as long as we don’t generate anything during the release build process that would make git diff-index --quiet HEAD -- return a non-zero status code, we’re good.

    My read of the current behaviour:

    1. When generating the release tarball, we no longer generate src/obj/build.h as of 1362be044724bb49d785ca2e296a3b43343c1690
    2. When building for each $HOST under distsrc-$HOST, share/genbuild.sh is called, and the git commands inside it will traverse up until it hits the top git repo (effectively distsrc-$HOST/../), and the commands will work.

    A corner case that might be confusing: when we perform a build on a dirty repo, the release tarball will be of HEAD (let’s say that’s commit hash fffffffff). HOWEVER, when share/genbuild.sh is being run under distsrc-$HOST, it will output something like

    0#define BUILD_SUFFIX fffffffff-dirty
    

    When really the distsrc-$HOST is not dirty at all.

    I don’t know if that belongs in/deserves a separate issue or not

  16. PastaPastaPasta referenced this in commit 0776a00c2e on Jun 27, 2021
  17. PastaPastaPasta referenced this in commit 867c0e6271 on Jun 28, 2021
  18. PastaPastaPasta referenced this in commit 5194a1a0fe on Jun 29, 2021
  19. PastaPastaPasta referenced this in commit 177a18d200 on Jul 1, 2021
  20. PastaPastaPasta referenced this in commit e8e962a4c5 on Jul 1, 2021
  21. PastaPastaPasta referenced this in commit 56a124b859 on Jul 12, 2021
  22. PastaPastaPasta referenced this in commit 00cc0de358 on Jul 13, 2021
  23. furszy referenced this in commit 4a18d502d9 on Aug 23, 2021
  24. furszy referenced this in commit 3764aafd1b on Sep 17, 2021
  25. furszy referenced this in commit d223d909c2 on Sep 19, 2021
  26. UdjinM6 referenced this in commit 306cb1b47a on Oct 23, 2021
  27. UdjinM6 referenced this in commit ad65a4bed0 on Oct 23, 2021
  28. UdjinM6 referenced this in commit a0d3f37d3a on Dec 4, 2021
  29. MarcoFalke locked this on Feb 15, 2022

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: 2024-10-04 22:12 UTC

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