-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add -aot
parameter to the console template
#31739
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,13 @@ | |
<LangVersion Condition="'$(langVersion)' != ''">$(ProjectLanguageVersion)</LangVersion> | ||
<ImplicitUsings Condition="'$(csharpFeature_ImplicitUsings)' == 'true'">enable</ImplicitUsings> | ||
<Nullable Condition="'$(csharpFeature_Nullable)' == 'true'">enable</Nullable> | ||
<!--#if (NativeAot) --> | ||
<PublishAot>true</PublishAot> | ||
<InvariantGlobalization>true</InvariantGlobalization> | ||
|
||
<!-- Uncomment below line to make native publish outputs a lot smaller on Linux and macOS --> | ||
<!-- <StripSymbols>true</StripSymbols> --> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should follow the same approach for ASP.NET and Hosting templates. We shouldn't have different strategies for the different templates if there are no technical reasons for it. We should decide here if this is the strategy we want to take, and apply it in all templates. I also think that this just clutters the template. IMHO - I think There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I think this is the crux of it. Lot of feedback I heard was that .NET Devs expect debuggability by default, which would mean we have to leave the symbols there. Another view is what is the typical behavior for the target platform (Linux, containers). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I forgot to add that I think there's a difference between symbols for managed assemblies and symbols for native AOT. Managed assemblies are debugable even without symbols, the symbols only improve the experience somewhat. Native AOT is completely undebugable without symbols. To me that is the key difference between the two and why I think we should treat them separately. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we base it on There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Personally I don't think so - but I have no hard data. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we decide to default
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's still worth adding the option to the template if for nothing else that visibility and discovery that native AOT is now a first-class option. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This would not work well even if we wanted to. Many tools infer the file format from the extension. If we started giving .pdb extension to DWARF files, it would be endless source of breaks. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could maybe go with .pdb.dbg/.pdb.dwarf. It's just whether we want people to know these are the debugging symbols, not a vital part of a non-single-file app. We assume .NET developers don't know about the underlying platform. But I guess this would be orthogonal to this PR and at this point it would also be a "breaking" change from 7.0 (so will be the new default though). @dotnet/templating-engine-maintainers could someone have a look? I think we settled on the non-technical questions and we might tweak this based on the defaults in the coming weeks. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I do not think we need to go this far. People will need to learn some amount of platform specific details in any case. The problem is that we do not have a good trigger for learning about symbols today. People do not read the manual; they just try to do stuff. We have seen many variants of a story that goes like this: Somebody builds a native AOT binary on Linux for the first time, sees a single giant binary in the publish folder, and concludes that this technology is unusable. I think that having two files - one smaller executable and one large non-executable - would be good enough to trigger the learning even without the .pdb hint. Seeing two files will make people ask why there are two files, whether they need both, etc. |
||
<!--#endif --> | ||
</PropertyGroup> | ||
|
||
</Project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,5 +6,11 @@ | |
"add": [], | ||
"remove": [ "Common" ] | ||
} | ||
], | ||
"symbolInfo": [ | ||
{ | ||
"id": "NativeAot", | ||
"isVisible": true | ||
} | ||
] | ||
} |
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've struggled a bit with the level of detail here. We don't want paragraphs of text that explain native debuggers/profilers/etc may or may not support GNU debuglink and if they don't extra steps are needed to make sense of the resulting binary, etc. Most people will be fine because most tools do support it.
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.
What about making an aka.ms link, and then you can point it to docs that explains it fully?