test: Fix Windows cross build #21115

pull hebasto wants to merge 1 commits into bitcoin:master from hebasto:210208-win changing 2 files +2 −1
  1. hebasto commented at 1:11 PM on February 8, 2021: member

    On master (e51f6c4dee3d42b2707c31fa1c93a337b6bf5ba7, after #20936 merge), Windows cross compiling fails:

    $ make > /dev/null
    In file included from ./policy/fees.h:12,
                     from policy/fees.cpp:6:
    policy/fees.cpp: In member function ‘unsigned int CBlockPolicyEstimator::HighestTargetTracked(FeeEstimateHorizon) const’:
    ./sync.h:232:104: warning: control reaches end of non-void function [-Wreturn-type]
      232 | #define LOCK(cs) DebugLock<decltype(cs)> PASTE2(criticalblock, __COUNTER__)(cs, #cs, __FILE__, __LINE__)
          |                                                                                                        ^
    policy/fees.cpp:680:5: note: in expansion of macro ‘LOCK’
      680 |     LOCK(m_cs_fee_estimator);
          |     ^~~~
    test/fuzz/netaddress.cpp:12:10: fatal error: netinet/in.h: No such file or directory
       12 | #include <netinet/in.h>
          |          ^~~~~~~~~~~~~~
    compilation terminated.
    make[2]: *** [Makefile:13039: test/fuzz/fuzz-netaddress.o] Error 1
    make[2]: *** Waiting for unfinished jobs....
    libtool: warning: undefined symbols not allowed in x86_64-w64-mingw32 shared libraries; building static only
    test/fuzz/string.cpp: In function ‘void string_fuzz_target(FuzzBufferType)’:
    test/fuzz/string.cpp:81:11: error: ‘ShellEscape’ was not declared in this scope
       81 |     (void)ShellEscape(random_string_1);
          |           ^~~~~~~~~~~
    make[2]: *** [Makefile:13543: test/fuzz/fuzz-string.o] Error 1
    make[1]: *** [Makefile:15078: all-recursive] Error 1
    make: *** [Makefile:812: all-recursive] Error 1
    

    This PR fixes both of errors.

  2. fanquake added the label Tests on Feb 8, 2021
  3. test: Fix Windows cross build 723eb4326b
  4. hebasto force-pushed on Feb 8, 2021
  5. MarcoFalke commented at 1:30 PM on February 8, 2021: member

    Could remove --disable-fuzz-binary from the ci config to show that it works now?

  6. hebasto commented at 1:34 PM on February 8, 2021: member

    Could remove --disable-fuzz-binary from the ci config to show that it works now?

    Done.

  7. in ci/test/00_setup_env_native_qt5.sh:20 in 5574b7864f outdated
      16 | @@ -17,4 +17,4 @@ export RUN_UNIT_TESTS="false"
      17 |  export GOAL="install"
      18 |  export PREVIOUS_RELEASES_TO_DOWNLOAD="v0.15.2 v0.16.3 v0.17.2 v0.18.1 v0.19.1"
      19 |  export BITCOIN_CONFIG="--enable-zmq --with-libs=no --with-gui=qt5 --enable-glibc-back-compat --enable-reduce-exports
      20 | ---enable-debug --disable-fuzz-binary  CFLAGS=\"-g0 -O2 -funsigned-char\" CXXFLAGS=\"-g0 -O2 -funsigned-char\" --with-boost-process"
      21 | +--enable-debug CFLAGS=\"-g0 -O2 -funsigned-char\" CXXFLAGS=\"-g0 -O2 -funsigned-char\" --with-boost-process"
    


    MarcoFalke commented at 1:50 PM on February 8, 2021:

    This fails, because this pull only fixes the windows build, not the gcc build


    hebasto commented at 2:01 PM on February 8, 2021:

    I couldn't follow. Which gcc bug do you mean?


    MarcoFalke commented at 2:44 PM on February 8, 2021:
    /usr/bin/ccache g++ -m64 -std=c++17 -DHAVE_CONFIG_H -I. -I../src/config  -DDEBUG -DDEBUG_LOCKORDER -DABORT_ON_FAILED_ASSUME  -I. -I./secp256k1/include  -DBOOST_SP_USE_STD_ATOMIC -DBOOST_AC_USE_STD_ATOMIC -pthread -isystem /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include -I./leveldb/include -I./leveldb/helpers/memenv -I./univalue/include -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC -I/tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/  -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS -DPROVIDE_MAIN_FUNCTION -O0 -g3 -ftrapv -fstack-reuse=none -Wstack-protector -fstack-protector-all   -Werror=vla -Werror=switch -Werror=unused-variable -Werror=date-time -Werror=return-type -Werror=sign-compare   -fPIE -pipe -O1 -g0 -O2 -funsigned-char -fno-extended-identifiers -c -o test/fuzz/test_fuzz_fuzz-cuckoocache.o `test -f 'test/fuzz/cuckoocache.cpp' || echo './'`test/fuzz/cuckoocache.cpp
    In file included from test/fuzz/cuckoocache.cpp:5:0:
    ./cuckoocache.h: In instantiation of ‘void CuckooCache::cache<Element, Hash>::insert(Element) [with Element = bool; Hash = {anonymous}::RandomHasher]’:
    test/fuzz/cuckoocache.cpp:42:67:   required from here
    ./cuckoocache.h:431:22: error: no matching function for call to ‘swap(std::__debug::vector<bool>::reference, bool&)’
                 std::swap(table[last_loc], e);
                 ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
    

    https://cirrus-ci.com/task/6298763082858496?command=ci#L3984


    hebasto commented at 2:47 PM on February 8, 2021:

    Yes, I see the error message. It seems provoked by depends with DEBUG=1.


    hebasto commented at 3:02 PM on February 8, 2021:

    Another example of broken Windows builds with DEBUG=1 is #19772.

  8. MarcoFalke commented at 3:13 PM on February 8, 2021: member

    Looks like this still fails:

      CXXLD    test/fuzz/fuzz.exe
    /usr/lib/gcc/x86_64-w64-mingw32/7.3-posix/../../../../x86_64-w64-mingw32/lib/libmingw32.a(lib64_libmingw32_a-crt0_c.o): In function `main':
    ./mingw-w64-crt/crt/crt0_c.c:18: undefined reference to `WinMain'
    collect2: error: ld returned 1 exit status
    Makefile:5240: recipe for target 'test/fuzz/fuzz.exe' failed
    
  9. hebasto force-pushed on Feb 8, 2021
  10. hebasto commented at 3:28 PM on February 8, 2021: member

    Could remove --disable-fuzz-binary from the ci config to show that it works now?

    Done.

    Reverted back.

  11. MarcoFalke commented at 3:29 PM on February 8, 2021: member

    cr ACK 723eb4326bac4a3906cbfe278bb6b8bee17e7790

  12. fanquake merged this on Feb 9, 2021
  13. fanquake closed this on Feb 9, 2021

  14. hebasto deleted the branch on Feb 9, 2021
  15. sidhujag referenced this in commit 323a68bde0 on Feb 9, 2021
  16. DrahtBot locked this on Aug 18, 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-16 21:14 UTC

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