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 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.

  7. fanquake requested review from sipsorcery on Oct 6, 2021
  8. 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.

  9. MarcoFalke commented at 9:01 AM on October 6, 2021: member
  10. CallMeMisterOwl referenced this in commit afd154a32f on Oct 6, 2021
  11. CallMeMisterOwl referenced this in commit 65a6c82bdd on Oct 6, 2021
  12. 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

  13. 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
    
  14. CallMeMisterOwl force-pushed on Oct 6, 2021
  15. CallMeMisterOwl commented at 10:39 AM on October 6, 2021: contributor

    Did it work ?

  16. 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.

  17. 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.

  18. CallMeMisterOwl force-pushed on Oct 6, 2021
  19. sipsorcery approved
  20. sipsorcery commented at 7:42 PM on October 6, 2021: member

    Works correctly for me.

  21. 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.

  22. MarcoFalke commented at 6:08 AM on October 13, 2021: member

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

  23. 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?

  24. 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.

  25. 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.

  26. CallMeMisterOwl force-pushed on Nov 14, 2021
  27. CallMeMisterOwl force-pushed on Nov 14, 2021
  28. build_msvc/bitcoin_config.h is generated using build_msvc/msvc-autogen.py 410f99faed
  29. CallMeMisterOwl force-pushed on Nov 14, 2021
  30. laanwj commented at 1:53 PM on November 15, 2021: member

    Code review and lightly tested ACK 410f99faed47e27fca77531a864383b6119e7b0b Thank you!

  31. laanwj merged this on Nov 15, 2021
  32. laanwj closed this on Nov 15, 2021

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

    Thank you!

    Pleasure contributing to this beautiful project :wink:

  35. CallMeMisterOwl deleted the branch on Nov 15, 2021
  36. sidhujag referenced this in commit f6ba0799b1 on Nov 16, 2021
  37. laanwj referenced this in commit e4ba90fce4 on Mar 1, 2022
  38. laanwj referenced this in commit b5fabbcf58 on Mar 22, 2022
  39. DrahtBot 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-04-13 18:14 UTC

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