From 393b28fc4f02d513c19966dbaf8c2b321430b85a Mon Sep 17 00:00:00 2001 From: Xiaocheng Song Date: Wed, 11 Dec 2019 02:59:13 +0800 Subject: [PATCH 1/3] Change rpclib to a fork version which offers patches The original rpclib have bugs that cause Unreal crashes, sometimes the client also crashes as well. It lacks maintenance for two years, but a fork qchateau/rpclib offers patches. --- build.cmd | 21 +++++++++++---------- build.sh | 5 +++-- cmake/cmake-modules/CommonSetup.cmake | 2 +- setup.sh | 9 +++++---- 4 files changed, 20 insertions(+), 17 deletions(-) diff --git a/build.cmd b/build.cmd index a726e5653a..e808dc51e4 100644 --- a/build.cmd +++ b/build.cmd @@ -46,8 +46,9 @@ if ERRORLEVEL 1 ( ) REM //---------- get rpclib ---------- +set RPC_VERSION=c4fb37acbe67ec99e47e5187acd2a7450bde0cec IF NOT EXIST external\rpclib mkdir external\rpclib -IF NOT EXIST external\rpclib\rpclib-2.2.1 ( +IF NOT EXIST external\rpclib\rpclib-%RPC_VERSION% ( REM //leave some blank lines because powershell shows download banner at top of console ECHO( ECHO( @@ -56,7 +57,7 @@ IF NOT EXIST external\rpclib\rpclib-2.2.1 ( ECHO Downloading rpclib ECHO ***************************************************************************************** @echo on - powershell -command "& { [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; iwr https://github.com/rpclib/rpclib/archive/v2.2.1.zip -OutFile external\rpclib.zip }" + powershell -command "& { [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; iwr https://github.com/qchateau/rpclib/archive/%RPC_VERSION%.zip -OutFile external\rpclib.zip }" @echo off REM //remove any previous versions @@ -67,7 +68,7 @@ IF NOT EXIST external\rpclib\rpclib-2.2.1 ( REM //Don't fail the build if the high-poly car is unable to be downloaded REM //Instead, just notify users that the gokart will be used. - IF NOT EXIST external\rpclib\rpclib-2.2.1 ( + IF NOT EXIST external\rpclib\rpclib-%RPC_VERSION% ( ECHO Unable to download high-polycount SUV. Your AirSim build will use the default vehicle. goto :buildfailed ) @@ -75,8 +76,8 @@ IF NOT EXIST external\rpclib\rpclib-2.2.1 ( REM //---------- Build rpclib ------------ ECHO Starting cmake to build rpclib... -IF NOT EXIST external\rpclib\rpclib-2.2.1\build mkdir external\rpclib\rpclib-2.2.1\build -cd external\rpclib\rpclib-2.2.1\build +IF NOT EXIST external\rpclib\rpclib-%RPC_VERSION%\build mkdir external\rpclib\rpclib-%RPC_VERSION%\build +cd external\rpclib\rpclib-%RPC_VERSION%\build REM cmake -G"Visual Studio 14 2015 Win64" .. cmake -G"Visual Studio 15 2017 Win64" .. @@ -97,15 +98,15 @@ set RPCLIB_TARGET_LIB=AirLib\deps\rpclib\lib\x64 if NOT exist %RPCLIB_TARGET_LIB% mkdir %RPCLIB_TARGET_LIB% set RPCLIB_TARGET_INCLUDE=AirLib\deps\rpclib\include if NOT exist %RPCLIB_TARGET_INCLUDE% mkdir %RPCLIB_TARGET_INCLUDE% -robocopy /MIR external\rpclib\rpclib-2.2.1\include %RPCLIB_TARGET_INCLUDE% +robocopy /MIR external\rpclib\rpclib-%RPC_VERSION%\include %RPCLIB_TARGET_INCLUDE% if "%buildMode%" == "--Debug" ( -robocopy /MIR external\rpclib\rpclib-2.2.1\build\Debug %RPCLIB_TARGET_LIB%\Debug +robocopy /MIR external\rpclib\rpclib-%RPC_VERSION%\build\Debug %RPCLIB_TARGET_LIB%\Debug ) else if "%buildMode%" == "--Release" ( -robocopy /MIR external\rpclib\rpclib-2.2.1\build\Release %RPCLIB_TARGET_LIB%\Release +robocopy /MIR external\rpclib\rpclib-%RPC_VERSION%\build\Release %RPCLIB_TARGET_LIB%\Release ) else ( -robocopy /MIR external\rpclib\rpclib-2.2.1\build\Debug %RPCLIB_TARGET_LIB%\Debug -robocopy /MIR external\rpclib\rpclib-2.2.1\build\Release %RPCLIB_TARGET_LIB%\Release +robocopy /MIR external\rpclib\rpclib-%RPC_VERSION%\build\Debug %RPCLIB_TARGET_LIB%\Debug +robocopy /MIR external\rpclib\rpclib-%RPC_VERSION%\build\Release %RPCLIB_TARGET_LIB%\Release ) REM //---------- get High PolyCount SUV Car Model ------------ diff --git a/build.sh b/build.sh index 94aa1b3e6e..0eed49d5d1 100755 --- a/build.sh +++ b/build.sh @@ -25,7 +25,8 @@ esac done # check for rpclib -if [ ! -d "./external/rpclib/rpclib-2.2.1" ]; then +RPC_VERSION=c4fb37acbe67ec99e47e5187acd2a7450bde0cec +if [ ! -d "./external/rpclib/rpclib-${RPC_VERSION}" ]; then echo "ERROR: new version of AirSim requires newer rpclib." echo "please run setup.sh first and then run build.sh again." exit 1 @@ -133,7 +134,7 @@ cp $build_dir/output/lib/librpc.a AirLib/deps/rpclib/lib/librpc.a # Update AirLib/lib, AirLib/deps, Plugins folders with new binaries rsync -a --delete $build_dir/output/lib/ AirLib/lib/x64/Debug -rsync -a --delete external/rpclib/rpclib-2.2.1/include AirLib/deps/rpclib +rsync -a --delete external/rpclib/rpclib-${RPC_VERSION}/include AirLib/deps/rpclib rsync -a --delete MavLinkCom/include AirLib/deps/MavLinkCom rsync -a --delete AirLib Unreal/Plugins/AirSim/Source diff --git a/cmake/cmake-modules/CommonSetup.cmake b/cmake/cmake-modules/CommonSetup.cmake index 5be848353d..6399858117 100644 --- a/cmake/cmake-modules/CommonSetup.cmake +++ b/cmake/cmake-modules/CommonSetup.cmake @@ -41,7 +41,7 @@ macro(CommonSetup) SET(LIBCXX_LIB_PATH ${AIRSIM_ROOT}/llvm-build/output/lib) #setup include and lib for rpclib which will be referenced by other projects - set(RPCLIB_VERSION_FOLDER rpclib-2.2.1) + set(RPCLIB_VERSION_FOLDER rpclib-c4fb37acbe67ec99e47e5187acd2a7450bde0cec) set(RPC_LIB_INCLUDES " ${AIRSIM_ROOT}/external/rpclib/${RPCLIB_VERSION_FOLDER}/include") #name of .a file with lib prefix set(RPC_LIB rpc) diff --git a/setup.sh b/setup.sh index 123318a954..73cae4ffa8 100755 --- a/setup.sh +++ b/setup.sh @@ -136,19 +136,20 @@ else #linux fi # Download rpclib -if [ ! -d "external/rpclib/rpclib-2.2.1" ]; then +RPC_VERSION=c4fb37acbe67ec99e47e5187acd2a7450bde0cec +if [ ! -d "external/rpclib/rpclib-${RPC_VERSION}" ]; then echo "*********************************************************************************************" echo "Downloading rpclib..." echo "*********************************************************************************************" - wget https://github.com/rpclib/rpclib/archive/v2.2.1.zip + wget https://github.com/qchateau/rpclib/archive/${RPC_VERSION}.zip -O rpclib.zip # remove previous versions rm -rf "external/rpclib" mkdir -p "external/rpclib" - unzip v2.2.1.zip -d external/rpclib - rm v2.2.1.zip + unzip rpclib.zip -d external/rpclib + rm rpclib.zip fi # Download high-polycount SUV model From 6c803ffd33599c845c1cf9feba06390a38bd9d7a Mon Sep 17 00:00:00 2001 From: Rajat Singhal Date: Mon, 6 Jan 2020 16:27:38 +0530 Subject: [PATCH 2/3] Unity updates for changing to RPC fork --- Unity/AirLibWrapper/AirsimWrapper/cmake/rpc-setup.cmake | 2 +- Unity/build.sh | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Unity/AirLibWrapper/AirsimWrapper/cmake/rpc-setup.cmake b/Unity/AirLibWrapper/AirsimWrapper/cmake/rpc-setup.cmake index 82b7daf19f..a2d1df8e15 100644 --- a/Unity/AirLibWrapper/AirsimWrapper/cmake/rpc-setup.cmake +++ b/Unity/AirLibWrapper/AirsimWrapper/cmake/rpc-setup.cmake @@ -1,7 +1,7 @@ macro(BuildRpc) -set(RPC_SOURCE_DIR ${AIRSIM_ROOT}/external/rpclib/rpclib-2.2.1) +set(RPC_SOURCE_DIR ${AIRSIM_ROOT}/external/rpclib/rpclib-c4fb37acbe67ec99e47e5187acd2a7450bde0cec) include(${RPC_SOURCE_DIR}/cmake/policies.cmake) include(${RPC_SOURCE_DIR}/cmake/msvc_support.cmake) include(${RPC_SOURCE_DIR}/cmake/coverage.cmake) diff --git a/Unity/build.sh b/Unity/build.sh index 0418d37a0b..c82fe0c9ec 100755 --- a/Unity/build.sh +++ b/Unity/build.sh @@ -1,4 +1,5 @@ -if [ ! -f ../external/rpclib/rpclib-2.2.1/rpclib.pc.in ]; then +RPC_VERSION=c4fb37acbe67ec99e47e5187acd2a7450bde0cec +if [ ! -f ../external/rpclib/rpclib-{RPC_VERSION}/rpclib.pc.in ]; then >&2 echo "error, rpc.pc.in not found" fi cp ../external/rpclib/rpclib-2.2.1/rpclib.pc.in AirLibWrapper/AirsimWrapper/rpclib.pc.in From bff70176824366f0e691720f0015a77960a505d5 Mon Sep 17 00:00:00 2001 From: madratman Date: Fri, 24 Jul 2020 01:38:41 -0700 Subject: [PATCH 3/3] simplify PR: qchateau->madratman; revert commithash->2.2.1 --- .../AirsimWrapper/cmake/rpc-setup.cmake | 2 +- Unity/build.sh | 3 +-- build.cmd | 21 +++++++++---------- build.sh | 5 ++--- cmake/cmake-modules/CommonSetup.cmake | 2 +- setup.sh | 5 ++--- 6 files changed, 17 insertions(+), 21 deletions(-) diff --git a/Unity/AirLibWrapper/AirsimWrapper/cmake/rpc-setup.cmake b/Unity/AirLibWrapper/AirsimWrapper/cmake/rpc-setup.cmake index 2f4cb5483c..b637eab622 100644 --- a/Unity/AirLibWrapper/AirsimWrapper/cmake/rpc-setup.cmake +++ b/Unity/AirLibWrapper/AirsimWrapper/cmake/rpc-setup.cmake @@ -1,7 +1,7 @@ macro(BuildRpc) -set(RPC_SOURCE_DIR ${AIRSIM_ROOT}/external/rpclib/rpclib-c4fb37acbe67ec99e47e5187acd2a7450bde0cec) +set(RPC_SOURCE_DIR ${AIRSIM_ROOT}/external/rpclib/rpclib-2.2.1) include(${RPC_SOURCE_DIR}/cmake/policies.cmake) include(${RPC_SOURCE_DIR}/cmake/msvc_support.cmake) include(${RPC_SOURCE_DIR}/cmake/coverage.cmake) diff --git a/Unity/build.sh b/Unity/build.sh index 7512f2c419..7392027669 100755 --- a/Unity/build.sh +++ b/Unity/build.sh @@ -4,8 +4,7 @@ set -x set -e # check for rpclib -RPC_VERSION=c4fb37acbe67ec99e47e5187acd2a7450bde0cec -if [ ! -f ../external/rpclib/rpclib-{RPC_VERSION}/rpclib.pc.in ]; then +if [ ! -f ../external/rpclib/rpclib-2.2.1/rpclib.pc.in ]; then >&2 echo "error, rpc.pc.in not found, please run setup.sh first and then run build.sh again" fi diff --git a/build.cmd b/build.cmd index ef65e935b6..43a28c7e45 100644 --- a/build.cmd +++ b/build.cmd @@ -46,9 +46,8 @@ if ERRORLEVEL 1 ( ) REM //---------- get rpclib ---------- -set RPC_VERSION=c4fb37acbe67ec99e47e5187acd2a7450bde0cec IF NOT EXIST external\rpclib mkdir external\rpclib -IF NOT EXIST external\rpclib\rpclib-%RPC_VERSION% ( +IF NOT EXIST external\rpclib\rpclib-2.2.1 ( REM //leave some blank lines because powershell shows download banner at top of console ECHO( ECHO( @@ -57,7 +56,7 @@ IF NOT EXIST external\rpclib\rpclib-%RPC_VERSION% ( ECHO Downloading rpclib ECHO ***************************************************************************************** @echo on - powershell -command "& { [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; iwr https://github.com/qchateau/rpclib/archive/%RPC_VERSION%.zip -OutFile external\rpclib.zip }" + powershell -command "& { [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; iwr https://github.com/madratman/rpclib/archive/v2.2.1.zip -OutFile external\rpclib.zip }" @echo off REM //remove any previous versions @@ -68,7 +67,7 @@ IF NOT EXIST external\rpclib\rpclib-%RPC_VERSION% ( REM //Don't fail the build if the high-poly car is unable to be downloaded REM //Instead, just notify users that the gokart will be used. - IF NOT EXIST external\rpclib\rpclib-%RPC_VERSION% ( + IF NOT EXIST external\rpclib\rpclib-2.2.1 ( ECHO Unable to download high-polycount SUV. Your AirSim build will use the default vehicle. goto :buildfailed ) @@ -76,8 +75,8 @@ IF NOT EXIST external\rpclib\rpclib-%RPC_VERSION% ( REM //---------- Build rpclib ------------ ECHO Starting cmake to build rpclib... -IF NOT EXIST external\rpclib\rpclib-%RPC_VERSION%\build mkdir external\rpclib\rpclib-%RPC_VERSION%\build -cd external\rpclib\rpclib-%RPC_VERSION%\build +IF NOT EXIST external\rpclib\rpclib-2.2.1\build mkdir external\rpclib\rpclib-2.2.1\build +cd external\rpclib\rpclib-2.2.1\build REM cmake -G"Visual Studio 14 2015 Win64" .. cmake -G"Visual Studio 16 2019" .. @@ -98,15 +97,15 @@ set RPCLIB_TARGET_LIB=AirLib\deps\rpclib\lib\x64 if NOT exist %RPCLIB_TARGET_LIB% mkdir %RPCLIB_TARGET_LIB% set RPCLIB_TARGET_INCLUDE=AirLib\deps\rpclib\include if NOT exist %RPCLIB_TARGET_INCLUDE% mkdir %RPCLIB_TARGET_INCLUDE% -robocopy /MIR external\rpclib\rpclib-%RPC_VERSION%\include %RPCLIB_TARGET_INCLUDE% +robocopy /MIR external\rpclib\rpclib-2.2.1\include %RPCLIB_TARGET_INCLUDE% if "%buildMode%" == "--Debug" ( -robocopy /MIR external\rpclib\rpclib-%RPC_VERSION%\build\Debug %RPCLIB_TARGET_LIB%\Debug +robocopy /MIR external\rpclib\rpclib-2.2.1\build\Debug %RPCLIB_TARGET_LIB%\Debug ) else if "%buildMode%" == "--Release" ( -robocopy /MIR external\rpclib\rpclib-%RPC_VERSION%\build\Release %RPCLIB_TARGET_LIB%\Release +robocopy /MIR external\rpclib\rpclib-2.2.1\build\Release %RPCLIB_TARGET_LIB%\Release ) else ( -robocopy /MIR external\rpclib\rpclib-%RPC_VERSION%\build\Debug %RPCLIB_TARGET_LIB%\Debug -robocopy /MIR external\rpclib\rpclib-%RPC_VERSION%\build\Release %RPCLIB_TARGET_LIB%\Release +robocopy /MIR external\rpclib\rpclib-2.2.1\build\Debug %RPCLIB_TARGET_LIB%\Debug +robocopy /MIR external\rpclib\rpclib-2.2.1\build\Release %RPCLIB_TARGET_LIB%\Release ) REM //---------- get High PolyCount SUV Car Model ------------ diff --git a/build.sh b/build.sh index c298a6c171..952b739657 100755 --- a/build.sh +++ b/build.sh @@ -10,8 +10,7 @@ set -x function version_less_than_equal_to() { test "$(printf '%s\n' "$@" | sort -V | head -n 1)" = "$1"; } # check for rpclib -RPC_VERSION=c4fb37acbe67ec99e47e5187acd2a7450bde0cec -if [ ! -d "./external/rpclib/rpclib-${RPC_VERSION}" ]; then +if [ ! -d "./external/rpclib/rpclib-2.2.1" ]; then echo "ERROR: new version of AirSim requires newer rpclib." echo "please run setup.sh first and then run build.sh again." exit 1 @@ -79,7 +78,7 @@ cp $build_dir/output/lib/librpc.a AirLib/deps/rpclib/lib/librpc.a # Update AirLib/lib, AirLib/deps, Plugins folders with new binaries rsync -a --delete $build_dir/output/lib/ AirLib/lib/x64/Debug -rsync -a --delete external/rpclib/rpclib-${RPC_VERSION}/include AirLib/deps/rpclib +rsync -a --delete external/rpclib/rpclib-2.2.1/include AirLib/deps/rpclib rsync -a --delete MavLinkCom/include AirLib/deps/MavLinkCom rsync -a --delete AirLib Unreal/Plugins/AirSim/Source diff --git a/cmake/cmake-modules/CommonSetup.cmake b/cmake/cmake-modules/CommonSetup.cmake index a2b029d5d5..ff67145760 100644 --- a/cmake/cmake-modules/CommonSetup.cmake +++ b/cmake/cmake-modules/CommonSetup.cmake @@ -37,7 +37,7 @@ macro(CommonSetup) SET(LIBRARY_OUTPUT_PATH ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}) #setup include and lib for rpclib which will be referenced by other projects - set(RPCLIB_VERSION_FOLDER rpclib-c4fb37acbe67ec99e47e5187acd2a7450bde0cec) + set(RPCLIB_VERSION_FOLDER rpclib-2.2.1) set(RPC_LIB_INCLUDES " ${AIRSIM_ROOT}/external/rpclib/${RPCLIB_VERSION_FOLDER}/include") #name of .a file with lib prefix set(RPC_LIB rpc) diff --git a/setup.sh b/setup.sh index a9dccecdf1..6142975992 100755 --- a/setup.sh +++ b/setup.sh @@ -119,13 +119,12 @@ fi # End USB setup, CMake install # Download rpclib -RPC_VERSION=c4fb37acbe67ec99e47e5187acd2a7450bde0cec -if [ ! -d "external/rpclib/rpclib-${RPC_VERSION}" ]; then +if [ ! -d "external/rpclib/rpclib-2.2.1" ]; then echo "*********************************************************************************************" echo "Downloading rpclib..." echo "*********************************************************************************************" - wget https://github.com/qchateau/rpclib/archive/${RPC_VERSION}.zip -O rpclib.zip + wget https://github.com/madratman/rpclib/archive/v2.2.1.zip # remove previous versions rm -rf "external/rpclib"