-
Notifications
You must be signed in to change notification settings - Fork 531
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
[native] Real shared libraries in APK /lib
directories
#9154
Merged
Merged
Changes from 14 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
cc9b685
DSO stub
grendello d55e170
Build archive DSO stub in a separate step
grendello e6cacf0
Wrapping works for some items already
grendello 44fdba4
Wrapping continued
grendello f9b71fa
Things appear to work fine locally...
grendello dbc7e46
Add support for stores inside real ELF libraries
grendello 259e4b7
Don't use generics here
grendello 38e0bd5
Well. OK. Umm. Fixed.
grendello fcc7d6e
Let's see what that'll do
grendello 525fcf0
Fixes
grendello 38ae1bc
Bump LLVM toolchain to 18.1.8
grendello 3f7b329
Back to LLVM 18.1.6
grendello f3f19c2
Update apkdesc
grendello d55e91a
Use a coded error
grendello e20ec1d
Address feedback
grendello 2377f07
Update TOC.yml
jonpryor cc8fffa
Update embedded-assemblies.hh
jonpryor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
title: .NET for Android error XA0142 | ||
description: XA0141 error code | ||
ms.date: 11/09/2024 | ||
--- | ||
# .NET for Android warning XA0142 | ||
|
||
## Issue | ||
|
||
Command '{0}' failed.\n{1} | ||
|
||
## Solution | ||
|
||
Examine logged output of the failed command for indications of what caused the issue. If no immediate | ||
solution is suggested by the logged messages, please file an issue at https://github.com/dotnet/android | ||
including the full error message and steps that led to the command failing (possibly including a small | ||
repro application). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 10 additions & 1 deletion
11
src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
src/Xamarin.Android.Build.Tasks/Tasks/PrepareDSOWrapperState.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
|
||
using Microsoft.Build.Framework; | ||
using Microsoft.Android.Build.Tasks; | ||
using Xamarin.Android.Tools; | ||
|
||
namespace Xamarin.Android.Tasks; | ||
|
||
/// <summary> | ||
/// Registers a state object used by the DSOWrapperGenerator class later on during | ||
/// the build. This is to avoid having to pass parameters to some tasks (esp. BuildApk) | ||
/// which do not necessarily need those parameters directly. Registering the state here | ||
/// also avoids having to update monodroid whenever any required parameter is added to | ||
/// BuildApk. | ||
/// </summary> | ||
public class PrepareDSOWrapperState : AndroidTask | ||
{ | ||
public override string TaskPrefix => "PDWS"; | ||
|
||
[Required] | ||
public ITaskItem[] ArchiveDSOStubs { get; set; } | ||
|
||
[Required] | ||
public string AndroidBinUtilsDirectory { get; set; } | ||
|
||
[Required] | ||
public string BaseOutputDirectory { get; set; } | ||
|
||
public override bool RunTask () | ||
{ | ||
var stubPaths = new Dictionary<AndroidTargetArch, ITaskItem> (); | ||
|
||
foreach (ITaskItem stubItem in ArchiveDSOStubs) { | ||
string rid = stubItem.GetRequiredMetadata ("ArchiveDSOStub", "RuntimeIdentifier", Log); | ||
AndroidTargetArch arch = MonoAndroidHelper.RidToArch (rid); | ||
if (stubPaths.ContainsKey (arch)) { | ||
throw new InvalidOperationException ($"Internal error: duplicate archive DSO stub architecture '{arch}' (RID: '{rid}')"); | ||
} | ||
|
||
if (!File.Exists (stubItem.ItemSpec)) { | ||
throw new InvalidOperationException ($"Internal error: archive DSO stub file '{stubItem.ItemSpec}' does not exist"); | ||
} | ||
|
||
stubPaths.Add (arch, stubItem); | ||
} | ||
|
||
var config = new DSOWrapperGenerator.Config (stubPaths, AndroidBinUtilsDirectory, BaseOutputDirectory); | ||
BuildEngine4.RegisterTaskObjectAssemblyLocal (DSOWrapperGenerator.RegisteredConfigKey, config, RegisteredTaskObjectLifetime.Build); | ||
|
||
return !Log.HasLoggedErrors; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these be going to an MSBuild log instead of
Console
? They won't appear in log files.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm on a fence about these. I find them useful when looking for reasons why a test failed because of changes in the assembly store etc formats when I run the tests locally, but they're not going to be useful in general so they'd just pollute logs for no real gain.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only downside is they will be emitting stuff on users machines as well, especially those building on VScode or CLI. And no amount of setting the log verbosity will get rid of them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are only used in tests, this code doesn't run as part of a regular app build.