Skip to content

Conversation

@rolfbjarne
Copy link
Member

Use Mono's RuntimeConfigParserTask to parse the *.runtimeconfig.json file and
produce a binary version of it. This way Mono doesn't have to do json parsing
at runtime, which makes it possible to make the runtimer smaller and execution
faster.

This also means implementing support for finding the on-disk location of the
file at runtime, and passing it to mono.

Ref: https://github.com/dotnet/runtime/blob/01b7e73cd378145264a7cb7a09365b41ed42b240/docs/design/mono/mobile-runtimeconfig-json.md

Fixes #11745.

….json. Fixes dotnet#11745.

Use Mono's RuntimeConfigParserTask to parse the *.runtimeconfig.json file and
produce a binary version of it. This way Mono doesn't have to do json parsing
at runtime, which makes it possible to make the runtimer smaller and execution
faster.

This also means implementing support for finding the on-disk location of the
file at runtime, and passing it to mono.

Ref: https://github.com/dotnet/runtime/blob/01b7e73cd378145264a7cb7a09365b41ed42b240/docs/design/mono/mobile-runtimeconfig-json.md

Fixes dotnet#11745.
@rolfbjarne rolfbjarne requested a review from spouliot as a code owner June 10, 2021 14:52
@rolfbjarne rolfbjarne added not-notes-worthy Ignore for release notes run-dotnet-tests Run all the .NET tests labels Jun 10, 2021
@rolfbjarne
Copy link
Member Author

CC @jonathanpeppers

<!-- App bundle creation tasks -->

<Target Name="_CreateRuntimeConfiguration"
Condition="'$(UseMonoRuntime)' != 'false'"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might also check here if $(GenerateRuntimeConfigurationFiles) is true?

If a user sets it to false in their project, I think the *.runtimeconfig.json file would not be created:

https://github.com/dotnet/sdk/blob/415f1b90e14ddbbcfd6e2cb2d91b27e72db54db0/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.targets#L238

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm yeah, good point, maybe we could even warn that some features won't work in that case.

Copy link
Contributor

@spouliot spouliot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which makes it possible to make the runtimer

typo runtime[r]

smaller and execution faster.

Any numbers ?


xamarin_initialize_runtime_config ();

rv = monovm_initialize (propertyCount, propertyKeys, propertyValues);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does not this call reset the values of the config file ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rolfbjarne
Copy link
Member Author

smaller and execution faster.

Any numbers ?

No, I didn't measure this, it's partially mentioned here: https://github.com/dotnet/runtime/blob/01b7e73cd378145264a7cb7a09365b41ed42b240/docs/design/mono/mobile-runtimeconfig-json.md#motivation, but I've also seen it elsewhere (although I don't remember exactly where anymore).

Copy link
Contributor

@spouliot spouliot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rolfbjarne ah, I see

This way Mono doesn't have to do json parsing at runtime, which makes it possible to make the runtimer smaller and execution faster.

and

To minimize the impact on the app startup time, the design constraints are as follows:

are two different things.

The format minimize the impact (size / perf) versus a textual JSON file.

However that theoretical as we have no such thing today. As such it will not be possible to make the runtime smaller and faster than what we have today.

I'm fine just delete that phrase when committing the PR.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

❌ [PR Build] Tests failed on Build ❌

Tests failed on Build.

API diff

✅ API Diff from stable

View API diff

API & Generator diff

API Diff (from PR only) (no change)
Generator Diff (no change)

GitHub pages

Results can be found in the following github pages (it might take some time to publish):

Test results

2 tests failed, 108 tests passed.

Failed tests

  • MSBuild tests/Integration: Failed (Execution failed with exit code 32)
  • DotNet tests: Failed (Execution failed with exit code 1)

Pipeline on Agent XAMBOT-1104.BigSur'
Merge 8798580 into 8ca5d5e

@vs-mobiletools-engineering-service2
Copy link
Collaborator

❌ [PR Build] Tests failed on Build ❌

Tests failed on Build.

API diff

✅ API Diff from stable

View API diff

API & Generator diff

API Diff (from PR only) (no change)
Generator Diff (no change)

GitHub pages

Results can be found in the following github pages (it might take some time to publish):

Test results

3 tests failed, 112 tests passed.

Failed tests

  • introspection/watchOS 32-bits - simulator/Debug (watchOS 5.0): Failed
  • MSBuild tests/Integration: Failed (Execution failed with exit code 32)
  • DotNet tests: Failed (Execution failed with exit code 1)

Pipeline on Agent XAMBOT-1104.BigSur'
Merge 30870b4 into 8bec55e

@vs-mobiletools-engineering-service2
Copy link
Collaborator

❌ [PR Build] Tests failed on Build ❌

Tests failed on Build.

API diff

✅ API Diff from stable

View API diff

API & Generator diff

API Diff (from PR only) (no change)
Generator Diff (no change)

GitHub pages

Results can be found in the following github pages (it might take some time to publish):

Test results

2 tests failed, 173 tests passed.

Failed tests

  • introspection/watchOS 32-bits - simulator/Debug (watchOS 5.0): Failed
  • DotNet tests: Failed (Execution failed with exit code 1)

Pipeline on Agent XAMBOT-1102.BigSur'
Merge 7a307d0 into 51f0651

@vs-mobiletools-engineering-service2
Copy link
Collaborator

❌ [PR Build] Tests failed on Build ❌

Tests failed on Build.

API diff

✅ API Diff from stable

View API diff

API & Generator diff

API Diff (from PR only) (no change)
Generator Diff (no change)

GitHub pages

Results can be found in the following github pages (it might take some time to publish):

Test results

2 tests failed, 173 tests passed.

Failed tests

  • introspection/watchOS 32-bits - simulator/Debug (watchOS 5.0): Failed
  • Generator tests/NUnit: Failed (Execution failed with exit code 1)

Pipeline on Agent XAMBOT-1104.BigSur'
Merge f255cc6 into 447c59d

@rolfbjarne
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@vs-mobiletools-engineering-service2
Copy link
Collaborator

🔥 Tests failed catastrophically on Build (no summary found). 🔥

Result file $(TEST_SUMMARY_PATH) not found.

Pipeline on Agent
Merge f255cc6 into 170ea55

@rolfbjarne
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@vs-mobiletools-engineering-service2
Copy link
Collaborator

❌ [PR Build] Tests failed on Build ❌

Tests failed on Build.

API diff

✅ API Diff from stable

View API diff

API & Generator diff

API Diff (from PR only) (no change)
Generator Diff (no change)

GitHub pages

Results can be found in the following github pages (it might take some time to publish):

Test results

3 tests failed, 172 tests passed.

Failed tests

  • monotouch-test/Mac [dotnet]/Debug [dotnet]: Failed (Test run crashed)
  • introspection/watchOS 32-bits - simulator/Debug (watchOS 5.0): Failed
  • Generator tests/NUnit: Failed (Execution failed with exit code 1)

Pipeline on Agent XAMBOT-1104.BigSur'
Merge f255cc6 into 170ea55

@rolfbjarne
Copy link
Member Author

Test failures are unrelated

@rolfbjarne rolfbjarne merged commit c8e854c into dotnet:main Jun 16, 2021
@rolfbjarne rolfbjarne deleted the coreclr-runtimeconfigparser branch June 16, 2021 13:22
@tipa
Copy link

tipa commented Feb 15, 2023

@rolfbjarne I get this warning (which was introduced by this PR) on a iOS extension:
/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/16.2.1024/targets/Xamarin.Shared.Sdk.targets(979,3): warning : Some features may not work correctly, because the generation of the runtime configure file (*.runtimeconfig.json) has been disabled. [/Users/.../ShareExtension/ShareExtension.csproj]

I have not set GenerateRuntimeConfigurationFiles to false, but when I set it to true explicitly, the warning disappears. On the main project, the warning does not show up, even without having to set GenerateRuntimeConfigurationFiles=false.
Is it safe to ignore the warning? Should I set GenerateRuntimeConfigurationFiles=false or does this have any unwanted side-effects?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

not-notes-worthy Ignore for release notes run-dotnet-tests Run all the .NET tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.NET: Generate a binary version of runtimeconfig.json for mobile targets

6 participants