Skip to content
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

Fix AOT build #2125

Merged
merged 1 commit into from
Sep 7, 2018
Merged

Fix AOT build #2125

merged 1 commit into from
Sep 7, 2018

Conversation

grendello
Copy link
Contributor

The leeroy make target failed with a "file not found" exception while
attempting to invoke the cross-arm crosscompiler and the reason for this was
that cross-arm was never built because of the armeabi-v7a target missing in
the ALL_AOT_ABIS make variable in the build-tools/scripts/BuildEverything.mk
file.

This commit adds the missing target architecture and fixes the build.

@grendello grendello added the full-mono-integration-build For PRs; run a full build (~6-10h for mono bumps), not the faster PR subset (~2h for mono bumps) label Aug 31, 2018
@radekdoulik radekdoulik self-requested a review August 31, 2018 12:40
Copy link
Member

@radekdoulik radekdoulik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yay! Hopefully that will also fix the apk tests with AOT. Looking forward to it.

Looks good.

@grendello
Copy link
Contributor Author

@radekdoulik yeah, it should... :)

@grendello
Copy link
Contributor Author

build

@grendello grendello force-pushed the fix-aot-build branch 2 times, most recently from 86dbc3c to 2f3bdbe Compare September 1, 2018 14:01
@grendello
Copy link
Contributor Author

Logs are taken from the msbuild binlog for run-all-tests

OK, this is beyond weird... BCL tests DID run fine, btw - they aren't reported in the github status for some reason:

  /Users/builder/android-toolchain/sdk/platform-tools/adb   shell am instrument  -e "loglevel Verbose" -w "Xamarin.Android.Bcl_Tests/xamarin.android.bcltests.XUnitInstrumentation"  (TaskId:111)
  INSTRUMENTATION_RESULT: failed=0 (TaskId:111)
  INSTRUMENTATION_RESULT: filtered=19770 (TaskId:111)
  INSTRUMENTATION_RESULT: inconclusive=0 (TaskId:111)
  INSTRUMENTATION_RESULT: nunit2-results-path=/storage/emulated/0/Android/data/Xamarin.Android.Bcl_Tests/files/Documents/TestResults.xUnit.xml (TaskId:111)
  INSTRUMENTATION_RESULT: passed=39331 (TaskId:111)
  INSTRUMENTATION_RESULT: run=39333 (TaskId:111)
  INSTRUMENTATION_RESULT: skipped=2 (TaskId:111)
  INSTRUMENTATION_RESULT: total=57601 (TaskId:111)
  INSTRUMENTATION_CODE: -1 (TaskId:111)

and

  /Users/builder/android-toolchain/sdk/platform-tools/adb   shell am instrument  -e "loglevel Verbose" -w "Xamarin.Android.Bcl_Tests/xamarin.android.bcltests.NUnitInstrumentation"  (TaskId:112)
  INSTRUMENTATION_RESULT: failed=1 (TaskId:112)
  INSTRUMENTATION_RESULT: filtered=0 (TaskId:112)
  INSTRUMENTATION_RESULT: inconclusive=0 (TaskId:112)
  INSTRUMENTATION_RESULT: nunit2-results-path=/storage/emulated/0/Android/data/Xamarin.Android.Bcl_Tests/files/Documents/TestResults.NUnit.xml (TaskId:112)
  INSTRUMENTATION_RESULT: passed=21335 (TaskId:112)
  INSTRUMENTATION_RESULT: run=21697 (TaskId:112)
  INSTRUMENTATION_RESULT: skipped=361 (TaskId:112)
  INSTRUMENTATION_RESULT: total=0 (TaskId:112)
  INSTRUMENTATION_CODE: 0 (TaskId:112)

Their logs are pulled from the device just fine, however the next APK tests in order (JcwGen_Tests and Locale_Tests) run but there's a failure downloading the test results all of the sudden:

