Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[colosseum] AirSim File to patch error #264

Closed
kanishkanarch opened this issue Feb 15, 2024 · 2 comments
Closed

[colosseum] AirSim File to patch error #264

kanishkanarch opened this issue Feb 15, 2024 · 2 comments

Comments

@kanishkanarch
Copy link

kanishkanarch commented Feb 15, 2024

What's not working

Upon trying to install it locally using the makepkg -si command, it asks for the "File to patch" multiple times, but there's only one patch file CMakeLists.patch. The diffs with the patch mention AirSim 1.3.1, but the latest PKGBUILD installs AirSim 1.7.0, leading to following errors.

image

What I tried

I edited the patch file to have the diffs mention AirSim version 1.7.0, and modified the patch file's sha256sum in the PKGBUILD accordingly, but the build is still failing, as shown below:

image

Error logs and relevant files

The error says that 1 out of 2 hunks failed, and it saves the rejects into the following file (src/AirSim-1.7.0-linux/cmake/cmake-modules/CommonSetup.cmake.rej):

Reject log file

--- AirSim-1.7.0-linux/cmake/cmake-modules/CommonSetup.cmake    2020-04-08 19:40:08.000000000 -0400
+++ AirSim-1.7.0-linux.new/cmake/cmake-modules/CommonSetup.cmake        2020-05-22 20:15:43.882542971 -0400
@@ -54,11 +55,12 @@
             set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wstrict-aliasing -D__CLANG__")
         else ()
             set(CMAKE_CXX_FLAGS "\
-                -std=c++17 -stdlib=libc++ -ggdb -Wall -Wextra -Wstrict-aliasing -Wunreachable-code -Wcast-qual -Wctor-dtor-privacy \
+                -std=c++17 -ggdb -Wall -Wextra -Wstrict-aliasing -Wunreachable-code -Wcast-qual -Wctor-dtor-privacy \
                 -Wdisabled-optimization -Wformat=2 -Winit-self -Wmissing-include-dirs -Wswitch-default \
                 -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wshadow -Wstrict-overflow=5 -Wswitch-default -Wundef \
                 -Wno-variadic-macros -Wno-parentheses -Wno-unused-function -Wno-unused -Wno-documentation -fdiagnostics-show-option \
                 -pthread \
+                -fpermissive \
                 ${RPC_LIB_DEFINES} ${CMAKE_CXX_FLAGS}")
 
             if (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")

What else can be done to get both the "hunks" successful?

CMakeLists.patch (edited to include AirSim version 1.7.0 instead of 1.3.1)

diff --unified --recursive --text AirSim-1.7.0-linux/cmake/AirLib/CMakeLists.txt AirSim-1.7.0-linux.new/cmake/AirLib/CMakeLists.txt
--- AirSim-1.7.0-linux/cmake/AirLib/CMakeLists.txt      2020-04-08 19:40:08.000000000 -0400
+++ AirSim-1.7.0-linux.new/cmake/AirLib/CMakeLists.txt  2020-05-22 20:14:03.895721024 -0400
@@ -28,6 +28,7 @@
 CommonTargetLink()
 target_link_libraries(${PROJECT_NAME} ${RPC_LIB})
 target_link_libraries(${PROJECT_NAME} MavLinkCom)
+target_link_libraries(${PROJECT_NAME} Eigen3::Eigen)
 
 #string(SUBSTRING ${CMAKE_STATIC_LINKER_FLAGS} 9 -1 "BUILD_PLATFORM")
 #find_package(Threads REQUIRED)
diff --unified --recursive --text AirSim-1.7.0-linux/cmake/CMakeLists.txt AirSim-1.7.0-linux.new/cmake/CMakeLists.txt
--- AirSim-1.7.0-linux/cmake/CMakeLists.txt     2020-04-08 19:40:08.000000000 -0400
+++ AirSim-1.7.0-linux.new/cmake/CMakeLists.txt 2020-05-22 20:14:28.538801669 -0400
@@ -1,10 +1,8 @@
 cmake_minimum_required(VERSION 3.5.0)
 project(AirSim)
 
-add_subdirectory("rpclib_wrapper")
 add_subdirectory("AirLib")
 add_subdirectory("MavLinkCom")
-add_subdirectory("AirLibUnitTests")
 add_subdirectory("HelloDrone")
 add_subdirectory("HelloCar")
 add_subdirectory("DroneShell")
diff --unified --recursive --text AirSim-1.7.0-linux/cmake/cmake-modules/CommonSetup.cmake AirSim-1.7.0-linux.new/cmake/cmake-modules/CommonSetup.cmake
--- AirSim-1.7.0-linux/cmake/cmake-modules/CommonSetup.cmake    2020-04-08 19:40:08.000000000 -0400
+++ AirSim-1.7.0-linux.new/cmake/cmake-modules/CommonSetup.cmake        2020-05-22 20:15:43.882542971 -0400
@@ -6,7 +6,8 @@
 endmacro(CommonTargetLink)
 
 macro(IncludeEigen)
-    include_directories(${AIRSIM_ROOT}/AirLib/deps/eigen3)
+    find_package(Eigen3 REQUIRED)
+    include_directories(${Eigen_INCLUDE_DIRS})
 endmacro(IncludeEigen)
 
 macro(AddExecutableSource)
@@ -53,11 +54,12 @@
             set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wstrict-aliasing -D__CLANG__")
         else ()
             set(CMAKE_CXX_FLAGS "\
-                -std=c++17 -stdlib=libc++ -ggdb -Wall -Wextra -Wstrict-aliasing -Wunreachable-code -Wcast-qual -Wctor-dtor-privacy \
+                -std=c++17 -ggdb -Wall -Wextra -Wstrict-aliasing -Wunreachable-code -Wcast-qual -Wctor-dtor-privacy \
                 -Wdisabled-optimization -Wformat=2 -Winit-self -Wmissing-include-dirs -Wswitch-default \
                 -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wshadow -Wstrict-overflow=5 -Wswitch-default -Wundef \
                 -Wno-variadic-macros -Wno-parentheses -Wno-unused-function -Wno-unused -Wno-documentation -fdiagnostics-show-option \
                 -pthread \
+                -fpermissive \
                 ${RPC_LIB_DEFINES} ${CMAKE_CXX_FLAGS}")
 
             if (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")

PKGBUILD (edited with modified sha256sum of edited CMakeLists.patch)

# Maintainer: acxz <akashpatel2008 at yahoo dot com>
pkgname=airsim
pkgver=1.7.0
pkgrel=1
pkgdesc="Open source simulator for autonomous vehicles built on Unreal Engine /
Unity, from Microsoft AI & Research"
url="https://microsoft.github.io/AirSim"
arch=(x86_64)
license=('MIT')
depends=(unreal-engine rpclib eigen)
makedepends=(cmake gcc)
_pkgname=AirSim
source=("${pkgname}-${pkgver}::https://github.com/microsoft/AirSim/archive/v$pkgver-linux.tar.gz"
        "CMakeLists.patch")
sha256sums=("77d9b9eb771883222bedd611fe52ccbef074bbb8f5fd91fd2b55388ea10647a8"
            "d3980f416f24c4422bfcaccbbad7080abea01dc42997327633da4a0e953e614b")

prepare() {
    patch -s -p0 < CMakeLists.patch
}

build() {
  mkdir -p "$srcdir/${_pkgname}-${pkgver}-linux/cmake/build"
  cd "$srcdir/${_pkgname}-${pkgver}-linux/cmake/build"
  cmake -DCMAKE_INSTALL_PREFIX="$pkgdir/opt" ..
  make
}

package() {
  cd "$srcdir/${_pkgname}-${pkgver}-linux/cmake/build"

  msg "Installing files"

  # AirLib
  mkdir -p ${pkgdir}/opt/airsim/AirLib/lib/x64/Release
  cp output/lib/libAirLib.a ${pkgdir}/opt/airsim/AirLib/lib
  cp -r output/lib/ ${pkgdir}/opt/airsim/AirLib/lib/x64/Release

  # MavLinkCom
  mkdir -p ${pkgdir}/opt/airsim/AirLib/deps/MavLinkCom/lib
  cp output/lib/libMavLinkCom.a ${pkgdir}/opt/airsim/AirLib/deps/MavLinkCom/lib
  cp -r ../../MavLinkCom/include ${pkgdir}/opt/airsim/AirLib/deps/MavLinkCom

  # Unreal
  mkdir -p ${pkgdir}/opt/airsim/Unreal/Plugins/AirSim/Source
  cp -r ../../AirLib ${pkgdir}/opt/airsim/Unreal/Plugins/AirSim/Source
  mkdir -p ${pkgdir}/opt/airsim/Unreal/Environments/Blocks/Plugins
  cp -r ../../Unreal/Plugins/AirSim ${pkgdir}/opt/airsim/Unreal/Environments/Blocks/Plugins
}

@acxz acxz changed the title AirSim File to patch error [colosseum] AirSim File to patch error Jul 20, 2024
@acxz
Copy link
Owner

acxz commented Jul 20, 2024

@kanishkanarch airsim has stopped development and will soon be archived: https://github.com/microsoft/AirSim?tab=readme-ov-file#airsim-announcement-this-repository-will-be-archived-in-the-coming-year

colosseum (upstream) is now the new package that continues the development where airsim stopped. As such I have changed the title to reflect that.

@acxz
Copy link
Owner

acxz commented Jul 20, 2024

Thanks for the attempt at trying to resolve the issue, @kanishkanarch!

However, note that the error is already reported in another issue (#174). Please check other issues before posting a new duplicate one. As such I'm closing this issue as duplicate.

Also issue reporting tip: for bug reporting in any forum, whether it be github or discourse, always use text and codeblocks instead of images. People can ctrl-f through text, but not through images.

@acxz acxz closed this as not planned Won't fix, can't repro, duplicate, stale Jul 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants