Skip to content

Add user-facing docs and samples for NativeAOT - #64894

Merged
MichalStrehovsky merged 5 commits into
dotnet:mainfrom
MichalStrehovsky:naotdocs
Feb 8, 2022
Merged

MichalStrehovsky merged 5 commits into
dotnet:mainfrom
MichalStrehovsky:naotdocs

Conversation

@MichalStrehovsky

Copy link
Copy Markdown
Member

No description provided.

@am11

am11 commented Feb 7, 2022 •

Copy link
Copy Markdown
Member

Some user-facing runtime samples were moved to the common samples repo under https://github.com/dotnet/samples/tree/main/core (for easy discoverability).
Should we move these samples there and link that tree in the docs?

@MichalStrehovsky

Copy link
Copy Markdown
Member Author

Some user-facing runtime samples were moved to the common samples repo under https://github.com/dotnet/samples/tree/main/core (for easy discoverability). Should we move these samples there and link that tree in the docs?

Didn't know about that - thanks! That sounds good to me. @jkotas?

@jkotas

jkotas commented Feb 7, 2022

Copy link
Copy Markdown
Member

Sounds good to me as well.

Comment thread src/coreclr/nativeaot/docs/compiling.md Resolved

@kant2002 kant2002 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A lot of small pedantic remarks

Comment thread src/coreclr/nativeaot/docs/compiling.md Resolved
Comment thread src/coreclr/nativeaot/docs/compiling.md Resolved
Comment thread src/coreclr/nativeaot/docs/interop.md Outdated

The native AOT compiler will export methods annotated with `UnmanagedCallersOnlyAttribute` and explicitly specified name as
public C entrypoints. It makes it possible to either dynamically or statically link the AOT compiled modules into external
programs. More details are in [NativeLibrary Sample](../../samples/NativeLibrary).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If samples would be in separate repo, I think link should point to new location


* `<IlcGenerateStackTraceData>false</IlcGenerateStackTraceData>`: this disables generation of stack trace metadata that provides textual names in stack traces. This is for example the text string one gets by calling `Exception.ToString()` on a caught exception. With this option disabled, stack traces will still be generated, but will be based on reflection metadata alone (they might be less complete).
* `<IlcTrimMetadata>true</IlcTrimMetadata>`: allows the compiler to remove reflection metadata from things that were not visible targets of reflection. By default, the compiler keeps metadata for everything that was compiled. With this option turned on, reflection metadata (and therefore reflection) will only be available for visible targets of reflection. Visible targets of reflection are things like assemblies rooted from the project file, RD.XML, ILLinkTrim descriptors, DynamicallyAccessedMembers annotations or DynamicDependency annotations.
* `<IlcDisableReflection>true</IlcDisableReflection>`: this completely disables the reflection metadata generation. Very basic reflection will still work (you can still use `typeof`, call `Object.GetType()`, compare the results, and query for basic properties such as `Type.IsValueType` or `Type.BaseType`), but most of the reflection stack will no longer work (no way to query/access methods and fields on types, or get names of types). This mode is experimental - more details in the [Reflection free mode](reflection-free-mode.md) document.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Here reflection-free is experimental. I was scolded about my burning passion to that mode couple times. Should “experimental” be changed to something more neutral?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

What wording are you looking for? The mode as it is very unlikely to be ever supported. It's provided as-is, with no servicing guarantees.

@@ -0,0 +1,9 @@
# Troubleshooting CoreRT compiler

Sometimes you want to have more information how CoreRT work. ILC Compiler provide couple switches for that:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
Sometimes you want to have more information how CoreRT work. ILC Compiler provide couple switches for that:
Sometimes you want to have more information how NativeAOT work. ILC Compiler provide couple switches for that:

@MichalStrehovsky
MichalStrehovsky merged commit 4c662b1 into dotnet:main Feb 8, 2022
@MichalStrehovsky
MichalStrehovsky deleted the naotdocs branch February 8, 2022 07:39
@ghost ghost locked as resolved and limited conversation to collaborators Mar 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants