[mono][android][tests] Library mode functional tests fail to build on android arm/x86

Open
#111,699 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
android, csharp

Research direction

Start with the Android library build path in src/mono/msbuild/common/LibraryBuilder.targets and the LibraryBuilderTask calls shown in the failure. Reproduce the functional test build for android-x86 and android-arm, comparing them with the passing x64 and arm64 builds from the test introduced by pull request 111545. Done means the tests build successfully on both affected platforms and can be re-enabled in CI.

Written by the indexing model from the issue text.

Description

area-Infrastructure-mono disabled-test os-android

Description

Functional test for testing library mode on Android fails to build on:

  • android x86 emulator build fails at linking:
    d.lld: error: relocation R_386_PC32 cannot be used against symbol 'fmodf'; recompile with -fPIC
    >>> defined in /usr/local/android-sdk/ndk/27.2.12479018/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/lib/i686-linux-android/21/libm.so
    >>> referenced by /__w/1/s/artifacts/obj/Android.Device_Emulator.LibraryMode_Aot_Llvm.Test/Release/net10.0/android-x86/mobile/System.Private.CoreLib.dll.o:(wrapper_managed_to_native_object___icall_wrapper___emul_rrem_single_single)
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    
  • android arm device build crashes (clang crashes in particular):
    ##[error]src/mono/msbuild/common/LibraryBuilder.targets(28,5): error MSB4018: (NETCORE_ENGINEERING_TELEMETRY=Build) The "LibraryBuilderTask" task failed unexpectedly.
    System.ComponentModel.Win32Exception (2): An error occurred trying to start process '/usr/local/android-sdk/ndk/27.2.12479018/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a21-clang' with working directory '/__w/1/s/artifacts/bin/Android.Device_Emulator.LibraryMode_Aot_Llvm.Test/Release/net10.0/android-arm/AppBundle/'. No such file or directory
    at System.Diagnostics.Process.ForkAndExecProcess(ProcessStartInfo startInfo, String resolvedFilename, String[] argv, String[] envp, String cwd, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec)
    at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
    at System.Diagnostics.Process.Start()
    at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
    at Utils.TryRunProcess(TaskLoggingHelper logger, String path, String args, IDictionary`2 envVars, String workingDir, Boolean silent, Boolean logStdErrAsMessage, MessageImportance debugMessageImportance, String label, Action`1 inputProvider) in /_/src/tasks/Common/Utils.cs:line 174
    at Utils.RunProcess(TaskLoggingHelper logger, String path, String args, IDictionary`2 envVars, String workingDir, Boolean ignoreErrors, Boolean silent, MessageImportance debugMessageImportance) in /_/src/tasks/Common/Utils.cs:line 116
    at Microsoft.Android.Build.AndroidProject.Build(String workingDir, ClangBuildOptions buildOptions, Boolean stripDebugSymbols, String apiLevel) in /_/src/tasks/MobileBuildTasks/Android/AndroidProject.cs:line 50
    at LibraryBuilderTask.BuildAndroidLibrary(List`1 sources, List`1 libs, List`1 linkerArgs) in /_/src/tasks/LibraryBuilder/LibraryBuilder.cs:line 376
    at LibraryBuilderTask.Execute() in /_/src/tasks/LibraryBuilder/LibraryBuilder.cs:line 152
    at Microsoft.Build.BackEnd.TaskExecutionHost.Execute()
    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(TaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask)
    

The test will be disabled on our CI for these platforms. We should investigate the failures and fix the builds eventually.

Note

The test has been introduced in: https://github.com/dotnet/runtime/pull/111545 and passes on x64 and arm64 architectures

Dominant language
C#
Stars
18.3k
Forks
5.6k
PR merge metrics
PR metrics pending

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dotnet/runtime

All issues in dotnet/runtime

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.