bloomberg / blazingmq

A modern high-performance open source message queuing system
https://bloomberg.github.io/blazingmq/
Apache License 2.0
2.54k stars 132 forks source link

Issue with build script #129

Closed Simon-Sandrew closed 11 months ago

Simon-Sandrew commented 11 months ago

Is there an existing issue for this?

Current Behavior

Build script(both build_ubuntu.sh and build_darwin.sh) fail to build blazingmq. Build produces a warning and fails to continue build due to flag set to fail on warnings. The following error occurs: In file included from /home/jon/cs/bb/simon-fork/blazingmq/include/bslstl_ownerless.h:72, from /home/jon/cs/bb/simon-fork/blazingmq/include/bsl_memory.h:152, from /home/jon/cs/bb/simon-fork/blazingmq/include/bdlf_bind.h:900, from /home/jon/cs/bb/simon-fork/blazingmq/thirdparty/ntf-core/groups/ntc/ntccfg/ntccfg_bind.h:40, from /home/jon/cs/bb/simon-fork/blazingmq/thirdparty/ntf-core/groups/ntc/ntccfg/ntccfg_platform.h:22, from /home/jon/cs/bb/simon-fork/blazingmq/thirdparty/ntf-core/groups/ntc/ntcs/ntcs_strand.h:22, from /home/jon/cs/bb/simon-fork/blazingmq/thirdparty/ntf-core/groups/ntc/ntcs/ntcs_strand.cpp:16: In destructor ‘bsl::shared_ptr<ELEMENT_TYPE>::~shared_ptr() [with ELEMENT_TYPE = BloombergLP::ntci::Executor]’, inlined from ‘BloombergLP::ntcs::ObserverRef<TYPE>::~ObserverRef() [with TYPE = BloombergLP::ntci::Executor]’ at /home/jon/cs/bb/simon-fork/blazingmq/thirdparty/ntf-core/groups/ntc/ntcs/ntcs_observer.h:533:32, inlined from ‘virtual void BloombergLP::ntcs::Strand::moveAndExecute(BloombergLP::ntci::Executor::FunctorSequence*, const BloombergLP::ntci::Executor::Functor&)’ at /home/jon/cs/bb/simon-fork/blazingmq/thirdparty/ntf-core/groups/ntc/ntcs/ntcs_strand.cpp:263:5: /home/jon/cs/bb/simon-fork/blazingmq/include/bslstl_sharedptr.h:5045:28: error: ‘*(bsl::shared_ptr<BloombergLP::ntci::Executor>*)((char*)&executorRef + offsetof(BloombergLP::ntcs::ObserverRef<BloombergLP::ntci::Executor>,BloombergLP::ntcs::ObserverRef<BloombergLP::ntci::Executor>::d_shared)).bsl::shared_ptr<BloombergLP::ntci::Executor>::d_rep_p’ may be used uninitialized [-Werror=maybe-uninitialized] 5045 | d_rep_p->releaseRef(); | ~~~~~~~~~~~~~~~~~~~^~ /home/jon/cs/bb/simon-fork/blazingmq/thirdparty/ntf-core/groups/ntc/ntcs/ntcs_strand.cpp: In member function ‘virtual void BloombergLP::ntcs::Strand::moveAndExecute(BloombergLP::ntci::Executor::FunctorSequence*, const BloombergLP::ntci::Executor::Functor&)’: /home/jon/cs/bb/simon-fork/blazingmq/thirdparty/ntf-core/groups/ntc/ntcs/ntcs_strand.cpp:254:43: note: ‘*(bsl::shared_ptr<BloombergLP::ntci::Executor>*)((char*)&executorRef + offsetof(BloombergLP::ntcs::ObserverRef<BloombergLP::ntci::Executor>,BloombergLP::ntcs::ObserverRef<BloombergLP::ntci::Executor>::d_shared)).bsl::shared_ptr<BloombergLP::ntci::Executor>::d_rep_p’ was declared here 254 | ntcs::ObserverRef<ntci::Executor> executorRef(&d_executor); | ^~~~~~~~~~~ In destructor ‘bsl::shared_ptr<ELEMENT_TYPE>::~shared_ptr() [with ELEMENT_TYPE = BloombergLP::ntci::Executor]’, inlined from ‘BloombergLP::ntcs::ObserverRef<TYPE>::~ObserverRef() [with TYPE = BloombergLP::ntci::Executor]’ at /home/jon/cs/bb/simon-fork/blazingmq/thirdparty/ntf-core/groups/ntc/ntcs/ntcs_observer.h:533:32, inlined from ‘virtual void BloombergLP::ntcs::Strand::execute(const BloombergLP::ntci::Executor::Functor&)’ at /home/jon/cs/bb/simon-fork/blazingmq/thirdparty/ntf-core/groups/ntc/ntcs/ntcs_strand.cpp:230:5: /home/jon/cs/bb/simon-fork/blazingmq/include/bslstl_sharedptr.h:5045:28: error: ‘*(bsl::shared_ptr<BloombergLP::ntci::Executor>*)((char*)&executorRef + offsetof(BloombergLP::ntcs::ObserverRef<BloombergLP::ntci::Executor>,BloombergLP::ntcs::ObserverRef<BloombergLP::ntci::Executor>::d_shared)).bsl::shared_ptr<BloombergLP::ntci::Executor>::d_rep_p’ may be used uninitialized [-Werror=maybe-uninitialized] 5045 | d_rep_p->releaseRef(); | ~~~~~~~~~~~~~~~~~~~^~ /home/jon/cs/bb/simon-fork/blazingmq/thirdparty/ntf-core/groups/ntc/ntcs/ntcs_strand.cpp: In member function ‘virtual void BloombergLP::ntcs::Strand::execute(const BloombergLP::ntci::Executor::Functor&)’: /home/jon/cs/bb/simon-fork/blazingmq/thirdparty/ntf-core/groups/ntc/ntcs/ntcs_strand.cpp:221:43: note: ‘*(bsl::shared_ptr<BloombergLP::ntci::Executor>*)((char*)&executorRef + offsetof(BloombergLP::ntcs::ObserverRef<BloombergLP::ntci::Executor>,BloombergLP::ntcs::ObserverRef<BloombergLP::ntci::Executor>::d_shared)).bsl::shared_ptr<BloombergLP::ntci::Executor>::d_rep_p’ was declared here 221 | ntcs::ObserverRef<ntci::Executor> executorRef(&d_executor); | ^~~~~~~~~~~ cc1plus: all warnings being treated as errors gmake[3]: *** [CMakeFiles/ntcs.dir/build.make:594: CMakeFiles/ntcs.dir/groups/ntc/ntcs/ntcs_strand.cpp.o] Error 1 gmake[3]: *** Waiting for unfinished jobs.... gmake[2]: *** [CMakeFiles/Makefile2:7198: CMakeFiles/ntcs.dir/all] Error 2 gmake[1]: *** [Makefile:166: all] Error 2