/Users/builder/android-toolchain/sdk/platform-tools/adb   shell am instrument  -e "loglevel Verbose" -w "Xamarin.Android.JcwGen_Tests/xamarin.android.jcwgentests.TestInstrumentation"  (TaskId:113)
  INSTRUMENTATION_RESULT: failed=0 (TaskId:113)
  INSTRUMENTATION_RESULT: inconclusive=0 (TaskId:113)
  INSTRUMENTATION_RESULT: nunit2-results-path=/data/user/0/Xamarin.Android.JcwGen_Tests/files/.__override__/TestResults.xml (TaskId:113)
  INSTRUMENTATION_RESULT: passed=16 (TaskId:113)
  INSTRUMENTATION_RESULT: run=16 (TaskId:113)
  INSTRUMENTATION_RESULT: skipped=0 (TaskId:113)
  INSTRUMENTATION_CODE: -1 (TaskId:113)
  /Users/builder/android-toolchain/sdk/platform-tools/adb   logcat -v threadtime -d  (TaskId:113)
  /Users/builder/android-toolchain/sdk/platform-tools/adb   pull "/data/user/0/Xamarin.Android.JcwGen_Tests/files/.__override__/TestResults.xml" "/Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/tests/../bin/TestDebug/TestResult-Xamarin.Android.JcwGen_Tests.xml"  (TaskId:113)
  adb: error: failed to stat remote object '/data/user/0/Xamarin.Android.JcwGen_Tests/files/.__override__/TestResults.xml': Permission denied (TaskId:113)
/Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/build-tools/scripts/TestApks.targets(182,5): error MSB6006: "adb" exited with code 1. [/Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/tests/RunApkTests.targets]

and later on the same for:

/Users/builder/android-toolchain/sdk/platform-tools/adb   shell am instrument  -e "loglevel Verbose" -w "Xamarin.Android.Locale_Tests/xamarin.android.localetests.TestInstrumentation"  (TaskId:114)
  INSTRUMENTATION_RESULT: failed=0 (TaskId:114)
  INSTRUMENTATION_RESULT: inconclusive=0 (TaskId:114)
  INSTRUMENTATION_RESULT: nunit2-results-path=/data/user/0/Xamarin.Android.Locale_Tests/files/.__override__/TestResults.xml (TaskId:114)
  INSTRUMENTATION_RESULT: passed=5 (TaskId:114)
  INSTRUMENTATION_RESULT: run=5 (TaskId:114)
  INSTRUMENTATION_RESULT: skipped=0 (TaskId:114)
  INSTRUMENTATION_CODE: -1 (TaskId:114)
  /Users/builder/android-toolchain/sdk/platform-tools/adb   logcat -v threadtime -d  (TaskId:114)
  /Users/builder/android-toolchain/sdk/platform-tools/adb   pull "/data/user/0/Xamarin.Android.Locale_Tests/files/.__override__/TestResults.xml" "/Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/tests/../bin/TestDebug/TestResult-Xamarin.Android.Locale_Tests.xml"  (TaskId:114)
  adb: error: failed to stat remote object '/data/user/0/Xamarin.Android.Locale_Tests/files/.__override__/TestResults.xml': Permission denied (TaskId:114)

On the off chance that it might be an issue with disk space in the emulator, I'm going to push one more commit which increases the data partition size to 8GB and we'll see how it goes.

@grendello
Copy link
Contributor Author

Hmm, it seems we don't create a new emulator image because some emulator's already running:

Task "Xamarin.Android.Tools.BootstrapTasks.CheckAdbTarget" (TaskId:93)
  Task Parameter:ToolExe=adb (TaskId:93)
  Task Parameter:ToolPath=/Users/builder/android-toolchain/sdk/platform-tools (TaskId:93)
  Task Parameter:Timeout=60000 (TaskId:93)
  /Users/builder/android-toolchain/sdk/platform-tools/adb  shell getprop ro.build.version.sdk  (TaskId:93)
  * daemon not running; starting now at tcp:5037 (TaskId:93)
  * daemon started successfully (TaskId:93)
  28 (TaskId:93)
  /Users/builder/android-toolchain/sdk/platform-tools/adb  shell pm path com.android.shell  (TaskId:93)
  package:/system/priv-app/Shell/Shell.apk (TaskId:93)
  Output Property: _ValidAdbTarget=True (TaskId:93)
Done executing task "Xamarin.Android.Tools.BootstrapTasks.CheckAdbTarget". (TaskId:93)
Task "CreateAndroidEmulator" skipped, due to false condition; ( '$(_ValidAdbTarget)' != 'True' ) was evaluated as ( 'True' != 'True' ).
Task "StartAndroidEmulator" skipped, due to false condition; ( '$(_ValidAdbTarget)' != 'True' ) was evaluated as ( 'True' != 'True' ).

@grendello
Copy link
Contributor Author

So the problem here appears to be that the first two test suites create the results file in the external storage which creates the files with permissions that make them world-readable. The last 2 result files are created in the private data store with stricter permissions that make them only owner-readable. Thus we can't access them.

@grendello
Copy link
Contributor Author

After examining the emulator image I noticed that the successful test suites have the following entry in their AndroidManifest.xml file:

<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="22" />

and the failing ones have instead

<uses-sdk android:minSdkVersion="14" />

Considering that the code which constructs the results path targets Android API 19 and newer in its crucial part, the theory is that the lack of the target SDK version causes Android to behave in a legacy manner - to return null for this code and, thus, create the result file path in the app's private storage. This paired with stricter Android permission handling in newer Androids leads to the issue. That's the theory, let's see if it's confirmed after the current build completes...

@grendello
Copy link
Contributor Author

Addition of android:targetSdkVersion="22" didn't help, however the latest update appears to have worked locally. Namely, I added external storage permissions to the test suites which failed previously - this affects the path where the results file is placed. We'll know if it really worked in 7+ hours...

@grendello
Copy link
Contributor Author

grendello commented Sep 4, 2018

So, the APK tests failed again, as before, despite the permission changes. However, it's not because the changes weren't effective - they were, as the tests run locally without a hitch (with a single failure across the entire test suite, not related to this PR). However, it seems the problem lies in that the emulator we start on the build bots is never stopped. In effect, the next PR build sees a running emulator and uses it for the tests, which results in:

  Task Adb (TaskId:103)
    Arguments:   install "/Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/tests/../bin/TestDebug/Xamarin.Android.Locale_Tests-Signed.apk" (TaskId:103)
  /Users/builder/android-toolchain/sdk/platform-tools/adb   install "/Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/tests/../bin/TestDebug/Xamarin.Android.Locale_Tests-Signed.apk"  (TaskId:103)
  adb: failed to install /Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/tests/../bin/TestDebug/Xamarin.Android.Locale_Tests-Signed.apk: Failure [INSTALL_FAILED_INSUFFICIENT_STORAGE] (TaskId:103)
/Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/build-tools/scripts/TestApks.targets(150,5): error MSB6006: "adb" exited with code 1. [/Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/tests/RunApkTests.targets]
    [Output] Output: (TaskId:103)
      adb: failed to install /Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/tests/../bin/TestDebug/Xamarin.Android.Locale_Tests-Signed.apk: Failure [INSTALL_FAILED_INSUFFICIENT_STORAGE] (TaskId:103)

And then further errors stemming from the one above. We fail to kill the emulator instance after the tests complete:

Task "Xamarin.Android.Tools.BootstrapTasks.Adb" skipped, due to false condition; ( '$(_EmuTarget)' != '' ) was evaluated as ( '' != '' ).
Task "KillProcess" skipped, due to false condition; ( '$(_EmuTarget)' != '' ) was evaluated as ( '' != '' ).
Task "Xamarin.Android.Tools.BootstrapTasks.Adb" (TaskId:126)
  Task Parameter:Arguments=kill-server (TaskId:126)
  Task Parameter:ToolExe=adb (TaskId:126)
  Task Parameter:ToolPath=/Users/builder/android-toolchain/sdk/platform-tools (TaskId:126)
  Task Parameter:Timeout=60000 (TaskId:126)
  Task Adb (TaskId:126)
    Arguments: kill-server (TaskId:126)
  /Users/builder/android-toolchain/sdk/platform-tools/adb kill-server  (TaskId:126)
    [Output] Output: (TaskId:126)
