conan-io/conan-docker-tools

add cross-build example to "Use the images locally" section

AndreyMlashkin opened this issue · 6 comments

Description of Problem, Request, or Question

Environment Details

  • Conan Docker Tools image: conanio/android-clangx-xxx
  • Operating System: Linux

I would kindly ask you to add an example of cross-building for the following images:
conanio/android-clang8
conanio/android-clang8-x86
conanio/android-clang8-armv7
conanio/android-clang8-armv8

to the section "Use the images locally"
It would be cool, if image itself already have host and target profiles inside

Please, consider reading https://github.com/conan-io/conan-docker-tools#legacy-and-modern-folders

Those images are deprecated now and are no longer officially supported.

If you wish to invest time creating examples and providing a PR, please, fell free.

The images are marked as supported... could you please at least mark them deprecated then, please?
I am already preparing android images for me.

Yes, I gonna update the markdown. Thanks

I have started my experimental Dockerfile now:
https://github.com/AndreyMlashkin/docker-android-conan

I see, that conan client has a problem detecting clang compiler, even if it is explicitly overridden by environment:

Step 7/7 : RUN conan install zlib/1.2.12@ --build missing -pr:h android-armv8-debug -pr:b default --build missing
---> Running in 838b4055879f
WARN: Remotes registry file missing, creating default one in /root/.conan/remotes.json
Configuration (profile_host):
[settings]
arch=armv8
build_type=Release
compiler=clang
compiler.libcxx=libc++
compiler.version=14
os=Android
os.api_level=23
[options]
[build_requires]
*: android-ndk/r23b
[env]
CC=/usr/bin/clang-14
CXX=/usr/bin/clang++-14

Configuration (profile_build):
[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=clang
compiler.libcxx=libstdc++
compiler.version=14
os=Linux
os_build=Linux
[options]
[build_requires]
[env]
CC=/usr/bin/clang-14
CXX=/usr/bin/clang++-14

zlib/1.2.12: Not found in local cache, looking in remotes...
zlib/1.2.12: Trying with 'conancenter'...
Downloading conanmanifest.txt
Downloading conanfile.py
Downloading conan_export.tgz
zlib/1.2.12: Downloaded recipe revision 0
android-ndk/r23b: Not found in local cache, looking in remotes...
android-ndk/r23b: Trying with 'conancenter'...
Downloading conanmanifest.txt
Downloading conanfile.py
Downloading conan_export.tgz
android-ndk/r23b: Downloaded recipe revision 0
Installing package: zlib/1.2.12
Requirements
zlib/1.2.12 from 'conancenter' - Downloaded
Packages
zlib/1.2.12:327d246178158e885353817414d62742190d9b88 - Build
Build requirements
android-ndk/r23b from 'conancenter' - Downloaded
Build requirements packages
android-ndk/r23b:4db1be536558d833e52e862fd84d64d75c2b3656 - Download

Cross-build from 'Linux:x86_64' to 'Android:armv8'
Installing (downloading, building) binaries...
android-ndk/r23b: Retrieving package 4db1be536558d833e52e862fd84d64d75c2b3656 from remote 'conancenter'
Downloading conanmanifest.txt
Downloading conaninfo.txt
Downloading conan_package.tgz
..android-ndk/r23b: Package installed 4db1be536558d833e52e862fd84d64d75c2b3656
android-ndk/r23b: Downloaded package revision 0
android-ndk/r23b: Creating ANDROID_NDK_ROOT environment variable: /root/.conan/data/android-ndk/r23b///package/4db1be536558d833e52e862fd84d64d75c2b3656
android-ndk/r23b: Creating ANDROID_NDK_HOME environment variable: /root/.conan/data/android-ndk/r23b///package/4db1be536558d833e52e862fd84d64d75c2b3656
android-ndk/r23b: Creating CONAN_CMAKE_SYSTEM_PROCESSOR environment variable: aarch64
android-ndk/r23b: Creating NDK_ROOT environment variable: /root/.conan/data/android-ndk/r23b///package/4db1be536558d833e52e862fd84d64d75c2b3656/toolchains/llvm/prebuilt/linux-x86_64
android-ndk/r23b: Creating CHOST environment variable: aarch64-linux-android
android-ndk/r23b: Creating CONAN_CMAKE_FIND_ROOT_PATH environment variable: /root/.conan/data/android-ndk/r23b///package/4db1be536558d833e52e862fd84d64d75c2b3656/toolchains/llvm/prebuilt/linux-x86_64/sysroot
android-ndk/r23b: Creating SYSROOT environment variable: /root/.conan/data/android-ndk/r23b///package/4db1be536558d833e52e862fd84d64d75c2b3656/toolchains/llvm/prebuilt/linux-x86_64/sysroot
android-ndk/r23b: Creating self.cpp_info.sysroot: /root/.conan/data/android-ndk/r23b///package/4db1be536558d833e52e862fd84d64d75c2b3656/toolchains/llvm/prebuilt/linux-x86_64/sysroot
android-ndk/r23b: Creating ANDROID_NATIVE_API_LEVEL environment variable: 23
android-ndk/r23b: Creating CONAN_CMAKE_PROGRAM environment variable: /root/.conan/data/android-ndk/r23b///package/4db1be536558d833e52e862fd84d64d75c2b3656/cmake-wrapper
android-ndk/r23b: Creating CONAN_CMAKE_TOOLCHAIN_FILE environment variable: /root/.conan/data/android-ndk/r23b///package/4db1be536558d833e52e862fd84d64d75c2b3656/build/cmake/android.toolchain.cmake
android-ndk/r23b: Creating CC environment variable: /root/.conan/data/android-ndk/r23b///package/4db1be536558d833e52e862fd84d64d75c2b3656/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android23-clang
android-ndk/r23b: Creating CXX environment variable: /root/.conan/data/android-ndk/r23b///package/4db1be536558d833e52e862fd84d64d75c2b3656/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android23-clang++
android-ndk/r23b: Creating AR environment variable: /root/.conan/data/android-ndk/r23b///package/4db1be536558d833e52e862fd84d64d75c2b3656/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar
android-ndk/r23b: Creating AS environment variable: /root/.conan/data/android-ndk/r23b///package/4db1be536558d833e52e862fd84d64d75c2b3656/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-as
android-ndk/r23b: Creating RANLIB environment variable: /root/.conan/data/android-ndk/r23b///package/4db1be536558d833e52e862fd84d64d75c2b3656/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ranlib
android-ndk/r23b: Creating STRIP environment variable: /root/.conan/data/android-ndk/r23b///package/4db1be536558d833e52e862fd84d64d75c2b3656/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip
android-ndk/r23b: Creating ADDR2LINE environment variable: /root/.conan/data/android-ndk/r23b///package/4db1be536558d833e52e862fd84d64d75c2b3656/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-addr2line
android-ndk/r23b: Creating NM environment variable: /root/.conan/data/android-ndk/r23b///package/4db1be536558d833e52e862fd84d64d75c2b3656/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-nm
android-ndk/r23b: Creating OBJCOPY environment variable: /root/.conan/data/android-ndk/r23b///package/4db1be536558d833e52e862fd84d64d75c2b3656/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-objcopy
android-ndk/r23b: Creating OBJDUMP environment variable: /root/.conan/data/android-ndk/r23b///package/4db1be536558d833e52e862fd84d64d75c2b3656/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-objdump
android-ndk/r23b: Creating READELF environment variable: /root/.conan/data/android-ndk/r23b///package/4db1be536558d833e52e862fd84d64d75c2b3656/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-readelf
android-ndk/r23b: Creating LD environment variable: /root/.conan/data/android-ndk/r23b///package/4db1be536558d833e52e862fd84d64d75c2b3656/toolchains/llvm/prebuilt/linux-x86_64/bin/ld
zlib/1.2.12: Applying build-requirement: android-ndk/r23b
Downloading conan_sources.tgz
zlib/1.2.12: Configuring sources in /root/.conan/data/zlib/1.2.12///source

zlib/1.2.12: Copying sources to build folder
zlib/1.2.12: Building your package in /root/.conan/data/zlib/1.2.12///build/327d246178158e885353817414d62742190d9b88
zlib/1.2.12: Generator cmake created conanbuildinfo.cmake
zlib/1.2.12: Aggregating env generators
zlib/1.2.12: Calling build()
Calling CMake via Android-NDK wrapper
-- Android: Targeting API '23' with architecture 'arm64', ABI 'arm64-v8a', and processor 'aarch64'
-- Android: Selected unified Clang toolchain
-- The C compiler identification is Clang 12.0.8
-- The CXX compiler identification is Clang 12.0.8
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /root/.conan/data/android-ndk/r23b///package/4db1be536558d833e52e862fd84d64d75c2b3656/toolchains/llvm/prebuilt/linux-x86_64/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /root/.conan/data/android-ndk/r23b///package/4db1be536558d833e52e862fd84d64d75c2b3656/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Conan: called by CMake conan helper
-- Conan: called inside local cache
-- Conan: Adjusting output directories
-- Conan: Using cmake global configuration
-- Conan: Adjusting language standard
-- Conan: Adjusting fPIC flag (ON)
-- Conan: Compiler Clang>=8, checking major version 14
-- Conan: Checking correct version: 12
CMake Error at conanbuildinfo.cmake:402 (message):
Detected a mismatch for the compiler version between your conan profile
settings and CMake:

Compiler version specified in your conan profile: 14

Compiler version detected in CMake: 12.0

Please check your conan profile settings (conan profile show
[default|your_profile_name])

P.S. You may set CONAN_DISABLE_CHECK_COMPILER CMake variable in order to
disable this check.
Call Stack (most recent call first):
conanbuildinfo.cmake:501 (conan_error_compiler_version)
conanbuildinfo.cmake:593 (check_compiler_version)
conanbuildinfo.cmake:141 (conan_check_compiler)
CMakeLists.txt:5 (conan_basic_setup)

-- Configuring incomplete, errors occurred!
See also "/root/.conan/data/zlib/1.2.12///build/327d246178158e885353817414d62742190d9b88/build_subfolder/CMakeFiles/CMakeOutput.log".
zlib/1.2.12:
zlib/1.2.12: ERROR: Package '327d246178158e885353817414d62742190d9b88' build failed
zlib/1.2.12: WARN: Build folder /root/.conan/data/zlib/1.2.12///build/327d246178158e885353817414d62742190d9b88
ERROR: zlib/1.2.12: Error in build() method, line 90
cmake = self.configure_cmake()
while calling 'configure_cmake', line 85
cmake.configure(build_folder=self.build_subfolder)
ConanException: Error 1 while executing cd '/root/.conan/data/zlib/1.2.12/
/
/build/327d246178158e885353817414d62742190d9b88/build_subfolder' && /root/.conan/data/android-ndk/r23b/
//package/4db1be536558d833e52e862fd84d64d75c2b3656/cmake-wrapper -G "Unix Makefiles" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_TOOLCHAIN_FILE="/root/.conan/data/android-ndk/r23b///package/4db1be536558d833e52e862fd84d64d75c2b3656/build/cmake/android.toolchain.cmake" -DCONAN_IN_LOCAL_CACHE="ON" -DCONAN_COMPILER="clang" -DCONAN_COMPILER_VERSION="14" -DBUILD_SHARED_LIBS="OFF" -DCMAKE_INSTALL_PREFIX="/root/.conan/data/zlib/1.2.12///package/327d246178158e885353817414d62742190d9b88" -DCMAKE_INSTALL_BINDIR="bin" -DCMAKE_INSTALL_SBINDIR="bin" -DCMAKE_INSTALL_LIBEXECDIR="bin" -DCMAKE_INSTALL_LIBDIR="lib" -DCMAKE_INSTALL_INCLUDEDIR="include" -DCMAKE_INSTALL_OLDINCLUDEDIR="include" -DCMAKE_INSTALL_DATAROOTDIR="share" -DCONAN_CMAKE_POSITION_INDEPENDENT_CODE="ON" -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY="ON" -DCONAN_EXPORTED="1" -DSKIP_INSTALL_ALL="False" -DSKIP_INSTALL_LIBRARIES="False" -DSKIP_INSTALL_HEADERS="False" -DSKIP_INSTALL_FILES="True" -Wno-dev '/root/.conan/data/zlib/1.2.12//_/build/327d246178158e885353817414d62742190d9b88'
The command '/bin/sh -c conan install zlib/1.2.12@ --build missing -pr:h android-armv8-debug -pr:b default --build missing' returned a non-zero code: 1

I assume, it's a conan-client issue, adding @memsharded here

Relates to #425