Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Xamarin.Android.Build.Tasks] Quote AOT lib paths (#3653)
Fixes: #3651 AOT compilation (`$(AotAssemblies)`=True) on Windows was failing: [aot-compiler stdout] Executing the native linker: "D:\Program Files (x86)\Android\android-sdk\ndk\20.0.5594570\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ld" -shared -o obj\Release\90\aot\armeabi-v7a\libaot-Xamarin.Android.Arch.Lifecycle.ViewModel.dll.so.tmp "obj\Release\90\aot\armeabi-v7a\Xamarin.Android.Arch.Lifecycle.ViewModel.dll\temp-llvm.o" obj\Release\90\aot\armeabi-v7a\Xamarin.Android.Arch.Lifecycle.ViewModel.dll\temp.s.o D:\Program Files (x86)\Android\android-sdk\ndk\20.0.5594570\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64\lib\gcc\arm-linux-androideabi\4.9.x\libgcc.a D:\Program Files (x86)\Android\android-sdk\ndk\20.0.5594570\platforms\android-19\arch-arm\usr\lib\libc.so D:\Program Files (x86)\Android\android-sdk\ndk\20.0.5594570\platforms\android-19\arch-arm\usr\lib\libm.so [aot-compiler stderr] D:\Program Files (x86)\Android\android-sdk\ndk\20.0.5594570\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ld: error: cannot open D:\Program: No such file or directory [aot-compiler stderr] D:\Program Files (x86)\Android\android-sdk\ndk\20.0.5594570\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ld: error: cannot open Files: No such file or directory AOT compilation failed because reasons the paths for `libgcc.a`, `libc.so`, and `libm.so` were not quoted, preventing appropriate option parsing on behalf of mono. This has a straightforward solution: ensure those paths are quoted. (*All* filesystem paths should be quoted when sent via a shell. Unfortunately, this is not done consistently.) When paths were properly quoted, [a different error arose][0]: [aot-compiler stderr] '"opt"' is not recognized as an internal or external command, operable program or batch file. [aot-compiler stderr] AOT of image E:\A\_work\169\s\bin\TestRelease\temp\BuildAotApplication And├£ml├ñ├╝ts_x86_True_True\obj\Release\android\assets\shrunk\Java.Interop.dll failed. [aot-compiler stdout] Mono Ahead of Time compiler - compiling assembly E:\A\_work\169\s\bin\TestRelease\temp\BuildAotApplication AndÜmläüts_x86_True_True\obj\Release\android\assets\shrunk\Java.Interop.dll [aot-compiler stdout] AOTID 8B487E2E-77E0-3CED-D551-4DA1A07E6AD6 [aot-compiler stdout] Executing opt: "opt" -f -O2 -disable-tail-calls -place-safepoints -spp-all-backedges -o "mono_aot_a21140\temp.opt.bc" "mono_aot_a21140\temp.bc" E:\A\_work\169\s\bin\Release\lib\xamarin.android\xbuild\Xamarin\Android\Xamarin.Android.Common.targets(2819,3): error XA3001: Could not AOT the assembly: Java.Interop.dll Done executing task "Aot" -- FAILED. The path to `opt` is [computed based on `llvm_path`][1], so the lack of *any* path before `opt` implies that the `mono --aot=llvm-path=PATH` option isn't being parsed properly. We believe that `llvm-path` isn't parsed properly because the parsing for the `ld-flags` option somehow "screws things up". Moving the `ld-flags` option to be *last* allows `llvm-path` to be properly parsed, which allows the correct path to `opt` to be used. Finally, update `build-tools/automation/azure-pipelines.yaml` so that the commercial integration tests are executed on *branches* of the xamarin/xamarin-android repo, while forks of the repo are skipped. This allows the **Integrated Regression Windows** job (3adbab5) to be executed, allowing us to ensure that the fix actually works on the PR, without needing a merge to master first. [0]: #3653 (comment) [1]: https://github.com/mono/mono/blob/7f7b5c9f3e521b1948e323d339f66172bcbc3cb2/mono/mini/aot-compiler.c#L9663
- Loading branch information