ci: Add Appveyor CI #13964

pull ken2812221 wants to merge 3 commits into bitcoin:master from ken2812221:fix-msvc changing 3 files +40 −68
  1. ken2812221 commented at 7:35 am on August 14, 2018: contributor

    Introduce Appveyor CI for MSVC. This would require the owner adding appveyor to this repo. Also fix some MSVC incompatible code.

    This appveyor.yml file is modified from @sipsorcery and @NicolasDorier ’s code in #12613.

    Appveyor CI result: https://ci.appveyor.com/project/ken2812221/bitcoin/build/1.0.151

  2. fanquake added the label Tests on Aug 14, 2018
  3. fanquake added the label Windows on Aug 14, 2018
  4. practicalswift commented at 8:50 am on August 14, 2018: contributor

    Concept ACK

    More diversity in testing is better.

    FWIW, it seems like a few tests are missing from test_bitcoin.vcxproj – is that intentional?

    0$ for FILE in $(git ls-files -- "*_tests.cpp"); do FILE_BASENAME=$(basename ${FILE}); grep -q ${FILE_BASENAME} build_msvc/test_bitcoin/test_bitcoin.vcxproj || echo "* ${FILE_BASENAME} missing in test_bitcoin.vcxproj"; done
    1* descriptor_tests.cpp missing in test_bitcoin.vcxproj
    2* key_io_tests.cpp missing in test_bitcoin.vcxproj
    3* merkleblock_tests.cpp missing in test_bitcoin.vcxproj
    4* txvalidation_tests.cpp missing in test_bitcoin.vcxproj
    
  5. ken2812221 commented at 9:09 am on August 14, 2018: contributor
    @practicalswift I’m not sure if it is intentional. Maybe @sipsorcery forgot to add them. I’ll add those files after the test pass.
  6. Make macro compatible with MSVC 4d0c7924d2
  7. ci: Add appveyor.yml to build on MSVC 90cc69c0c7
  8. ken2812221 force-pushed on Aug 14, 2018
  9. NicolasDorier commented at 10:02 am on August 14, 2018: contributor

    btw, msbuild support wildcard replacing all ..\..\src\test\xxxxx_tests.cpp by one ..\..\src\test\*.cpp might work.

    EDIT: Or maybe ..\..\src\test\*_tests.cpp

  10. MarcoFalke commented at 12:18 pm on August 14, 2018: member

    utACK a87072f4b9ce2e4020dd2a1ca4ed7cb227757090

    Could you please post instructions for maintainers how to enable this appveyor thing?

  11. MarcoFalke commented at 12:20 pm on August 14, 2018: member
    I guess https://ci.appveyor.com/projects/new on “Public GitHub repositories”?
  12. ken2812221 commented at 1:30 pm on August 14, 2018: contributor
    @MarcoFalke Yes, note that appveyor does not connect with github team. So the owner need to change his account name on appveyor to “bitcoin” to get “bitcoin” project prefix(https://ci.appveyor.com/account), but that is not necessary.
  13. sipsorcery commented at 2:58 pm on August 14, 2018: member

    Tested ACK https://github.com/bitcoin/bitcoin/commit/a87072f4b9ce2e4020dd2a1ca4ed7cb227757090 @NicolasDorier’s suggestion is a good one and would help avoid files missing in the future (it was human error on my behalf that caused them to be missing in the first place).

    0<ItemGroup>
    1  <ClCompile Include="..\..\src\test\*.cpp" Exclude="..\..\src\test\test_bitcoin_fuzzy.cpp" />
    2  <ClCompile Include="..\..\src\wallet\test\*.cpp" />
    3  </ItemGroup>
    

    @MarcoFalke if there is a webhook on the bitcoin/bitcoin project under Settings->WebHooks and we can get it that would allow us to initiate the AppVeyor builds automatically whenever there is a commit. At the moment I kick off a build whenever I see a Twitter commit message.

  14. practicalswift commented at 3:17 pm on August 14, 2018: contributor
    @sipsorcery Would it be possible to use wildcards in the other project files to make the maintenance of these scripts easier? :-)
  15. MarcoFalke commented at 6:16 pm on August 14, 2018: member
    It must run on pull requests. Otherwise we can’t enable it on the master branch without having to fix each failure post merge.
  16. ken2812221 commented at 8:38 pm on August 14, 2018: contributor
    @practicalswift That might not happen on other project files because that would cause link error. @MarcoFalke Yes, it can run on pull request https://ci.appveyor.com/project/ken2812221/bitcoin/build/1.0.151
  17. Use wildcard path in test_bitcoin.vcxproj 1f6ff04e59
  18. ken2812221 force-pushed on Aug 14, 2018
  19. sipsorcery commented at 6:24 am on August 15, 2018: member

    @practicalswift For the other projects it’s not really possible to use wildcards if we also want to maintain the same build components as the Makefile. In particular libbitcoin_common, libbitcoin_util, libbitcoin_consensus and libbitcoin_server all include *.cpp files from /src.

    One alternative solution would be to write a script that parses the Makefile to automatically build the Visual Studio project files. I’ll put it on the list :-).

  20. ken2812221 referenced this in commit e393a18b51 on Aug 15, 2018
  21. MarcoFalke merged this on Aug 15, 2018
  22. MarcoFalke closed this on Aug 15, 2018

  23. ken2812221 deleted the branch on Aug 15, 2018
  24. sipsorcery commented at 9:14 am on August 16, 2018: member

    A small note on the AppVeyor build in this PR.

    The URL to install the bzip dependency in the AppVeyor version of vcpkg (the Microsoft C++ dependency that makes building bitcoin-core straight forward) is currently broken as per https://github.com/Microsoft/vcpkg/pull/4046.

    The consequence is that anyone that forks bitcoin-core and creates their own AppVeyor job will end up with a failing job. At some point AppVeyor will update their vcpkg version and this will be fixed. In the meantime it’s possible to workaround the problem by manually updating the vcpkg files using:

    0cd c:\tools\vcpkg
    1git pull
    

    I don’t think it’s worth adding these commands to the appveyor.yml as it would potentially result in dependency updates that a user may not be expecting.

  25. NicolasDorier commented at 9:22 am on August 16, 2018: contributor
    @sipsorcery maybe pulling and just ckecking out specifc commit so that updates on appveryor does not have impact.
  26. sipsorcery commented at 9:47 am on August 16, 2018: member
    Before doing a PR I’ll try and ascertain how/when AppVeyor update vcpkg https://help.appveyor.com/discussions/problems/15817-vcpkg-updates.
  27. ken2812221 commented at 3:00 am on August 17, 2018: contributor
    @MarcoFalke Did you have any trouble while setting up Appveyor CI?
  28. NicolasDorier commented at 4:48 am on August 17, 2018: contributor

    Cool they replied on https://help.appveyor.com/discussions/problems/15817-vcpkg-updates

    0install:
    1- cmd: |
    2    cd "C:\Tools\vcpkg"
    3    git pull
    4    .\bootstrap-vcpkg.bat
    5    cd %appveyor_build_folder%
    

    @MarcoFalke , you will need that for now if you want to include to github. That said they will fix in few weeks.

  29. MarcoFalke commented at 3:38 pm on August 17, 2018: member
    @laanwj @ken2812221 I have set this up through DrahtBot. Though, it wouldn’t run on pull requests, it seems.
  30. ken2812221 commented at 3:58 pm on August 17, 2018: contributor
    @MarcoFalke Can you take a look at https://github.com/bitcoin/bitcoin/settings/hooks It should enable pull request image
  31. MarcoFalke referenced this in commit 1f470a8916 on Aug 17, 2018
  32. ras0219-msft commented at 7:48 pm on August 17, 2018: none

    @sipsorcery We would definitely recommend what @NicolasDorier suggests – the best fix here is to checkout a specific vcpkg git commit in your appveyor.yml:

    0cd C:\Tools\vcpkg
    1git checkout <some sha, perhaps today's master>
    2.\bootstrap-vcpkg.bat
    3cd %appveyor_build_folder%
    

    Whenever you want to update your dependencies (say, to fix issues like this), you just need to change the commit id.

  33. ken2812221 commented at 4:42 am on August 23, 2018: contributor
  34. MarcoFalke commented at 11:58 am on August 23, 2018: member
    Hmm, that would make it impossible to run multiple pull requests?
  35. ken2812221 commented at 12:19 pm on August 23, 2018: contributor
    @MarcoFalke If you push to the same PR, it would cancel the previous one and does not affect other PRs.
  36. jonasschnelli commented at 8:32 pm on August 23, 2018: contributor

    Post merge: I’m unsure about the usefulness of this. This requires documentation. I have no clue how to make #14032 pass AppVeyor… Somehow I have the feeling that this sets an unexpected heavy burden on those not primarily interested in MSVC support.

    IMO MSVC compatibility should be maintained by those interested in it.

  37. sipsorcery commented at 6:25 am on August 24, 2018: member
    The project files for the msvc build are currently not automatically synchronised with the Makefiles. Whenever a new class file is added or removed the msvc build will break. Until we write a script to keep them in sync I agree with @jonasschnelli in that blocking a PR based on the msvc build is not ideal.
  38. practicalswift commented at 9:09 am on August 24, 2018: contributor

    @sipsorcery Agreed!

    Could a way to solve this be to auto-generate the project files (or at least the parts referencing files) to make sure they’re automatically changed when new files are added/removed?

    The only input needed for such auto-generation would be find src/ -type f? :-)

    See previous discussion in #11526 (comment) and #11526 (comment) about auto-generation.

  39. ryanofsky commented at 6:19 pm on August 24, 2018: member

    blocking a PR based on the msvc build is not ideal.

    From irc yesterday (https://botbot.me/freenode/bitcoin-core-dev/msg/103712220/), it sounds like appveyor failures will not actually block merges, so they might not be a real problem (though annoying to look at).

    Could a way to solve this be to auto-generate the project files

    An easier way to alleviate this might just be to use wildcards more places in the project files. Autogeneration could help or hurt, depending how it is implemented.

  40. sipsorcery commented at 6:41 pm on August 24, 2018: member

    The options I can think of:

    1. Leave the Visual Studio project files as is and manually update the project files as class files are added and removed. Over the last 12 months I’d estimate I’ve updated the project files about a dozen times,
    2. Investigate switching to a wildcard project file,
    3. Switch from Makefile to CMake to allow a wider variety of platform builds from a single configuration.

    For my own purposes option 1 is by far the most useful. Having a Visual Studio project configuration that directly reflects the current bitcoin core libraries makes building and debugging straight forward and is the by far the biggest benefit for me. It’s also not a great burden to update the project files when the build breaks but that’s based on only building the master branch.

    For options 2 and 3 it would make building on Windows easier but be worse for debugging and comprehending the code.

  41. MarcoFalke referenced this in commit 613fc95ee4 on Oct 24, 2018
  42. linuxsh2 referenced this in commit b70411b627 on Jul 29, 2021
  43. linuxsh2 referenced this in commit 4c17c7d84e on Jul 29, 2021
  44. 5tefan referenced this in commit 12d24c70f4 on Aug 14, 2021
  45. linuxsh2 referenced this in commit ac176ff7cf on Sep 16, 2021
  46. linuxsh2 referenced this in commit 7acc71699b on Sep 16, 2021
  47. linuxsh2 referenced this in commit 7cc44fe207 on Sep 16, 2021
  48. 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-12-19 00:12 UTC

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