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

[build] fix incremental build for RuntimeLists.xml #9327

Merged
merged 1 commit into from
Sep 25, 2024

Conversation

jonathanpeppers
Copy link
Member

In 5ebcb1d, a new libarchive-dso-stub.so file was added to Microsoft.Android.Runtime.proj and runtime packs, but I started getting build failures for any app, such as:

bin\Debug\lib\packs\Microsoft.Android.Sdk.Windows\35.0.0\tools\Xamarin.Android.Common.Debugging.targets(139,2): error XABLD7009: System.InvalidOperationException: Internal error: archive DSO stub location not known for architecture 'Arm64'
at Xamarin.Android.Tasks.DSOWrapperGenerator.WrapIt(AndroidTargetArch targetArch, String payloadFilePath, String outputFileName, IBuildEngine4 buildEngine, TaskLoggingHelper log) in src\Xamarin.Android.Build.Tasks\Utilities\DSOWrapperGenerator.cs:line 86
at Xamarin.Android.Tasks.BuildApk.AddRuntimeConfigBlob(ZipArchiveEx apk) in src\Xamarin.Android.Build.Tasks\Tasks\BuildApk.cs:line 408
at Xamarin.Android.Tasks.BuildApk.ExecuteWithAbi(String[] supportedAbis, String apkInputPath, String apkOutputPath, Boolean debug, Boolean compress, IDictionary`2 compressedAssembliesInfo, String assemblyStoreApkName) in src\Xamarin.Android.Build.Tasks\Tasks\BuildApk.cs:line 215
at Xamarin.Android.Tasks.BuildApk.RunTask() in src\Xamarin.Android.Build.Tasks\Tasks\BuildApk.cs:line 357
at Microsoft.Android.Build.Tasks.AndroidTask.Execute() in external\xamarin-android-tools\src\Microsoft.Android.Build.BaseTasks\AndroidTask.cs:line 25

Reviewing a build log and files on disk, I saw this line was missing from RuntimeList.xml:

<File Type="Native" Path="runtimes/android-x64/native/libarchive-dso-stub.so" FileVersion="0.0.0.0" Profile="Android" />

This causes the build to not include the .so file, as this is the general logic for .NET workloads and runtime packs.

To fix this, we need to change the Inputs of the CreateLocalRuntimeLists target that generates this file:

--$(MSBuildThisFile)
++$(MSBuildAllProjects)

This way if Microsoft.Android.Runtime.proj changes in the future, the targets will run.

I also fixed CreateLocalFrameworkLists for FrameworkList.xml.

In 5ebcb1d, a new `libarchive-dso-stub.so` file was added to
`Microsoft.Android.Runtime.proj` and runtime packs, but I started
getting build failures for any app, such as:

    bin\Debug\lib\packs\Microsoft.Android.Sdk.Windows\35.0.0\tools\Xamarin.Android.Common.Debugging.targets(139,2): error XABLD7009: System.InvalidOperationException: Internal error: archive DSO stub location not known for architecture 'Arm64'
    at Xamarin.Android.Tasks.DSOWrapperGenerator.WrapIt(AndroidTargetArch targetArch, String payloadFilePath, String outputFileName, IBuildEngine4 buildEngine, TaskLoggingHelper log) in src\Xamarin.Android.Build.Tasks\Utilities\DSOWrapperGenerator.cs:line 86
    at Xamarin.Android.Tasks.BuildApk.AddRuntimeConfigBlob(ZipArchiveEx apk) in src\Xamarin.Android.Build.Tasks\Tasks\BuildApk.cs:line 408
    at Xamarin.Android.Tasks.BuildApk.ExecuteWithAbi(String[] supportedAbis, String apkInputPath, String apkOutputPath, Boolean debug, Boolean compress, IDictionary`2 compressedAssembliesInfo, String assemblyStoreApkName) in src\Xamarin.Android.Build.Tasks\Tasks\BuildApk.cs:line 215
    at Xamarin.Android.Tasks.BuildApk.RunTask() in src\Xamarin.Android.Build.Tasks\Tasks\BuildApk.cs:line 357
    at Microsoft.Android.Build.Tasks.AndroidTask.Execute() in external\xamarin-android-tools\src\Microsoft.Android.Build.BaseTasks\AndroidTask.cs:line 25

Reviewing a build log and files on disk, I saw this line was missing
from `RuntimeList.xml`:

    <File Type="Native" Path="runtimes/android-x64/native/libarchive-dso-stub.so" FileVersion="0.0.0.0" Profile="Android" />

This causes the build to not include the `.so` file, as this is the
general logic for .NET workloads and runtime packs.

To fix this, we need to change the `Inputs` of the
`CreateLocalRuntimeLists` target that generates this file:

    --$(MSBuildThisFile)
    ++$(MSBuildAllProjects)

This way if `Microsoft.Android.Runtime.proj` changes in the future,
the targets will run.

I also fixed `CreateLocalFrameworkLists` for `FrameworkList.xml`.
@jonathanpeppers
Copy link
Member Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jonathanpeppers
Copy link
Member Author

APK tests have some networking failures: System.Net.Http.HttpRequestException : net_http_message_not_success_statuscode_reason, 502, Bad Gateway

Otherwise looks green.

@jonathanpeppers jonathanpeppers merged commit c0c12bb into dotnet:main Sep 25, 2024
54 of 57 checks passed
@jonathanpeppers jonathanpeppers deleted the RuntimeLists.xml branch September 25, 2024 19:30
@github-actions github-actions bot locked and limited conversation to collaborators Oct 26, 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.

3 participants