-
Notifications
You must be signed in to change notification settings - Fork 538
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
Another set of changes from #9572 #9807
Conversation
@grendello: Windows fails to build:
|
cacdf4d
to
0d3ea36
Compare
@@ -48,6 +49,8 @@ internal struct JnienvInitializeArgs { | |||
|
|||
internal static JniRuntime? androidRuntime; | |||
|
|||
public static DotNetRuntimeType RuntimeType { get; private set; } = DotNetRuntimeType.Unknown; |
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.
Could this value be set by a trimmer switch instead of passing it in?
The build knows the runtime it targets, so it could do the work at build time.
This would make this property treated as a constant and code for other runtimes would be trimmed away.
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 think that eventually turning it into a trimmer feature is the goal. But right now, I need it to be a runtime check since I sometimes work without the trimmer
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.
Trimmer feature switches use AppContext.TryGetSwitch()
if the app isn't trimmed, here is an example:
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 disagree on both counts: I'd rather avoid the trimmer switch until we actually need it, and I don't see why we want/need this RuntimeType
field as well.
See e.g. #9812: any place that would be "switching" on RuntimeType
is probably better served as a virtual method invocation on JNIEnvInit.androidRuntime
or equivalent.
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.
That might be the better solution, but we can make that change at a later time, when everything is in main
, I think
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
By convention (and often enforced requirement), `$(OutputPath)` ends with `\`, which means that quoting it for use with `<Exec/>`: <Exec Command="whatever "$(OutputPath)"" /> will often result in an *invalid* command, because the `\` escapes the quote! whatever "C:\path\to\output\" # ruh roh! The fix is to instead use `$(OutputPath.OutputPath.TrimEnd('\')`, which ensures that the path does *not* end in `\`, preventing the unintentional escape usage: whatever "C:\path\to\output" # yay!
Co-authored-by: Jonathan Peppers <[email protected]>
Context: https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=11036370&view=ms.vss-test-web.build-test-results-tab&runId=122368005&resultId=100098&paneView=attachments Will hopefully fix/avoid the build error: D:\a\_work\1\s\bin\Release\dotnet\packs\Microsoft.Android.Sdk.Windows\35.99.0-ci.dev-grendel-clr-bits-two.174\tools\Xamarin.Android.Common.targets(1509,3): error XAGJS7015: System.NotSupportedException: Internal error: unsupported runtime NativeAOT [D:\a\_work\1\a\TestRelease\02-19_09.11.14\temp\NativeAOT\Hello.csproj] D:\a\_work\1\s\bin\Release\dotnet\packs\Microsoft.Android.Sdk.Windows\35.99.0-ci.dev-grendel-clr-bits-two.174\tools\Xamarin.Android.Common.targets(1509,3): error XAGJS7015: at Xamarin.Android.Tasks.TypeMapGenerator.GenerateRelease(Boolean skipJniAddNativeMethodRegistrationAttributeScan, String outputDirectory) in /Users/builder/azdo/_work/4/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Utilities/TypeMapGenerator.cs:line 452 [D:\a\_work\1\a\TestRelease\02-19_09.11.14\temp\NativeAOT\Hello.csproj] D:\a\_work\1\s\bin\Release\dotnet\packs\Microsoft.Android.Sdk.Windows\35.99.0-ci.dev-grendel-clr-bits-two.174\tools\Xamarin.Android.Common.targets(1509,3): error XAGJS7015: at Xamarin.Android.Tasks.TypeMapGenerator.Generate(Boolean debugBuild, Boolean skipJniAddNativeMethodRegistrationAttributeScan, String outputDirectory, Boolean generateNativeAssembly) in /Users/builder/azdo/_work/4/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Utilities/TypeMapGenerator.cs:line 175 [D:\a\_work\1\a\TestRelease\02-19_09.11.14\temp\NativeAOT\Hello.csproj] D:\a\_work\1\s\bin\Release\dotnet\packs\Microsoft.Android.Sdk.Windows\35.99.0-ci.dev-grendel-clr-bits-two.174\tools\Xamarin.Android.Common.targets(1509,3): error XAGJS7015: at Xamarin.Android.Tasks.GenerateJavaStubs.WriteTypeMappings(NativeCodeGenState state) in /Users/builder/azdo/_work/4/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Tasks/GenerateJavaStubs.cs:line 484 [D:\a\_work\1\a\TestRelease\02-19_09.11.14\temp\NativeAOT\Hello.csproj] D:\a\_work\1\s\bin\Release\dotnet\packs\Microsoft.Android.Sdk.Windows\35.99.0-ci.dev-grendel-clr-bits-two.174\tools\Xamarin.Android.Common.targets(1509,3): error XAGJS7015: at Xamarin.Android.Tasks.GenerateJavaStubs.Run(Boolean useMarshalMethods) in /Users/builder/azdo/_work/4/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Tasks/GenerateJavaStubs.cs:line 272 [D:\a\_work\1\a\TestRelease\02-19_09.11.14\temp\NativeAOT\Hello.csproj] D:\a\_work\1\s\bin\Release\dotnet\packs\Microsoft.Android.Sdk.Windows\35.99.0-ci.dev-grendel-clr-bits-two.174\tools\Xamarin.Android.Common.targets(1509,3): error XAGJS7015: at Xamarin.Android.Tasks.GenerateJavaStubs.RunTask() in /Users/builder/azdo/_work/4/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Tasks/GenerateJavaStubs.cs:line 115 [D:\a\_work\1\a\TestRelease\02-19_09.11.14\temp\NativeAOT\Hello.csproj] D:\a\_work\1\s\bin\Release\dotnet\packs\Microsoft.Android.Sdk.Windows\35.99.0-ci.dev-grendel-clr-bits-two.174\tools\Xamarin.Android.Common.targets(1509,3): error XAGJS7015: at Microsoft.Android.Build.Tasks.AndroidTask.Execute() in /Users/builder/azdo/_work/4/s/xamarin-android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/AndroidTask.cs:line 25 [D:\a\_work\1\a\TestRelease\02-19_09.11.14\temp\NativeAOT\Hello.csproj]
Context: 7d04764 Context: https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=11036370&view=ms.vss-test-web.build-test-results-tab&runId=122366823&resultId=100099&paneView=attachments Commit 7d04764 asserts that CoreCLR *builds*. This set of changes starts adding incremental support for CoreCLR, but typemap support is still lacking, meaning `BasicApplicationOtherRuntime(True)` fails: D:\a\_work\1\s\bin\Release\dotnet\packs\Microsoft.Android.Sdk.Windows\35.99.0-ci.dev-grendel-clr-bits-two.174\tools\Xamarin.Android.Common.targets(1509,3): error XAGJS7000: System.NotImplementedException: CoreCLR support not implemented yet [D:\a\_work\1\a\TestRelease\02-19_09.08.39\temp\BasicApplicationOtherRuntimeTrue\UnnamedProject.csproj] D:\a\_work\1\s\bin\Release\dotnet\packs\Microsoft.Android.Sdk.Windows\35.99.0-ci.dev-grendel-clr-bits-two.174\tools\Xamarin.Android.Common.targets(1509,3): error XAGJS7000: at Xamarin.Android.Tasks.TypeMapGenerator.GenerateRelease(Boolean skipJniAddNativeMethodRegistrationAttributeScan, String outputDirectory) in /Users/builder/azdo/_work/4/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Utilities/TypeMapGenerator.cs:line 451 [D:\a\_work\1\a\TestRelease\02-19_09.08.39\temp\BasicApplicationOtherRuntimeTrue\UnnamedProject.csproj] D:\a\_work\1\s\bin\Release\dotnet\packs\Microsoft.Android.Sdk.Windows\35.99.0-ci.dev-grendel-clr-bits-two.174\tools\Xamarin.Android.Common.targets(1509,3): error XAGJS7000: at Xamarin.Android.Tasks.TypeMapGenerator.Generate(Boolean debugBuild, Boolean skipJniAddNativeMethodRegistrationAttributeScan, String outputDirectory, Boolean generateNativeAssembly) in /Users/builder/azdo/_work/4/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Utilities/TypeMapGenerator.cs:line 175 [D:\a\_work\1\a\TestRelease\02-19_09.08.39\temp\BasicApplicationOtherRuntimeTrue\UnnamedProject.csproj] D:\a\_work\1\s\bin\Release\dotnet\packs\Microsoft.Android.Sdk.Windows\35.99.0-ci.dev-grendel-clr-bits-two.174\tools\Xamarin.Android.Common.targets(1509,3): error XAGJS7000: at Xamarin.Android.Tasks.GenerateJavaStubs.WriteTypeMappings(NativeCodeGenState state) in /Users/builder/azdo/_work/4/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Tasks/GenerateJavaStubs.cs:line 484 [D:\a\_work\1\a\TestRelease\02-19_09.08.39\temp\BasicApplicationOtherRuntimeTrue\UnnamedProject.csproj] D:\a\_work\1\s\bin\Release\dotnet\packs\Microsoft.Android.Sdk.Windows\35.99.0-ci.dev-grendel-clr-bits-two.174\tools\Xamarin.Android.Common.targets(1509,3): error XAGJS7000: at Xamarin.Android.Tasks.GenerateJavaStubs.Run(Boolean useMarshalMethods) in /Users/builder/azdo/_work/4/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Tasks/GenerateJavaStubs.cs:line 272 [D:\a\_work\1\a\TestRelease\02-19_09.08.39\temp\BasicApplicationOtherRuntimeTrue\UnnamedProject.csproj] D:\a\_work\1\s\bin\Release\dotnet\packs\Microsoft.Android.Sdk.Windows\35.99.0-ci.dev-grendel-clr-bits-two.174\tools\Xamarin.Android.Common.targets(1509,3): error XAGJS7000: at Xamarin.Android.Tasks.GenerateJavaStubs.RunTask() in /Users/builder/azdo/_work/4/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Tasks/GenerateJavaStubs.cs:line 115 [D:\a\_work\1\a\TestRelease\02-19_09.08.39\temp\BasicApplicationOtherRuntimeTrue\UnnamedProject.csproj] D:\a\_work\1\s\bin\Release\dotnet\packs\Microsoft.Android.Sdk.Windows\35.99.0-ci.dev-grendel-clr-bits-two.174\tools\Xamarin.Android.Common.targets(1509,3): error XAGJS7000: at Microsoft.Android.Build.Tasks.AndroidTask.Execute() in /Users/builder/azdo/_work/4/s/xamarin-android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/AndroidTask.cs:line 25 [D:\a\_work\1\a\TestRelease\02-19_09.08.39\temp\BasicApplicationOtherRuntimeTrue\UnnamedProject.csproj] Skip LLVM-IR typemaps for CoreCLR for now.
This is needed until #9572 is merged, since the != 'NativeAOT' would enable the guarded code to run also for `CoreCLR`, which is not fully functional in this PR.
7be27a0
to
c6b29f2
Compare
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Some changes that affect the MonoVM runtime or are generic enough to be placed in
main
.