Skip to content

Commit

Permalink
Disable failing outerloop tests and fix a build issue in MonoAOTCompiler
Browse files Browse the repository at this point in the history
See #89921 for the test failures.

Additionally, the Android build was failing while compiling an AOT test due to this error:

```
/__w/1/s/artifacts/bin/Android.Device_Emulator.Aot.Test/Release/net8.0/android-x64/AppBundle/modules.c:51:6: error: no previous prototype for function 'register_aot_modules' [-Werror,-Wmissing-prototypes]
void register_aot_modules ()
     ^
```

This is because we turned on `-Werror=missing-prototypes` in #89197 but the MonoAOTCompiler didn't emit a function prototype in modules.c

Fixes #89566
  • Loading branch information
akoeplinger committed Aug 3, 2023
1 parent b2e18f8 commit 4e7d639
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,7 @@ public static void TaskRunSyncTest14()
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/89921", typeof(PlatformDetection), nameof(PlatformDetection.IsAlpine), nameof(PlatformDetection.IsMonoRuntime))]
[OuterLoop]
public static void TaskRunSyncTest15()
{
Expand All @@ -541,6 +542,7 @@ public static void TaskRunSyncTest16()
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/89921", typeof(PlatformDetection), nameof(PlatformDetection.IsAlpine), nameof(PlatformDetection.IsMonoRuntime))]
[OuterLoop]
public static void TaskRunSyncTest17()
{
Expand All @@ -550,6 +552,7 @@ public static void TaskRunSyncTest17()
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/89921", typeof(PlatformDetection), nameof(PlatformDetection.IsAlpine), nameof(PlatformDetection.IsMonoRuntime))]
[OuterLoop]
public static void TaskRunSyncTest18()
{
Expand All @@ -558,6 +561,7 @@ public static void TaskRunSyncTest18()
test.RealRun();
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/89921", typeof(PlatformDetection), nameof(PlatformDetection.IsAlpine), nameof(PlatformDetection.IsMonoRuntime))]
[OuterLoop]
public static void TaskRunSyncTest19()
{
Expand All @@ -567,6 +571,7 @@ public static void TaskRunSyncTest19()
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/89921", typeof(PlatformDetection), nameof(PlatformDetection.IsAlpine), nameof(PlatformDetection.IsMonoRuntime))]
[OuterLoop]
public static void TaskRunSyncTest20()
{
Expand All @@ -591,6 +596,7 @@ public static void TaskRunSyncTest22()
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/89921", typeof(PlatformDetection), nameof(PlatformDetection.IsAlpine), nameof(PlatformDetection.IsMonoRuntime))]
[OuterLoop]
public static void TaskRunSyncTest23()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ public static void RunBuggySchedulerTests()

[Fact]
[OuterLoop]
[ActiveIssue("https://github.com/dotnet/runtime/issues/89921", typeof(PlatformDetection), nameof(PlatformDetection.IsAlpine), nameof(PlatformDetection.IsMonoRuntime))]
public static void RunSynchronizationContextTaskSchedulerTests()
{
// Remember the current SynchronizationContext, so that we can restore it
Expand Down
2 changes: 1 addition & 1 deletion src/tasks/AndroidAppBuilder/Templates/monodroid.c
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ Java_net_dot_MonoRunner_initRuntime (JNIEnv* env, jobject thiz, jstring j_files_
for (int i = 0; i < args_len; ++i)
{
jstring j_arg = (*env)->GetObjectArrayElement(env, j_args, i);
managed_argv[i + 1] = (*env)->GetStringUTFChars(env, j_arg, NULL);
managed_argv[i + 1] = (char*)((*env)->GetStringUTFChars(env, j_arg, NULL));
}

int res = mono_droid_runtime_init (executable, managed_argc, managed_argv, current_local_time);
Expand Down
4 changes: 3 additions & 1 deletion src/tasks/AotCompilerTask/MonoAOTCompiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1106,7 +1106,8 @@ private bool GenerateAotModulesTable(IEnumerable<ITaskItem> assemblies, string[]
{
writer.WriteLine($"extern void *{symbol};");
}
writer.WriteLine("void register_aot_modules ()");
writer.WriteLine("void register_aot_modules (void);");
writer.WriteLine("void register_aot_modules (void)");
writer.WriteLine("{");
foreach (var symbol in symbols)
{
Expand Down Expand Up @@ -1142,6 +1143,7 @@ private bool GenerateAotModulesTable(IEnumerable<ITaskItem> assemblies, string[]
writer.WriteLine($"extern void *{symbol};");
}

writer.WriteLine("void register_aot_modules (void);");
writer.WriteLine("void register_aot_modules (void)");
writer.WriteLine("{");
foreach (var symbol in symbols)
Expand Down

0 comments on commit 4e7d639

Please sign in to comment.