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

Move Debug Test first and Clean after runs #9380

Merged
merged 1 commit into from
Oct 9, 2024
Merged

Move Debug Test first and Clean after runs #9380

merged 1 commit into from
Oct 9, 2024

Conversation

dellis1972
Copy link
Contributor

@dellis1972 dellis1972 commented Oct 9, 2024

There is some odd build issue were Release artifacts are making into a Debug build of tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj. This only happens in this test project.

I suspect it is because we are overriding the $(Configuration) in the project, but not always since we are also building in a Release environment. Both the top level Configuration.props is using $(Configuration) as well as the test project, but the test project gets a value of Debug from the build yaml. I think it is confusing things, but I have not been able to track it down.

So lets try to clean up the tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj test project after it has been built and run. To make sure any old outputs are not there.
Also try running the Debug test first, so its running in a clean environment.

@dellis1972 dellis1972 marked this pull request as ready for review October 9, 2024 12:11
@jonpryor
Copy link
Member

jonpryor commented Oct 9, 2024

I think this link is also related/relevant?

  • https://discord.com/channels/732297728826277939/732297837953679412/1291713866409181280

    for the Release builds with runtime linking enabled, libxamarin-app.so shouldn't be produced at all, the one you see in the pack is the "stub" one we build with native code but never ship
    it's built only so that libmonodroid.so we build can link against it
    and then libxamarin-app.so built together with the app conforms to the same ABI and has the same name, so at runtime libmonodroid.so can resolve it
    but none of that takes place with libmonodroid-unified.so - this one has everyhing built into it, including the bits that make up libxamarin-app.so in a regular build
    Debug build should include it, as runtime linking is not enabled - but libmonodroid.so should be the one we build with XA, not the dynamically linked one

@jonpryor
Copy link
Member

jonpryor commented Oct 9, 2024

Context: https://discord.com/channels/732297728826277939/732297837953679412/1291713866409181280
Context: https://github.com/dotnet/android/pull/9006

There are some odd build issue were Release artifacts were present in
the Debug configuration build of
`tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj`.

> [when testing with #9006]
> for the `Release` builds with runtime linking enabled, `libxamarin-app.so`
> shouldn't be produced at all, the one you see in the pack is the "stub" one
> we build with `native` code but never ship
> it's built only so that `libmonodroid.so` we build can link against it
> and then `libxamarin-app.so` built together with the app conforms to the same
> ABI and has the same name, so at runtime `libmonodroid.so` can resolve it
> but none of that takes place with `libmonodroid-unified.so` - this one has
> everyhing built into it, including the bits that make up `libxamarin-app.so`
> in a regular build.
> 
> `Debug` build should include it, as runtime linking is not enabled - but
> `libmonodroid.so` should be the one we build with XA, not the dynamically
> linked one

This only happens in this test project.

I suspect it is because we are overriding `$(Configuration)` in the
project, but not always since we are also building in a `Release`
environment.  Both the top level `Configuration.props` is using
`$(Configuration)` as well as the test project, but the test project
gets a value of `Debug` from the build yaml.  I think it is confusing
things, but I have not been able to track it down.

Lets try to clean up the `Mono.Android.NET-Tests.csproj` test project
after it has been built and run, to make sure any old outputs are not
there.

Also try running the `Debug` test first, so that it's running in a
clean environment. 

@jonpryor jonpryor merged commit e55c38f into main Oct 9, 2024
58 checks passed
@jonpryor jonpryor deleted the cleanafterrun branch October 9, 2024 12:43
@github-actions github-actions bot locked and limited conversation to collaborators Nov 9, 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