-
Notifications
You must be signed in to change notification settings - Fork 50
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
Build on Android is failling because of "Unknown processor" (CMake) #504
Comments
The CMakeLists asks for a minimum cmake version of 3.0. Modern Android NDKs require at least 3.6 to enable the proper policies: android/ndk#2032. |
Hello! Looking at the error message (
There does seem to be a matching
However, the above definition is only available when I don't have a solution (yet), but here's a suggestions to try:
Something like the following should do it:
Also, I often see more success using Ninja as the CMake Generator. If you have it installed, you might try setting it as the CMAKE_GENERATOR in your build environment (or in the
Let us know whether you have any success with this, or if there are changes you recommend for our build scripts. Thanks! |
Indeed, we used
Just to be on the safe side, I tried to apply all your suggestions, even if @@ -93,7 +93,9 @@ jobs:
shell: pwsh
run: |
$CargoConfigFile = "~/.cargo/config.toml"
- $AndroidToolchain="${Env:ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64"
+
+ $AndroidToolchain="${Env:ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/linux-x86_64"
+ Write-Host "\$AndroidToolchain=$AndroidToolchain"
Get-ChildItem -Path $AndroidToolchain "libunwind.a" -Recurse | ForEach-Object {
$libunwind = $_.FullName
@@ -130,6 +132,13 @@ jobs:
echo "CXX_aarch64-linux-android=$AndroidToolchain/bin/aarch64-linux-android21-clang++" >> $Env:GITHUB_ENV
echo "AR_aarch64-linux-android=$AndroidToolchain/bin/llvm-ar" >> $Env:GITHUB_ENV
+ echo "[env]" >> $CargoConfigFile
+ echo "ANDROID_NDK_ROOT=`"${Env:ANDROID_NDK_ROOT}`"" >> $CargoConfigFile
+ echo "ANDROID_STANDALONE_TOOLCHAIN=`"${Env:ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64`"" >> $CargoConfigFile
+ echo "CMAKE_GENERATOR=`"Ninja`"" >> $CargoConfigFile
+
+ Get-Content -Path "$CargoConfigFile"
+
- name: Configure macOS deployement target
if: ${{ matrix.os == 'osx' }}
shell: pwsh The final [target.i686-linux-android]
linker="/usr/local/lib/android/sdk/ndk/27.0.12077973/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android21-clang"
[target.x86_64-linux-android]
linker="/usr/local/lib/android/sdk/ndk/27.0.12077973/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android21-clang"
[target.armv7-linux-androideabi]
linker="/usr/local/lib/android/sdk/ndk/27.0.12077973/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi21-clang"
[target.aarch64-linux-android]
linker="/usr/local/lib/android/sdk/ndk/27.0.12077973/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang"
[env]
ANDROID_NDK_ROOT="/usr/local/lib/android/sdk/ndk/27.0.12077973"
ANDROID_STANDALONE_TOOLCHAIN="/usr/local/lib/android/sdk/ndk/27.0.12077973/toolchains/llvm/prebuilt/linux-x86_64"
CMAKE_GENERATOR="Ninja" I still get the exact same error.
At this point, all I can recommend is to bump the minimum supported CMake version to 3.6 in the CMakeLists files.
I believe both the CMakeLists files from both aws-lc-rs and aws-lc should be updated accordingly. I’ll try to fork your repositories and give it a try myself a bit later. |
Updating the the minimum CMake version did not fix the problem. The only difference is that the deprecation warning is gone.
Changing the minimum version to 3.30.2 wasn’t effective either. I’ll try setting the variables such as NDK_PROC_i686_ABI manually. |
@justsmth I’m able to build with this patch: CBenoit@f9868b5 Would you be open to me sending you a PR to address the problem like this? |
@CBenoit - I'm glad you got the build working! 🎉 It looks like your patch is reproducing the values as specified here in CMake's own configuration files. Apparently, the The comment here indicates that NDK >= 23 should set all of the values (including |
That’s my understanding too. Because of that, the fix above does not feel right. Our build is using the default NDK provided in GitHub Workflow images which is >= 27 as of today at least. Thanks to your last link, I found out that the NDK is providing a file called
I’m guessing the proper fix would be to revert whatever they did on NDK side (unlikely), or to update CMake to handle that… |
This is interesting.
The logic in CMake here fails when
I wonder if what we should do here is just not set the |
Yes! This would likely work by fall-backing on CMake built-in variables! |
I was looking at the GitHub runner configurations. One option might be to set This might fix the build until the GitHub runner images are updated? (This also assumes that you're not currently needing r27 for your build.) |
Oh, you’re right. I think we can do that temporarily! I’ll close the issue since I don’t think there is any specific action that need to be taken on aws-lc-rs side. Thank you for following up! |
Problem:
We are running the build in a GitHub workflow with something looking like this:
But it fails when CMake is run in the build.rs.
Relevant details
AWS-LC for Rust versions or commit:
aws-lc-sys v0.20.1
System information: ubuntu-20.04 GitHub runner
Build log:
The text was updated successfully, but these errors were encountered: