aws-samples / aws-iot-securetunneling-localproxy

AWS Iot Secure Tunneling local proxy reference C++ implementation
https://docs.aws.amazon.com/iot/latest/developerguide/what-is-secure-tunneling.html
Apache License 2.0
77 stars 72 forks source link

macOS boost brew errors #15

Closed revmischa closed 4 years ago

revmischa commented 4 years ago

If I use the version of boost that comes with brew I get the compile error on macOS:

/Users/cyber/dev/jb/metro-electric/metromon/aws-iot-securetunneling-localproxy/src/TcpAdapterProxy.cpp:542:34: error: no member named 'lowest_layer' in
      'boost::beast::websocket::stream<boost::asio::ssl::stream<boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::executor> >, true>'
                        tac.wss->lowest_layer().set_option(send_buffer_size_option);
                        ~~~~~~~  ^

/usr/local/include/boost/beast/core/flat_buffer.hpp:525:7: note: 'flat_buffer' declared here
using flat_buffer =
      ^
In file included from /Users/cyber/dev/jb/metro-electric/metromon/aws-iot-securetunneling-localproxy/src/main.cpp:25:
/Users/cyber/dev/jb/metro-electric/metromon/aws-iot-securetunneling-localproxy/src/TcpAdapterProxy.h:299:23: error: no type named 'multi_buffer' in namespace
      'boost::beast'; did you mean 'flat_buffer'?
        boost::beast::multi_buffer                  web_socket_data_write_buffer;
        ~~~~~~~~~~~~~~^~~~~~~~~~~~
                      flat_buffer
/usr/local/include/boost/beast/core/flat_buffer.hpp:525:7: note: 'flat_buffer' declared here
using flat_buffer =
      ^
5 errors generated.
❯ brew info boost
boost: stable 1.72.0 (bottled), HEAD
Collection of portable C++ source libraries
https://www.boost.org/
/usr/local/Cellar/boost/1.72.0 (14,466 files, 648.6MB) *
  Poured from bottle on 2020-02-05 at 18:00:53
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/boost.rb
DavidOgunsAWS commented 4 years ago

Hi Mischa,

The localproxy currently can only be built against Boost versions 1.68 and 1.69. Newer versions of Boost have broken compatibility within the Boost::Beast library.

revmischa commented 4 years ago

Okay, I uninstalled boost via brew and installed 1.69 manually according to instructions

-- The CXX compiler identification is AppleClang 11.0.0.11000033
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Found Protobuf: /usr/local/lib/libprotobuf.dylib (found suitable version "3.11.2", minimum required is "3.6.1") 
-- Found OpenSSL: /usr/local/lib/libcrypto.dylib (found version "1.1.0d")  
-- Found Boost: /usr/local/include (found suitable version "1.69.0", minimum required is "1.68.0") found components: system log log_setup thread program_options date_time filesystem regex chrono atomic 
-- Configuring done
-- Generating done
-- Build files have been written to: bleh/aws-iot-securetunneling-localproxy/build
[  7%] Running cpp protocol buffer compiler on bleh/aws-iot-securetunneling-localproxy/resources/Message.proto
Scanning dependencies of target localproxytest
[ 15%] Building CXX object CMakeFiles/localproxytest.dir/test/AdapterTests.cpp.o
[ 23%] Building CXX object CMakeFiles/localproxytest.dir/src/TcpAdapterProxy.cpp.o
bleh/aws-iot-securetunneling-localproxy/src/TcpAdapterProxy.cpp:234:105: error: lambda capture 'tac' is not used
      [-Werror,-Wunused-lambda-capture]
            [this, web_socket_write_buffer_drain_complete, tcp_write_buffer_drain_complete, then_what, &tac]()
                                                                                                     ~~~^~~
bleh/aws-iot-securetunneling-localproxy/src/TcpAdapterProxy.cpp:1142:31: error: lambda capture 'ec' is not used
      [-Werror,-Wunused-lambda-capture]
                [this, &tac, &ec]()
                           ~~~^~
bleh/aws-iot-securetunneling-localproxy/src/TcpAdapterProxy.cpp:1158:43: error: lambda capture 'ec' is not used
      [-Werror,-Wunused-lambda-capture]
                            [this, &tac, &ec]()
                                       ~~~^~
bleh/aws-iot-securetunneling-localproxy/src/TcpAdapterProxy.cpp:1201:43: error: lambda capture 'ec' is not used
      [-Werror,-Wunused-lambda-capture]
                            [this, &tac, &ec]()
                                       ~~~^~
bleh/aws-iot-securetunneling-localproxy/src/TcpAdapterProxy.cpp:1218:47: error: lambda capture 'ec' is not used
      [-Werror,-Wunused-lambda-capture]
                                [this, &tac, &ec]()
                                           ~~~^~
5 errors generated.
make[2]: *** [CMakeFiles/localproxytest.dir/src/TcpAdapterProxy.cpp.o] Error 1
make[1]: *** [CMakeFiles/localproxytest.dir/all] Error 2
make: *** [all] Error 2
revmischa commented 4 years ago

If I remove -Werror:

[ 76%] Linking CXX executable bin/localproxytest
ld: library not found for -latomic
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [bin/localproxytest] Error 1
make[1]: *** [CMakeFiles/localproxytest.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
5 warnings generated.
[ 84%] Linking CXX executable bin/localproxy
ld: library not found for -latomic
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [bin/localproxy] Error 1
make[1]: *** [CMakeFiles/localproxy.dir/all] Error 2
make: *** [all] Error 2
jmachuca77 commented 4 years ago

I have the same issue as above I built all the dependencies as per the instructions

/Users/jaime/temp/greengrass/aws-iot-securetunneling-localproxy/src/TcpAdapterProxy.cpp:234:105: error: lambda capture 'tac' is not used [-Werror,-Wunused-lambda-capture]
            [this, web_socket_write_buffer_drain_complete, tcp_write_buffer_drain_complete, then_what, &tac]()
                                                                                                     ~~~^~~
/Users/jaime/temp/greengrass/aws-iot-securetunneling-localproxy/src/TcpAdapterProxy.cpp:1142:31: error: lambda capture 'ec' is not used [-Werror,-Wunused-lambda-capture]
                [this, &tac, &ec]()
                           ~~~^~
/Users/jaime/temp/greengrass/aws-iot-securetunneling-localproxy/src/TcpAdapterProxy.cpp:1158:43: error: lambda capture 'ec' is not used [-Werror,-Wunused-lambda-capture]
                            [this, &tac, &ec]()
                                       ~~~^~
/Users/jaime/temp/greengrass/aws-iot-securetunneling-localproxy/src/TcpAdapterProxy.cpp:1201:43: error: lambda capture 'ec' is not used [-Werror,-Wunused-lambda-capture]
                            [this, &tac, &ec]()
                                       ~~~^~
/Users/jaime/temp/greengrass/aws-iot-securetunneling-localproxy/src/TcpAdapterProxy.cpp:1218:47: error: lambda capture 'ec' is not used [-Werror,-Wunused-lambda-capture]
                                [this, &tac, &ec]()
                                           ~~~^~
5 errors generated.
RogerBackwards commented 4 years ago

Same here! `c/TcpAdapterProxy.cpp:234:105: error: lambda capture 'tac' is not used [-Werror,-Wunused-lambda-capture] ...tcp_write_buffer_drain_complete, then_what, &tac]()


/Volumes/Transcend/Feina/Inteleen/Raspian/dependencies/aws-iot-securetunneling-localproxy/src/TcpAdapterProxy.cpp:1142:31: error: 
      lambda capture 'ec' is not used [-Werror,-Wunused-lambda-capture]
                [this, &tac, &ec]()
                           ~~~^~
/Volumes/Transcend/Feina/Inteleen/Raspian/dependencies/aws-iot-securetunneling-localproxy/src/TcpAdapterProxy.cpp:1158:43: error: 
      lambda capture 'ec' is not used [-Werror,-Wunused-lambda-capture]
                            [this, &tac, &ec]()
                                       ~~~^~
/Volumes/Transcend/Feina/Inteleen/Raspian/dependencies/aws-iot-securetunneling-localproxy/src/TcpAdapterProxy.cpp:1201:43: error: 
      lambda capture 'ec' is not used [-Werror,-Wunused-lambda-capture]
                            [this, &tac, &ec]()
                                       ~~~^~
/Volumes/Transcend/Feina/Inteleen/Raspian/dependencies/aws-iot-securetunneling-localproxy/src/TcpAdapterProxy.cpp:1218:47: error: 
      lambda capture 'ec' is not used [-Werror,-Wunused-lambda-capture]
                                [this, &tac, &ec]()
                                           ~~~^~
5 errors generated.
make[2]: *** [CMakeFiles/localproxytest.dir/src/TcpAdapterProxy.cpp.o] Error 1
make[1]: *** [CMakeFiles/localproxytest.dir/all] Error 2`
jamesrusso commented 4 years ago

I too am struggling to get this thing built on OSX.

HarshGandhi-AWS commented 4 years ago

Hello everyone ,

Thank you for your feedback. This issue has been resolved now (#21). Please clone the latest commit and let me know if you are still facing any errors or issues while working with securetunneling-localproxy. I'll be happy to help.

Thank you, Harsh Gandhi