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 $(DestinationSubDirectory) double slash #9186

Merged
merged 3 commits into from
Aug 12, 2024

Conversation

jonathanpeppers
Copy link
Member

I noticed in a .binlog in .NET 9:

ProcessAssemblies
    ...
    OutputItems
        ...
        D:\.nuget\packages\microsoft.maui.controls.core\9.0.0-preview.7.24407.4\lib\net9.0-android35.0\ar\Microsoft.Maui.Controls.resources.dll
            DestinationSubDirectory = arm64-v8a\ar\\

I believe this causes an issue, later down the line:

FastDeploy
...
Remove redundant file files/.__override__/arm64-v8a/ar/Microsoft.Maui.Controls.resources.dll

So, <FastDeploy/> seems to delete every Microsoft.Maui.Controls.resources.dll file, because it is passed in:

obj\Debug\net9.0-android\android\assets\arm64-v8a\ar\Microsoft.Maui.Controls.resources.dll
TargetPath = arm64-v8a\ar\\Microsoft.Maui.Controls.resources.dll

I think this was introduced in 86260ed, we can fix it by only appending to %(DestinationSubDirectory) if it doesn't end with a DirectorySeparatorChar.

There may be additional safety we could add to the <FastDeploy/> task, in a separate PR.

To test this going forward, I'm going to review our MSBuild performance tests, and see if we can adjust the timings there.

… slash

I noticed in a `.binlog` in .NET 9:

    ProcessAssemblies
        ...
        OutputItems
            ...
            D:\.nuget\packages\microsoft.maui.controls.core\9.0.0-preview.7.24407.4\lib\net9.0-android35.0\ar\Microsoft.Maui.Controls.resources.dll
                DestinationSubDirectory = arm64-v8a\ar\\

I believe this causes an issue, later down the line:

    FastDeploy
    ...
    Remove redundant file files/.__override__/arm64-v8a/ar/Microsoft.Maui.Controls.resources.dll

So, `<FastDeploy/>` seems to delete every `Microsoft.Maui.Controls.resources.dll`
file, because it is passed in:

    obj\Debug\net9.0-android\android\assets\arm64-v8a\ar\Microsoft.Maui.Controls.resources.dll
    TargetPath = arm64-v8a\ar\\Microsoft.Maui.Controls.resources.dll

I think this was introduced in 86260ed, we can fix it by only
appending to `%(DestinationSubDirectory)` if it *doesn't* end with a
`DirectorySeparatorChar`.

There may be additional safety we could add to the `<FastDeploy/>` task,
in a separate PR.

To test this going forward, I'm going to review our MSBuild performance
tests, and see if we can adjust the timings there.
jonathanpeppers added a commit to jonathanpeppers/xamarin-android that referenced this pull request Aug 9, 2024
This is testing what the current times are.

I'll rework this, after some of the current build performance fixes
make it in:

* xamarin/monodroid#1535
* dotnet#9186
@jonathanpeppers
Copy link
Member Author

Hmm, this change must have brought some other bugs to the surface:

         [BT : 1.17.0] error : Unrecognized native architecture for directory 'lib/cs'. [/Users/runner/work/1/a/TestRelease/08-09_17.24.30/temp/BuildHasNoWarningsFalseFalseFalseaab/UnnamedProject.csproj]
         /Users/runner/work/1/s/bin/Release/dotnet/packs/Microsoft.Android.Sdk.Darwin/35.0.0-ci.pr.gh9186.48/tools/Xamarin.Android.Common.targets(2137,3): error XABAB0000: [BT:1.17.0] Error: Unrecognized native architecture for directory 'lib/cs'

I wonder if files were in lib/cs// before, and that somehow worked?

@dellis1972
Copy link
Contributor

Hmm, this change must have brought some other bugs to the surface:

         [BT : 1.17.0] error : Unrecognized native architecture for directory 'lib/cs'. [/Users/runner/work/1/a/TestRelease/08-09_17.24.30/temp/BuildHasNoWarningsFalseFalseFalseaab/UnnamedProject.csproj]
         /Users/runner/work/1/s/bin/Release/dotnet/packs/Microsoft.Android.Sdk.Darwin/35.0.0-ci.pr.gh9186.48/tools/Xamarin.Android.Common.targets(2137,3): error XABAB0000: [BT:1.17.0] Error: Unrecognized native architecture for directory 'lib/cs'

I wonder if files were in lib/cs// before, and that somehow worked?

I think they should now be in abi subdirectories.

@jonathanpeppers jonathanpeppers merged commit b69ad9e into dotnet:main Aug 12, 2024
57 checks passed
@jonathanpeppers jonathanpeppers deleted the DestinationSubDirectory branch August 12, 2024 18:58
jonathanpeppers added a commit to jonathanpeppers/xamarin-android that referenced this pull request Aug 20, 2024
This is testing what the current times are.

I'll rework this, after some of the current build performance fixes
make it in:

* xamarin/monodroid#1535
* dotnet#9186
@github-actions github-actions bot locked and limited conversation to collaborators Sep 12, 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