Done executing task "Xamarin.Android.Tools.BootstrapTasks.Adb". (TaskId:126)
Task "Exec" skipped, due to false condition; ( '$(HostOS)' != 'Windows' And '$(_EmuTarget)' != '' ) was evaluated as ( 'Darwin' != 'Windows' And '' != '' ).
Task "Sleep" skipped, due to false condition; ( '$(HostOS)' != 'Windows' And '$(_EmuTarget)' != '' ) was evaluated as ( 'Darwin' != 'Windows' And '' != '' ).
Task "Exec" skipped, due to false condition; ( '$(HostOS)' != 'Windows' And '$(_EmuTarget)' != '' ) was evaluated as ( 'Darwin' != 'Windows' And '' != '' ).
Done building target "ReleaseAndroidTarget" in project "RunApkTests.targets".: (TargetId:22)

The _EmuTarget property is empty because we didn't start the emulator instance, so one failed PR run which didn't kill the emulator causes a cascade effect for the PRs built next. Not sure what is the correct way to fix this. Perhaps we should check if the running emulator instance is that of our test runner and, if yes, kill it and recreate the image? If yes, then this action should probably be taken outside the TestApks.target context - in the run-apk-tests make target before running msbuild to start tests?

@grendello
Copy link
Contributor Author

build

@grendello
Copy link
Contributor Author

build

@grendello
Copy link
Contributor Author

Made changes to the Jenkins PR builder to kill all emulator instances and remove all test AVDs before the build, let's wait to see if it makes a difference of any kind

@grendello
Copy link
Contributor Author

build

@grendello grendello force-pushed the fix-aot-build branch 2 times, most recently from 3855e9a to 7287526 Compare September 5, 2018 21:21
@grendello grendello added the do-not-merge PR should not be merged. label Sep 5, 2018
@grendello
Copy link
Contributor Author