This results in the following failure:

CMake Error at /home/jon/cs/bb/simon-fork/blazingmq/build/ntf/Linux/opt_dbg_exc_mt_64/cmake_install.cmake:1384 (file): file INSTALL cannot find "/home/jon/cs/bb/simon-fork/blazingmq/build/ntf/Linux/opt_dbg_exc_mt_64/lib/libntc.a": No such file or directory.

Expected Behavior

No response

Steps To Reproduce

  1. Clone Blazingmq
  2. Run ./bin/build-darwin.sh or ./bin/build-ubuntu.sh

BlazingMQ Version

1.0.0

Anything else?

Issue was encountered on a intel macbook as well as a machine running the Fedora linux distro

kaikulimu commented 11 months ago

I see: cc1plus: all warnings being treated as errors gmake[3]

The first thing I would try is: can you turn off all warnings as errors?

Simon-Sandrew commented 11 months ago

Where would this flag be set?

kaikulimu commented 11 months ago

Usually, you do so by setting -Wno-error in your compiler flags. See: https://stackoverflow.com/questions/11561261/how-can-i-compile-without-warnings-being-treated-as-errors

I just tried running it on my laptop and the script worked. I suspect it might be something to do with your compiler options. What version of which compiler are you running?

hallfox commented 11 months ago

Hi @Simon-Sandrew, I believe this is a known bug in ntf-core. Can you inspect what /home/jon/cs/bb/simon-fork/blazingmq/build/ntf/Linux/opt_dbg_exc_mt_64/lib/libntc.a points to on your file system? Can you try building ntf-core separately using their build instructions and check what those build as?

Alternatively, can you try building BlazingMQ using the vcpkg instructions? The build recipe for ntf-core in vcpkg should have a fix for this issue.

Simon-Sandrew commented 11 months ago

This has been fixed through following vcpkg build instructions. Thanks!