build: Parse version information in msvc-autogen.py #23198

pull CallMeMisterOwl wants to merge 1 commits into bitcoin:master from CallMeMisterOwl:auto_gen_issue changing 3 files +44 −9
  1. CallMeMisterOwl commented at 8:41 PM on October 5, 2021: contributor

    Added a function that parses version information from configure.ac into build_msvc/bitcoin_config.h. This is done by default in msvc-autogen.py, so manual changing of build_msvc/bitcoin_config.h is no longer required. In addition to that I updated the Release Process doc.

    Following values are updated:

    -CLIENT_VERSION_BUILD -CLIENT_VERSION_IS_RELEASE -CLIENT_VERSION_MAJOR -CLIENT_VERSION_MINOR -COPYRIGHT_YEAR -PACKAGE_STRING -PACKAGE_VERSION

    fixes #23073

  2. CallMeMisterOwl commented at 8:43 PM on October 5, 2021: contributor

    Sorry for the second pull request, I tried to squash the commits but something went wrong and it ended up with a lot of other commits. This is the fixed version now, hope this works.

  3. DrahtBot added the label Build system on Oct 5, 2021
  4. fanquake renamed this:
    build: fixes #23073 Parse version information in msvc-autogen.py
    build: Parse version information in msvc-autogen.py
    on Oct 6, 2021
  5. fanquake added the label Windows on Oct 6, 2021
  6. fanquake cross-referenced this on Oct 6, 2021 from issue doc: fixes #23073 Updated the Release Process by CallMeMisterOwl
  7. fanquake commented at 12:31 AM on October 6, 2021: member

    In future, please don't open new Pull Requests for the same change. You should be able to recover your branch. Please combine the change from #23195 into this PR. You'll also need to sqaush your commits here, and write a more cohesive commit message. See the update PR description for an example.

  8. fanquake requested review from sipsorcery on Oct 6, 2021
  9. sipsorcery commented at 7:49 AM on October 6, 2021: member

    @CallMeMisterOwl thx for the PR.

    Am I correct that its purpose is to update the version fields in the build_msvc/bitcoin_config.h file with the matching values in configure.ac? If so it would be worth adding that to your PR description. It's a bit light at the moment.

  10. MarcoFalke commented at 9:01 AM on October 6, 2021: member
  11. CallMeMisterOwl referenced this in commit afd154a32f on Oct 6, 2021
  12. CallMeMisterOwl referenced this in commit 65a6c82bdd on Oct 6, 2021
  13. CallMeMisterOwl commented at 10:23 AM on October 6, 2021: contributor

    In future, please don't open new Pull Requests for the same change. You should be able to recover your branch.

    Got it

    Please combine the change from #23195 into this PR. You'll also need to sqaush your commits here, and write a more cohesive commit message. See the update PR description for an example.

    Done

  14. MarcoFalke commented at 10:25 AM on October 6, 2021: member

    The instructions to squash don't work when there are merge commit. You can use something like this instead:

    git checkout branch_name
    git fetch origin 113b863f0773999497f952daa6539a03a66a9de3
    git merge        113b863f0773999497f952daa6539a03a66a9de3
    git reset --soft 113b863f0773999497f952daa6539a03a66a9de3
    git commit -m 'commit message'
    git push origin branch_name -f
    
  15. CallMeMisterOwl force-pushed on Oct 6, 2021
  16. CallMeMisterOwl commented at 10:39 AM on October 6, 2021: contributor

    Did it work ?

  17. MarcoFalke commented at 10:44 AM on October 6, 2021: member

    No, you'll need to rebase on latest master now.

    Also, you can remove the "Fixes #..." prefix from the commit message and put it into the GitHub pull request description.

  18. DrahtBot cross-referenced this on Oct 6, 2021 from issue util: Make syscall sandbox compilable with kernel 4.4.0 by laanwj
  19. MarcoFalke commented at 12:18 PM on October 6, 2021: member

    Again, a rebase it not possible with merge commits in between (I think), you'll have to repeat the steps of #23198 (comment) with the commit hash of the latest master.

  20. CallMeMisterOwl force-pushed on Oct 6, 2021
  21. DrahtBot cross-referenced this on Oct 6, 2021 from issue Make CAddrman::Select_ select buckets, not positions, first by sipa
  22. DrahtBot cross-referenced this on Oct 6, 2021 from issue [fuzz] Use public methods in addrman fuzz tests by jnewbery
  23. DrahtBot cross-referenced this on Oct 6, 2021 from issue refactor: Forbid calling unsafe fs::path(std::string) constructor and fs::path::string() method by ryanofsky
  24. DrahtBot cross-referenced this on Oct 6, 2021 from issue log: improve checkaddrman logging with duration in milliseconds by jonatack
  25. DrahtBot cross-referenced this on Oct 6, 2021 from issue log: improve addrman logging by mzumsande
  26. sipsorcery approved
  27. sipsorcery commented at 7:42 PM on October 6, 2021: member

    Works correctly for me.

  28. sipsorcery commented at 7:53 PM on October 6, 2021: member

    The change in this PR works correctly and makes sense. But...

    I'm 50-50 on the concept of the Python pre-build script for the msvc build. The original goal of the msvc build was to provide a quick and easy way for Windows devs to build and debug Bitcoin Core, adding the build to the CI was an added benefit. The dilemna is as the Python pre-build script is slowly morphing into a mini build system. It causes me a vague sesne of unease to see the script grow.

    That concern noted, I've can only recall seeing two issues over nearly 4 years with devs griping about running the script so it doesn't seem to have translated into a pain point so far. This PR removes a manual step in the Bitcoin Core release process and therefore is a good idea.

    tACK 8be91af6315b1d8b09a80fa35154ff453fbc9595.

  29. DrahtBot cross-referenced this on Oct 6, 2021 from issue addrman: treat Tor/I2P/CJDNS as a single group by vasild
  30. MarcoFalke commented at 6:08 AM on October 13, 2021: member

    Concept ACK. Seems ok to simplify the release process without complicating other steps.

  31. MarcoFalke commented at 6:09 AM on October 13, 2021: member

    @laanwj As you opened the issue, do you think this is ready for merge?

  32. laanwj commented at 1:25 PM on October 27, 2021: member

    It causes me a vague sesne of unease to see the script grow.

    I would agree in general. We definitely don't want to invent yet another meta-build system. But for this specifically it's quite an annoyance for every release to have to update these things manually. The reason it's not forgotten more often is because I wrote another python script (https://github.com/bitcoin-core/bitcoin-maintainer-tools/blob/master/make-tag.py) to check everything before making a tag. Most of that script can go after this, so I definitely see this as progress.

  33. in build_msvc/msvc-autogen.py:83 in 8be91af631 outdated
      78 | +    config_dict = dict(item.split(", ") for item in config_info)
      79 | +    config_dict["PACKAGE_VERSION"] = f"\"{config_dict['CLIENT_VERSION_MAJOR']}.{config_dict['CLIENT_VERSION_MINOR']}.{config_dict['CLIENT_VERSION_BUILD']}\""
      80 | +    version = config_dict["PACKAGE_VERSION"].strip('"')
      81 | +    config_dict["PACKAGE_STRING"] = f"\"Bitcoin Core {version}\""
      82 | +
      83 | +    for line in fileinput.input(os.path.join(SOURCE_DIR,'../build_msvc/bitcoin_config.h', ), inplace=True):
    


    laanwj commented at 1:28 PM on October 27, 2021:
    • Might want to remove the current values from build_msvc/bitcoin_config.h to make it clear that this script needs to be run (and to pre-empt people from filing PRs to update the stale info).
    • Instead of changing this file in-place I'd prefer renaming it to build_msvc/bitcoin_config.h.in (or such) in the build system, then making a copy to build_msvc/bitcoin_config.h here. This avoids the generated state from being checked in accidentally.

    CallMeMisterOwl commented at 1:15 PM on November 4, 2021:

    Hi @laanwj, did I understand this correctly ? build_msvc/bitcoin_config.h.in is basically a empty template and everytime build_msvc/msvc-autogen.py is executed it generates build_msvc/bitcoin_config.h using build_msvc/bitcoin_config.h.in and the values from configure.ac.


    laanwj commented at 3:35 PM on November 10, 2021:

    Yes, that sounds good to me. build_msvc/bitcoin_config.h.in would be the (read-only) template, with substitution strings that will be filled in by the script and written to build_msvc/bitcoin_config.h.


    CallMeMisterOwl commented at 2:25 PM on November 14, 2021:

    Yes, that sounds good to me. build_msvc/bitcoin_config.h.in would be the (read-only) template, with substitution strings > that will be filled in by the script and written to build_msvc/bitcoin_config.h.

    Ok, I changed the code. It should work the way you mentioned now.

  34. CallMeMisterOwl force-pushed on Nov 14, 2021
  35. CallMeMisterOwl force-pushed on Nov 14, 2021
  36. build_msvc/bitcoin_config.h is generated using build_msvc/msvc-autogen.py 410f99faed
  37. CallMeMisterOwl force-pushed on Nov 14, 2021
  38. laanwj commented at 1:53 PM on November 15, 2021: member

    Code review and lightly tested ACK 410f99faed47e27fca77531a864383b6119e7b0b Thank you!

  39. laanwj merged this on Nov 15, 2021
  40. laanwj closed this on Nov 15, 2021

  41. sidhujag referenced this in commit 3975f986fa on Nov 15, 2021
  42. CallMeMisterOwl commented at 5:41 PM on November 15, 2021: contributor

    Thank you!

    Pleasure contributing to this beautiful project :wink:

  43. CallMeMisterOwl deleted the branch on Nov 15, 2021
  44. sidhujag referenced this in commit f6ba0799b1 on Nov 16, 2021
  45. laanwj referenced this in commit e4ba90fce4 on Mar 1, 2022
  46. laanwj cross-referenced this on Mar 1, 2022 from issue make-tag: Remove MSVC check by laanwj
  47. laanwj referenced this in commit b5fabbcf58 on Mar 22, 2022
  48. bitcoin locked this on Nov 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: 2026-05-20 06:53 UTC