This latest update rewrites the Adb task + tasks which derive from it so that the Adb task no longer uses PathToolTask as its base but runs adb on its own. The reason is that we want to be able to ignore adb failure exit codes (I know ToolTask has a way to do it but it's not very subtle, I wanted more finely grained control over this) and also the ability to log output of the command to a file - this is to work around the "permission denied" error when pulling test results from the private location (still no clue why it works locally but fails on the PR builders). We do it by running the cat command as the user who owns the test package - that gives us the permission to read the file but we need to "redirect" output to a local file - this is implemented by the latest update as well.

NOTE!! I wasn't able to test the changes on the runtime as currently my local msbuild is broken and fails to run our tests - thus the do-not-merge label.

@grendello
Copy link
Contributor Author

grendello commented Sep 6, 2018

Managed to fix my msbuild and run the tests. Just pushed an update that fixes a number of issues I've found. Locally the code appears to work fine:

AcquireAndroidTarget:
  Executing: /home/grendel/android-toolchain/sdk/platform-tools/adb  shell getprop ro.build.version.sdk
  Executing: /home/grendel/android-toolchain/sdk/platform-tools/adb  shell pm path com.android.shell
  Executing: /home/grendel/android-toolchain/sdk/platform-tools/adb  shell setprop debug.mono.log timing
  Executing: /home/grendel/android-toolchain/sdk/platform-tools/adb  logcat -G 4M
UndeployTestApks:
  Executing: /home/grendel/android-toolchain/sdk/platform-tools/adb   uninstall "Mono.Android_Tests"
  Executing: /home/grendel/android-toolchain/sdk/platform-tools/adb   uninstall "Xamarin.Android.Bcl_Tests"
  Executing: /home/grendel/android-toolchain/sdk/platform-tools/adb   uninstall "Xamarin.Android.JcwGen_Tests"
  Executing: /home/grendel/android-toolchain/sdk/platform-tools/adb   uninstall "Xamarin.Android.Locale_Tests"
DeployTestApks:
  Executing: /home/grendel/android-toolchain/sdk/platform-tools/adb   install "/home/grendel/vc/xamarin/xamarin-android/tests/../bin/TestDebug/Mono.Android_Tests-Signed.apk"
  Executing: /home/grendel/android-toolchain/sdk/platform-tools/adb   install "/home/grendel/vc/xamarin/xamarin-android/tests/../bin/TestDebug/Xamarin.Android.Bcl_Tests-Signed.apk"
  Executing: /home/grendel/android-toolchain/sdk/platform-tools/adb   install "/home/grendel/vc/xamarin/xamarin-android/tests/../bin/TestDebug/Xamarin.Android.JcwGen_Tests-Signed.apk"
  Executing: /home/grendel/android-toolchain/sdk/platform-tools/adb   install "/home/grendel/vc/xamarin/xamarin-android/tests/../bin/TestDebug/Xamarin.Android.Locale_Tests-Signed.apk"
RecordApkSizes:
  stat -c "stat: %s %N" "/home/grendel/vc/xamarin/xamarin-android/tests/../bin/TestDebug/Mono.Android_Tests-Signed.apk" > "/home/grendel/vc/xamarin/xamarin-android/tests/../bin/TestDebug/apk-sizes-Mono.Android_Tests-Debug.txt"
  unzip -l "/home/grendel/vc/xamarin/xamarin-android/tests/../bin/TestDebug/Mono.Android_Tests-Signed.apk" >> "/home/grendel/vc/xamarin/xamarin-android/tests/../bin/TestDebug/apk-sizes-Mono.Android_Tests-Debug.txt"
RunTestApks:
  Executing: /home/grendel/android-toolchain/sdk/platform-tools/adb   shell pm grant Mono.Android_Tests android.permission.READ_EXTERNAL_STORAGE
  Executing: /home/grendel/android-toolchain/sdk/platform-tools/adb   shell pm grant Mono.Android_Tests android.permission.WRITE_EXTERNAL_STORAGE
  Executing: /home/grendel/android-toolchain/sdk/platform-tools/adb   shell pm grant Xamarin.Android.Bcl_Tests android.permission.READ_PHONE_STATE
  Executing: /home/grendel/android-toolchain/sdk/platform-tools/adb   shell pm grant Xamarin.Android.Bcl_Tests android.permission.READ_EXTERNAL_STORAGE
  Executing: /home/grendel/android-toolchain/sdk/platform-tools/adb   shell pm grant Xamarin.Android.Bcl_Tests android.permission.WRITE_EXTERNAL_STORAGE
  Executing: /home/grendel/android-toolchain/sdk/platform-tools/adb   shell pm grant Xamarin.Android.JcwGen_Tests android.permission.READ_EXTERNAL_STORAGE
  Executing: /home/grendel/android-toolchain/sdk/platform-tools/adb   shell pm grant Xamarin.Android.JcwGen_Tests android.permission.WRITE_EXTERNAL_STORAGE
  Executing: /home/grendel/android-toolchain/sdk/platform-tools/adb   shell pm grant Xamarin.Android.Locale_Tests android.permission.READ_EXTERNAL_STORAGE
  Executing: /home/grendel/android-toolchain/sdk/platform-tools/adb   shell pm grant Xamarin.Android.Locale_Tests android.permission.WRITE_EXTERNAL_STORAGE
  Executing: /home/grendel/android-toolchain/sdk/platform-tools/adb   shell am instrument  -e "loglevel Verbose" -w "Mono.Android_Tests/xamarin.android.runtimetests.TestInstrumentation"
  Executing: /home/grendel/android-toolchain/sdk/platform-tools/adb   logcat -v threadtime -d
  Executing: /home/grendel/android-toolchain/sdk/platform-tools/adb   shell run-as Mono.Android_Tests cat "/storage/emulated/0/Android/data/Mono.Android_Tests/files/Documents/TestResults.xml"
    writing stdout to file: /home/grendel/vc/xamarin/xamarin-android/tests/../bin/TestDebug/TestResult-Mono.Android_Tests.xml
  Executing: /home/grendel/android-toolchain/sdk/platform-tools/adb   shell am instrument  -e "loglevel Verbose" -w "Xamarin.Android.Bcl_Tests/xamarin.android.bcltests.XUnitInstrumentation"
  Executing: /home/grendel/android-toolchain/sdk/platform-tools/adb   logcat -v threadtime -d
  Executing: /home/grendel/android-toolchain/sdk/platform-tools/adb   shell run-as Xamarin.Android.Bcl_Tests cat "/storage/emulated/0/Android/data/Xamarin.Android.Bcl_Tests/files/Documents/TestResults.xUnit.xml"
    writing stdout to file: /home/grendel/vc/xamarin/xamarin-android/tests/../bin/TestDebug/TestResult-Xamarin.Android.Bcl_Tests.xunit.xml
  Executing: /home/grendel/android-toolchain/sdk/platform-tools/adb   shell am instrument  -e "loglevel Verbose" -w "Xamarin.Android.Bcl_Tests/xamarin.android.bcltests.NUnitInstrumentation"
  Executing: /home/grendel/android-toolchain/sdk/platform-tools/adb   logcat -v threadtime -d
  Executing: /home/grendel/android-toolchain/sdk/platform-tools/adb   shell run-as Xamarin.Android.Bcl_Tests cat "/storage/emulated/0/Android/data/Xamarin.Android.Bcl_Tests/files/Documents/TestResults.NUnit.xml"
    writing stdout to file: /home/grendel/vc/xamarin/xamarin-android/tests/../bin/TestDebug/TestResult-Xamarin.Android.Bcl_Tests.nunit.xml
  Executing: /home/grendel/android-toolchain/sdk/platform-tools/adb   shell am instrument  -e "loglevel Verbose" -w "Xamarin.Android.JcwGen_Tests/xamarin.android.jcwgentests.TestInstrumentation"
  Executing: /home/grendel/android-toolchain/sdk/platform-tools/adb   logcat -v threadtime -d
  Executing: /home/grendel/android-toolchain/sdk/platform-tools/adb   shell run-as Xamarin.Android.JcwGen_Tests cat "/storage/emulated/0/Android/data/Xamarin.Android.JcwGen_Tests/files/Documents/TestResults.xml"
    writing stdout to file: /home/grendel/vc/xamarin/xamarin-android/tests/../bin/TestDebug/TestResult-Xamarin.Android.JcwGen_Tests.xml
  Executing: /home/grendel/android-toolchain/sdk/platform-tools/adb   shell am instrument  -e "loglevel Verbose" -w "Xamarin.Android.Locale_Tests/xamarin.android.localetests.TestInstrumentation"
  Executing: /home/grendel/android-toolchain/sdk/platform-tools/adb   logcat -v threadtime -d
  Executing: /home/grendel/android-toolchain/sdk/platform-tools/adb   shell run-as Xamarin.Android.Locale_Tests cat "/storage/emulated/0/Android/data/Xamarin.Android.Locale_Tests/files/Documents/TestResults.xml"
    writing stdout to file: /home/grendel/vc/xamarin/xamarin-android/tests/../bin/TestDebug/TestResult-Xamarin.Android.Locale_Tests.xml
ReleaseAndroidTarget:
  Executing: /home/grendel/android-toolchain/sdk/platform-tools/adb kill-server
Done Building Project "/home/grendel/vc/xamarin/xamarin-android/tests/RunApkTests.targets" (default targets).

Note the run-as invocations - this should make it work on the PR builder for the private data location. We'll see :)

@@ -18,12 +18,10 @@
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
<AndroidSupportedAbis>armeabi-v7a;x86</AndroidSupportedAbis>
<AndroidUseSharedRuntime>False</AndroidUseSharedRuntime>
<AndroidUseLatestPlatformSdk>false</AndroidUseLatestPlatformSdk>
<TargetFrameworkVersion>v8.1</TargetFrameworkVersion>
<AndroidUseLatestPlatformSdk>true</AndroidUseLatestPlatformSdk>
</PropertyGroup>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the reasoning for this change? Wouldn't it limit the tests, when nearly everything would target v8.1?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just to bring parity with other tests - note however line 22, it renders line 21 ineffective by choosing whatever the latest platform is. The test projects must be somehow made to use the same project options, but that's a material for a different PR.

The `leeroy` make target failed with a "file not found" exception while
attempting to invoke the `cross-arm` crosscompiler and the reason for this was
that `cross-arm` was never built because of the `armeabi-v7a` target missing in
the `ALL_AOT_ABIS` make variable in the `build-tools/scripts/BuildEverything.mk`
file.

This commit adds the missing target architecture and fixes the build.

In addition to the above changes this commit modifies APK tests to:

    * target Android SDK 22 (to maintain uniformity across tests and also to
      make sure that the code which determines location of the on-device test
      result files returns the same location for all the tests - it relies on
      APIs introduced in API level 19)
    * request external storage premissions. This ensures that we can create the
      test result files in a location that's publically accessible. If access to
      external storage is denied our test code will create the results file in
      the application data directory and on Android 28 the file will be only
      readable by owner, thus making `adb pull` fail to download it.
@grendello
Copy link
Contributor Author

Timeout while deploying APK to the emulator... will build again :(

@grendello
Copy link
Contributor Author

build

@grendello grendello removed the do-not-merge PR should not be merged. label Sep 7, 2018
@grendello
Copy link
Contributor Author

The failed status is because of

(RunTestApks target) ->
  /Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/build-tools/scripts/TestApks.targets(183,5): error :   Command /Users/builder/android-toolchain/sdk/platform-tools/adb -s emulator-5570  shell run-as Mono.Android_Tests cat "/data/user/0/Mono.Android_Tests/files/.__overrid
e__/TestResults.xml" failed with exit code 1 [/Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/tests/RunApkTests.targets]


"/Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/build-tools/scripts/RunTests.targets" (RunAllTests target) (1) ->
"/Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/build-tools/scripts/RunTests.targets" (RunApkTests target) (1:4) ->
"/Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/tests/RunApkTests.targets" (default target) (4:2) ->
  /Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/build-tools/scripts/TestApks.targets(183,5): error :   Command /Users/builder/android-toolchain/sdk/platform-tools/adb   shell run-as Mono.Android_Tests cat "/data/user/0/Mono.Android_Tests/files/.__override__/TestResults.
xml" failed with exit code 1 [/Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/tests/RunApkTests.targets]


"/Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/build-tools/scripts/RunTests.targets" (RunAllTests target) (1) ->
"/Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/build-tools/scripts/RunTests.targets" (RunApkTests target) (1:4) ->
"/Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/tests/RunApkTests.targets" (default target) (4:3) ->
  /Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/build-tools/scripts/TestApks.targets(183,5): error :   Command /Users/builder/android-toolchain/sdk/platform-tools/adb   shell run-as Mono.Android_Tests cat "/data/user/0/Mono.Android_Tests/files/.__override__/TestResults.
xml" failed with exit code 1 [/Users/builder/jenkins/workspace/xamarin-android-pr-builder/xamarin-android/tests/RunApkTests.targets]

But I see no actual error in the logs. Just the exit status. The failed tests are for the Release build and they DID succeed (just as their Debug run) - copying of the results file was what failed. As such I'd love for this PR to be merged... I can't find what's wrong with the PR builder and all of those tests DO work (and I get no failures copying result files when they run locally, too)

@jonpryor jonpryor merged commit 2e8f96f into dotnet:master Sep 7, 2018
@grendello grendello deleted the fix-aot-build branch September 7, 2018 15:56
@jonpryor jonpryor mentioned this pull request Sep 10, 2018
radekdoulik added a commit to radekdoulik/xamarin-android that referenced this pull request Nov 2, 2018
Fixes dotnet#2371

After dotnet#2125, the
`RunInstrumentationTests` task stopped writing the logcat output to
the `LogcatFilename` specified as parameter.

That resulted in missing input files for the `ProcessLogcatTiming`
task.
radekdoulik added a commit that referenced this pull request Nov 6, 2018
* [build-tools] Write the intrumentation timing output again

Fixes #2371

After #2125, the
`RunInstrumentationTests` task stopped writing the logcat output to
the `LogcatFilename` specified as parameter.

That resulted in missing input files for the `ProcessLogcatTiming`
task.

Just ask to append to the file. We don't need to check, whether
the file exists.
@github-actions github-actions bot locked and limited conversation to collaborators Feb 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
full-mono-integration-build For PRs; run a full build (~6-10h for mono bumps), not the faster PR subset (~2h for mono bumps)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants