-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Background
The compile time SDK can have significant impact on the resulting library. The global.json doesn't need to have definitive exact information, plus it's just optional.
With compiler flags we can get more precise info (based on research of top 150 nugets ~ 21% of those do not have the new verion of compiler flag, while exposing their sources - so it seems we can rely on compiler flags in substantial share of reconstructable packages).
Motivation
To notify user about possible resulting binary differences due to using mismatched SDK. Possibly offering to install and use matching SDK
Technical details
- Compiler flags contain "version" flag (https://github.com/dotnet/roslyn/blob/main/src/Compilers/Core/Portable/PEWriter/CompilationOptionNames.cs#LL18C29-L18C55)
- This is a Roslyn version, and there is currently no official link to the SDK (similar to VS:roslyn mapping https://learn.microsoft.com/en-us/visualstudio/extensibility/roslyn-version-support?view=vs-2022)
- But this can be built up crawling the sdk repo tags, then collecting the Microsoft.Net.Compilers.Toolset version from Version.Details.xml in sdk for the SHAs pointed by the tags
- The compiler flags can be extracted reusing the
NugetPackageExplorrercode (https://github.com/NuGetPackageExplorer/NuGetPackageExplorer/blob/main/Core/SymbolValidation/SymbolValidator.cs#L145), or possibly the Roslyn code (mostly internal though, https://github.com/dotnet/roslyn/blob/main/src/Tools/BuildValidator/Program.cs)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels