[MSVC]: Create the config.ini as part of bitcoind build #16258

pull NicolasDorier wants to merge 2 commits into bitcoin:master from NicolasDorier:msvc/build-config-ini changing 3 files +61 −11
  1. NicolasDorier commented at 7:25 am on June 21, 2019: contributor

    This remove the patchwork of powershell done in AppVeyor to the AfterBuild target of bitcoind so that windows developers do not have to figure out how to manually edit the config.ini before running the functional tests.

    You can easily test with msbuild /t:AfterBuild in bitcoind folder.

  2. [MSVC]: Create the config.ini as part of bitcoind build e47e79377f
  3. fanquake added the label Build system on Jun 21, 2019
  4. fanquake added the label Windows on Jun 21, 2019
  5. sipsorcery commented at 5:57 pm on June 21, 2019: member

    I’m not so sure about this change. My personal preference would be that the bitcoin msbuild’s job stops at the point the executables are produced. A majority of the time I do a build I don’t end up running the tests. I’m testing the compilation, debugging etc. Burying non-build related tasks down in one of the vcxproj files seems a bit fragile. If something breaks messing around with a script embedded within XML is not the nicest.

    I do get the point about tidying up the test preparation though. What about a script along the lines of the msvc-autogen.py that performs all the test preparation tasks? The process would then be:

    • msvc-autogen.py
    • msbuild …
    • msvc-testprep.py
  6. NicolasDorier commented at 3:46 am on June 22, 2019: contributor

    Why would you not want to get config.ini generated as part of the build?

    Such msbuild task are not more fragile than a python script, also it would need to be documented, while it should not be.

  7. sipsorcery commented at 5:28 pm on June 24, 2019: member

    Why would you not want to get config.ini generated as part of the build?

    Yes this would be useful.

    What about shortening the string replacement snippet using:

    0File.WriteAllText(
    1   OutputFilename,
    2   Regex.Replace(File.ReadAllText(InputFilename), MatchExpression, ReplacementText)
    3 );
    

    As per https://stackoverflow.com/questions/7837644/how-to-replace-string-in-file-using-msbuild.

  8. fanquake added the label Waiting for author on Jun 25, 2019
  9. NicolasDorier commented at 8:09 am on June 25, 2019: contributor

    @sipsorcery several problem with the stackoverflow solution:

    1. It is not using the right encoding as BOM marker will be generated in the bitcoin.ini
    2. I need to convert a relative path to absolute path
  10. laanwj commented at 1:47 pm on June 25, 2019: member
    Concept ACK (will leave implementation details to people that use MSVC)
  11. sipsorcery commented at 6:42 pm on June 25, 2019: member

    @NicolasDorier tested this PR and looks good. The python tests run with the produced config.ini.

    I did notice that @ENABLE_FUZZ_TRUE@ENABLE_FUZZ=true gets left in the resultant config.ini file. I notice the appveyor logic doesn’t set that variable, it might have been added afterwards.

  12. NicolasDorier commented at 4:25 am on June 26, 2019: contributor

    @sipsorcery strange, as you can see the app veyor script does not talk at all about the ENABLE_FUZZ. The appveyor script replace 8 strings, like mine.

    And I don’t set it.

  13. NicolasDorier commented at 2:34 pm on June 27, 2019: contributor
    @sipsorcery any idea why it is different?
  14. sipsorcery commented at 2:52 pm on June 27, 2019: member

    @NicolasDorier my guess is it’s not different. I suspect the appveyor script ends up leaving the @ENABLE_FUZZ_TRUE@ENABLE_FUZZ=true in the resultant config.ini as well. It doesn’t seem to stop the tests running.

    Given this PR is touching that logic seems like a good opportunity to fix it.

  15. [MSVC] Enable Fuzz for functional tests 819c5ddad3
  16. NicolasDorier commented at 7:44 am on June 28, 2019: contributor

    @sipsorcery got it! done. ping @ken2812221 this might interest you.

    In separate PR, I think I will also automatically copy the output file and pdb to src/

  17. sipsorcery commented at 9:23 am on June 28, 2019: member
    tACK 819c5dd.
  18. NicolasDorier commented at 1:35 pm on June 28, 2019: contributor
    travis failing is not related to this PR.
  19. fanquake removed the label Waiting for author on Jun 28, 2019
  20. MarcoFalke added this to the milestone 0.19.0 on Jun 28, 2019
  21. fanquake commented at 4:19 am on June 29, 2019: member

    ACK 819c5ddad3ca915f77adc94d8b0a5d73069fff99

    I merged this branch, built everything and ran the tests (saw one failure, I assume unrelated), then ran the suggested msbuild /t:AfterBuild command from inside bitcoin\build_msvc\bitcoind.

    after_build

  22. fanquake merged this on Jun 29, 2019
  23. fanquake closed this on Jun 29, 2019

  24. fanquake referenced this in commit 0f309541aa on Jun 29, 2019
  25. NicolasDorier commented at 4:42 am on June 29, 2019: contributor
    @fanquake you still needed to copy bitcoind binaries to src manually right? This is another thing I want to fix in another PR.
  26. NicolasDorier commented at 4:54 am on June 29, 2019: contributor
    Ah you run the C++ tests. The bitcoin.ini is used by the python tests.
  27. DrahtBot locked this on Dec 16, 2021

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-11-17 15:12 UTC

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