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

[Xamarin.Android.Build.Tasks] fix incremental builds for _GenerateAndroidRemapNativeCode #9548

Merged
merged 1 commit into from
Nov 26, 2024

Conversation

jonathanpeppers
Copy link
Member

I've noticed we are randomly seeing a test failure like:

Build_AndroidResource_Change
Exceeded expected time of 2250ms, actual 2992.086ms

Sometimes, it passes and sometimes not.

Reviewing the .binlog I noticed under the top 10 expensive tasks:

GenerateJniRemappingNativeCode = 97 ms, 1 calls.

Which I found by the target:

_GenerateEmptyAndroidRemapNativeCode
Building target "_GenerateEmptyAndroidRemapNativeCode" completely.
Input file "/Users/runner/work/1/a/TestRelease/11-21_21.07.33/temp/BuildAndroidResourceChange/UnnamedProject.csproj" is newer than output file "obj/Debug/android/jni_remap.x86_64.ll".

Which has the Inputs/Outputs:

Inputs="$(MSBuildProjectFullPath)"
Outputs="@(_AndroidRemapAssemblySource)"

Reviewing the target, it feels like we should fix the Inputs and Outputs, such as:

  • Inputs should include all MSBuild files @(_AndroidMSBuildAllProjects), as settings could be in Directory.Build.props, etc.

  • Inputs should include build.props if that file changes to force a rerun.

  • We should <Touch/> the Outputs files to prevent the target from running when it doesn't need to.

After these changes, I'm hoping Build_AndroidResource_Change passes more reliably, we will see.

…droidRemapNativeCode`

I've noticed we are randomly seeing a test failure like:

    Build_AndroidResource_Change
    Exceeded expected time of 2250ms, actual 2992.086ms

Sometimes, it passes and sometimes not.

Reviewing the `.binlog` I noticed under the top 10 expensive tasks:

    GenerateJniRemappingNativeCode = 97 ms, 1 calls.

Which I found by the target:

    _GenerateEmptyAndroidRemapNativeCode
    Building target "_GenerateEmptyAndroidRemapNativeCode" completely.
    Input file "/Users/runner/work/1/a/TestRelease/11-21_21.07.33/temp/BuildAndroidResourceChange/UnnamedProject.csproj" is newer than output file "obj/Debug/android/jni_remap.x86_64.ll".

Which has the `Inputs/Outputs`:

    Inputs="$(MSBuildProjectFullPath)"
    Outputs="@(_AndroidRemapAssemblySource)"

Reviewing the target, it feels like we should fix the `Inputs` and
`Outputs`, such as:

* `Inputs` should include all MSBuild files
  `@(_AndroidMSBuildAllProjects)`, as settings could be in
  `Directory.Build.props`, etc.

* `Inputs` should include `build.props` if that file changes to force
  a rerun.

* We should `<Touch/>` the `Outputs` files to prevent the target from
  running when it doesn't need to.

After these changes, I'm hoping `Build_AndroidResource_Change` passes
more reliably, we will see.
@jonathanpeppers
Copy link
Member Author

The APK test failures are networking, we can ignore those:

System.Net.Http.HttpRequestException : net_http_message_not_success_statuscode_reason, 502, Bad Gateway

@jonathanpeppers jonathanpeppers marked this pull request as ready for review November 22, 2024 18:07
@jonpryor jonpryor merged commit 406e43b into main Nov 26, 2024
58 checks passed
@jonpryor jonpryor deleted the dev/peppers/remap/targets branch November 26, 2024 19:36
@github-actions github-actions bot locked and limited conversation to collaborators Dec 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants