ci: document that -Wreturn-type has been fixed upstream (mingw-w64) #28092

pull fanquake wants to merge 1 commits into bitcoin:master from fanquake:update_windows_return_type_docs changing 2 files +4 −7
  1. fanquake commented at 2:26 pm on July 17, 2023: member

    noreturn attributes have been added to the mingw-w64 headers, https://github.com/mingw-w64/mingw-w64/commit/1690994f515910a31b9fb7c7bd3a52d4ba987abe, meaning that from 11.0.0 onwards, you’ll no-longer see -Wreturn-type warnings when using assert(false).

    Add -Wno-return-type to the Windows CI, where it should have been all along, and document why it’s required. This can be dropped when we are using the fixed version of the mingw-w64 headers there.

    Drop the -Werror -Wno-return-type special case from our build system. -Wreturn-type is on by default in Clang and GCC.

    The new mingw-w64 header behaviour can be checked on Ubuntu mantic, which ships with 11.0.0, using:

    0#include <cassert>
    1
    2int f(){ assert(false); }
    3
    4int main() {
    5	return 0;
    6}
    

    On Mantic (with 11.0.0):

    0x86_64-w64-mingw32-g++ test.cpp -Wreturn-type
    1# nada
    

    On Lunar (with 10.0.0):

    0x86_64-w64-mingw32-g++ test.cpp -Wreturn-type
    1test.cpp: In function 'int f()':
    2test.cpp:3:25: warning: no return statement in function returning non-void [-Wreturn-type]
    3    3 | int f(){ assert(false); }
    4      |                         ^
    
  2. DrahtBot commented at 2:26 pm on July 17, 2023: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK TheCharlatan

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #25972 (build: no-longer disable WARN_CXXFLAGS when CXXFLAGS is set by fanquake)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  3. DrahtBot added the label Build system on Jul 17, 2023
  4. fanquake force-pushed on Jul 17, 2023
  5. DrahtBot added the label CI failed on Jul 17, 2023
  6. fanquake commented at 3:19 pm on July 17, 2023: member
    Remembered why we can’t make this change; because the current code was added to our buildsystem as a hack to fix the Windows CI under -Werror, rather than just suppressing the incorrect warning… Took my own advice from 25972 and deleted the check entirely, adding -Wno-return-type to the CI, where it can be dropped once we are using a fixed version of the headers.
  7. fanquake renamed this:
    build: document that -Wreturn-type has been fixed upstream (mingw-w64)
    ci: document that -Wreturn-type has been fixed upstream (mingw-w64)
    on Jul 17, 2023
  8. maflcko commented at 6:31 am on July 18, 2023: member
    Looks like this triggers an OOM for some reason, when it shouldn’t?
  9. fanquake commented at 10:53 am on July 18, 2023: member

    Looks like this triggers an OOM for some reason, when it shouldn’t?

    Looks like this is the same bug with overriding cxxflags dropping other flags. Will fix that.

  10. maflcko commented at 10:56 am on July 18, 2023: member
    Ok, an alternative would be to embed the -Wno-return-type into the compiler CC and CXX env vars, like I did for the valgrind task.
  11. ci: document that -Wreturn-type has been fixed upstream (Windows)
    `noreturn` attributes have been added to the mingw-w64 headers, meaning
    that from 11.0.0 onwards, you'll no-longer see `-Wreturn-type` warnings
    when using assert(false):
    https://github.com/mingw-w64/mingw-w64/commit/1690994f515910a31b9fb7c7bd3a52d4ba987abe.
    
    Add -Wno-return-type to the Windows CI, where is should have been all
    along, and document why it's required. This can be dropped when we are
    using the fixed version of the mingw-w64 headers there.
    
    Drop the -Werror -Wno-return-type special case from our build system.
    -Wreturn-type is on by default in Clang and GCC.
    08eb5f1b67
  12. fanquake force-pushed on Jul 18, 2023
  13. fanquake commented at 1:39 pm on July 18, 2023: member

    Ok. Done with less embedding. Only difference between this and master is s/-Wno-error=return-type/-Wno-return-type/.

    i.e master https://cirrus-ci.com/task/6747293471211520?logs=ci#L1367 vs this PR https://cirrus-ci.com/task/5094810491551744?logs=ci#L983.

  14. DrahtBot removed the label CI failed on Jul 18, 2023
  15. maflcko commented at 8:45 am on July 19, 2023: member
    Given that the config will be bumped to gcc-12 anyway (https://github.com/bitcoin/bitcoin/pull/27897), how hard would it be to bump mingw in guix and CI, and at the same time drop this completely?
  16. fanquake commented at 8:47 am on July 19, 2023: member

    how hard would it be to bump mingw in guix

    I have done the bump in Guix: https://lists.gnu.org/archive/html/guix-patches/2023-07/msg00159.html, so we’ll have that once the time-machine is bumped.

  17. maflcko commented at 9:01 am on July 19, 2023: member

    once the time-machine is bumped.

    Doesn’t this break other builds? So I was wondering if the time machine could be bumped (for mingw), but the Linux tasks be kept as-is for now?

  18. maflcko commented at 9:04 am on July 19, 2023: member
    (I mean, obviously my preference would be to use clang for Windows cross-builds, because mingw doesn’t seem to be used by any large/relevant software project anymore, so using it at all is becoming increasingly fragile, but doing another bump shouldn’t hurt too much for now)
  19. fanquake commented at 2:04 pm on July 19, 2023: member

    So I was wondering if the time machine could be bumped (for mingw), but the Linux tasks be kept as-is for now?

    We don’t currently have an easy way to use separate time-machines for differents HOSTS, and I’m not sure if that’s something we’d want to do. The general time-machine bump is only blocked on one last issue, so that should be done shortly.

    (I mean, obviously my preference would be to use clang for Windows cross-builds,

    I wouldn’t be opposed to that. Although note that in that case we’d still be using mingw-w64, for the Windows headers/runtime etc, swapping out a GCC toolchain for an LLVM/Clang toolchain, so we’d still have to deal with issues like these in either case.

    In this PR, I’d really just like to remove the single -Werror special case, and put it into the CI config. Note that moving these things out of the build system also means they wont be (incorrectly) ported over to CMake.

  20. theuni commented at 5:58 pm on July 20, 2023: member

    Makes sense to me. It ~seems a bit premature maybe~, but I agree with the goal of not carrying this type of baggage over to CMake.

    Edit: removal would be premature if the flag was necessary for building. But as this arguably never should’ve been there in the first place, I suppose that’s not relevant.

  21. TheCharlatan approved
  22. TheCharlatan commented at 9:19 am on July 27, 2023: contributor

    ACK 08eb5f1b67e2af009549717eb5c66b7d7905731f

    I’m fine with the warnings being printed until the mingw toolchain is rolled out everywhere.

    Guix build:

    0find guix-build-$(git rev-parse --short=12 HEAD)/output/ -type f -print0 | env LC_ALL=C sort -z | xargs -r0 sha256sum                                                                                                                                                                        
    1daeec3e7ea34ddf28200d95d96e3295cadfc48fba9d95234880f7c95ec2b56c7  guix-build-08eb5f1b67e2/output/dist-archive/bitcoin-08eb5f1b67e2.tar.gz
    23fda74de33a0e2dccbb74db3766a628135c0f0de7f4ad07afaed82050a2a0a1c  guix-build-08eb5f1b67e2/output/x86_64-w64-mingw32/SHA256SUMS.part
    3ce48e7bb01ed7d2d580a5ac629b515c13974fbfa68496cd902f76f55fae1b6d1  guix-build-08eb5f1b67e2/output/x86_64-w64-mingw32/bitcoin-08eb5f1b67e2-win64-debug.zip
    46a7df9551fd286d12676e35af0b082eac731de7e1a4121be321f5d1f20529cdc  guix-build-08eb5f1b67e2/output/x86_64-w64-mingw32/bitcoin-08eb5f1b67e2-win64-setup-unsigned.exe
    5ac21d932789a1c9bfbd3072d61b8aa4bcdfa4ff97918a7d78320614257538787  guix-build-08eb5f1b67e2/output/x86_64-w64-mingw32/bitcoin-08eb5f1b67e2-win64-unsigned.tar.gz
    6e57e2ded1b225c6038346348e9b5b9480d75c391329697b5206ed73e586bada9  guix-build-08eb5f1b67e2/output/x86_64-w64-mingw32/bitcoin-08eb5f1b67e2-win64.zip
    
  23. fanquake merged this on Jul 27, 2023
  24. fanquake closed this on Jul 27, 2023

  25. fanquake deleted the branch on Jul 27, 2023
  26. sidhujag referenced this in commit f688841c19 on Aug 9, 2023
  27. bitcoin locked this on Jul 26, 2024

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-22 06:12 UTC

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