MAVSDK
MAVSDK copied to clipboard
Building MAVSDK for Android failing (Apple Silicon M2 Max)
Environment
-
Apple M2 Max Macbook Pro
-
64 GB RAM
-
Mac OS Ventura
-
Docker Desktop 4.28.0
Problem
I cloned the MAVSDK repo on the main branch, and tried to run the configuration step following the documentation to use dockcross.
However, it fails every single time when it tries to build OpenSSL,
-- extracting...
src='/work/build/default/third_party/openssl/openssl/src/openssl-3.0.9.tar.gz'
dst='/work/build/default/third_party/openssl/openssl/src/openssl'
-- extracting... [tar xfz]
-- extracting... [analysis]
-- extracting... [rename]
-- extracting... [clean up]
-- extracting... done
[ 37%] No update step for 'openssl'
[ 50%] Performing patch step for 'openssl'
patching file Configurations/15-android.conf
Hunk #1 succeeded at 130 (offset 18 lines).
[ 62%] Performing configure step for 'openssl'
Configuring OpenSSL version 3.0.9 for target android-arm64
Using os-specific seed configuration
Created configdata.pm
Running configdata.pm
Created Makefile.in
Created Makefile
Created include/openssl/configuration.h
**********************************************************************
*** ***
*** OpenSSL has been successfully configured ***
*** ***
*** If you encounter a problem while building, please open an ***
*** issue on GitHub <https://github.com/openssl/openssl/issues> ***
*** and include the output from the following command: ***
*** ***
*** perl configdata.pm --dump ***
*** ***
*** (If you are new to OpenSSL, you might want to consult the ***
*** 'Troubleshooting' section in the INSTALL.md file first) ***
*** ***
**********************************************************************
[ 75%] Performing build step for 'openssl'
make[3]: *** write jobserver: Bad file descriptor. Stop.
make[3]: *** Waiting for unfinished jobs....
make[3]: *** write jobserver: Bad file descriptor. Stop.
gmake[2]: *** [CMakeFiles/openssl.dir/build.make:86: openssl/src/openssl-stamp/openssl-build] Error 2
gmake[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/openssl.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2
CMake Error at third_party/cmake/build_target.cmake:51 (message):
/work/build/default/third_party/openssl failed to build!
Call Stack (most recent call first):
third_party/CMakeLists.txt:23 (build_target)
-- Configuring incomplete, errors occurred!
The command being used to configure the build is
~/dockcross-android-arm64 cmake -DCMAKE_BUILD_TYPE=Debug -Bbuild/default -DBUILD_MAVSDK_SERVER=ON -DBUILD_SHARED_LIBS=ON -H.
The end goal is to make modifications to MAVSDK C++ and bring it into the Android projects (mavsdk_server.aar and mavsdk-java.jar)
It is interesting that the build happening inside a docker container fails on the M2 :thinking:.
Do you know why that would be? What is this "Bad file descriptor"?
The end goal is to make modifications to MAVSDK C++ and bring it into the Android projects (mavsdk_server.aar and mavsdk-java.jar)
What is the difference between these two? I hope I can further understand and learn.
It is interesting that the build happening inside a docker container fails on the M2 🤔.
Do you know why that would be? What is this "Bad file descriptor"?
I have no idea. Hence, reaching out to the experts for help 😁
What is the difference between these two? I hope I can further understand and learn.
@Jai-GAY
MAVSDK-Java is a wrapper interface that talks to the 'MAVSDK-server' using generated protobuf interfaces. The 'Server' contains a pre-built .so binary of MAVSDK C++, in this case, targets Android.
Just having the Java wrapper and Server isn't enough, if you are looking to make modifications because the meat underneath is actually within the MAVSDK C++ project.
It seems like openssl fails to build with dockcross on the M2. I would try to remove MAVSDK from the equation and just build OpenSSL first. Then see if that fails or not, and go from there.
This is where we build openssl, you could start from there.
if you are looking to make modifications because the meat underneath is actually within the MAVSDK C++ project.
okay, so as an open-source spirit, isn't it a pull request, submit?
FYI: https://github.com/openssl/openssl/issues/23845
@rayw-dronesense are you still looking into this?
OP disappeared, not sure what I should do, closing.