-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Reference ILLink analyzer matching ILLink version #32045
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
Changes from all commits
f8676bc
56eb009
cb9ebca
3faf371
2d58f8a
ddd8735
c6d71ae
63d8fec
ff9d366
e85c1b1
9a977f5
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 |
---|---|---|
|
@@ -44,7 +44,7 @@ public class ProcessFrameworkReferences : TaskBase | |
|
||
public bool ReadyToRunUseCrossgen2 { get; set; } | ||
|
||
public bool TrimmingEnabled { get; set; } | ||
public bool RequiresILLinkPack { get; set; } | ||
|
||
public bool AotEnabled { get; set; } | ||
|
||
|
@@ -384,7 +384,7 @@ var runtimeRequiredByDeployment | |
} | ||
} | ||
|
||
if (TrimmingEnabled) | ||
if (RequiresILLinkPack) | ||
{ | ||
if (!AddToolPack(ToolPackType.ILLink, _normalizedTargetFrameworkVersion, packagesToDownload, implicitPackageReferences)) | ||
{ | ||
|
@@ -712,6 +712,15 @@ private bool AddToolPack( | |
implicitPackageReferences.Add(buildPackage); | ||
} | ||
|
||
// Before net8.0, ILLink analyzers shipped in a separate package. | ||
// Add the analyzer package with version taken from KnownILLinkPack. | ||
if (normalizedTargetFrameworkVersion < new Version(8, 0) && toolPackType is ToolPackType.ILLink) | ||
{ | ||
var analyzerPackage = new TaskItem("Microsoft.NET.ILLink.Analyzers"); | ||
analyzerPackage.SetMetadata(MetadataKeys.Version, packVersion); | ||
implicitPackageReferences.Add(analyzerPackage); | ||
Comment on lines
+719
to
+721
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. Just curious: where do we download this from? It seems it's not on NuGet... is the SDK adding some other public feeds for this? 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 downloaded from NuGet: https://www.nuget.org/packages/Microsoft.NET.ILLink.Analyzers/ For internal builds the specific version would be available on an internal feed. 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. That package was submitted by mistake - it only has one 8.0 preview version, it definitely doesn't contain downlevel versions. 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'll ask for it to be uploaded to nuget. |
||
} | ||
|
||
return true; | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,8 +22,14 @@ Copyright (c) .NET Foundation. All rights reserved. | |
<!-- PublishAot depends on PublishTrimmed. This must be set early enough for the KnownILLinkPack to be restored. --> | ||
<PublishTrimmed Condition="'$(PublishTrimmed)' == '' And '$(PublishAot)' == 'true'">true</PublishTrimmed> | ||
<IsTrimmable Condition="'$(IsTrimmable)' == '' and '$(IsAotCompatible)' == 'true'">true</IsTrimmable> | ||
<_IsTrimmingEnabled Condition="'$(_IsTrimmingEnabled)' == '' And ('$(PublishTrimmed)' == 'true' Or '$(IsTrimmable)' == 'true')">true</_IsTrimmingEnabled> | ||
<_IsTrimmingEnabled Condition="'$(_IsTrimmingEnabled)' == ''">false</_IsTrimmingEnabled> | ||
<_RequiresILLinkPack Condition="'$(_RequiresILLinkPack)' == '' And ( | ||
'$(PublishTrimmed)' == 'true' Or | ||
'$(PublishSingleFile)' == 'true' Or | ||
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. Can we rename 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. dotnet/runtime uses that property already. @sbomer can you please take care of updating it when these changes are being consumed? https://github.com/dotnet/runtime/blob/98dd1e83ba8b17299af9d3d78000f8a9c000a12e/eng/illink.targets#L5C1-L6 |
||
'$(IsTrimmable)' == 'true' Or | ||
'$(EnableAotAnalyzer)' == 'true' Or | ||
'$(EnableTrimAnalyzer)' == 'true' Or | ||
'$(EnableSingleFileAnalyzer)' == 'true')">true</_RequiresILLinkPack> | ||
<_RequiresILLinkPack Condition="'$(_RequiresILLinkPack)' == ''">false</_RequiresILLinkPack> | ||
<DynamicCodeSupport Condition="'$(DynamicCodeSupport)' == '' And '$(PublishAot)' == 'true'">false</DynamicCodeSupport> | ||
</PropertyGroup> | ||
|
||
|
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.
Should the corresponding version number be removed from
Versions.props
? Otherwise I believe it will still be there and available for use, but won't ever get updated.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.
It looks like we were using the
ILLink.Tasks
package version, and thisVersion.Details.xml
version was never used. I removed theILLink.Tasks
packagereference and cleaned up some left-over analyzer layout logic that was using it.I left in the
ILLink.Tasks
entry inVersions.props
andVersion.Details.xml
even though these are technically unused. We test with anILLink.Tasks
version matchingMicrosoftNETCoreAppRefPackageVersion
, which should always be the same, but it kind of seems nice to make the dependency explicit at least inVersions.props
. Let me know if you'd prefer me to remove it and I will.