Skip to content

Use linker matching TFM #29441

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

Merged
merged 9 commits into from
Dec 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/Layout/redist/targets/BundledSdks.targets
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@
<BundledSdk Include="Microsoft.NET.Sdk.WindowsDesktop" Version="$(MicrosoftNETSdkWindowsDesktopPackageVersion)" Condition="'$(DotNetBuildFromSource)' != 'true'" />
<BundledSdk Include="FSharp.NET.Sdk" Version="1.0.4-bundled-0100" />
<BundledSdk Include="Microsoft.Docker.Sdk" Version="1.1.0" />
<BundledSdk Include="Microsoft.NET.ILLink.Tasks" Version="$(MicrosoftNETILLinkTasksPackageVersion)" />
</ItemGroup>
</Project>
1 change: 1 addition & 0 deletions src/Layout/redist/targets/OverlaySdkOnLKG.targets
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
<OverrideAndCreateBundledNETCoreAppPackageVersion
Stage0MicrosoftNETCoreAppRefPackageVersionPath="$(_DotNetHiveRoot)/sdk/$(Stage0SdkVersion)/Microsoft.NETCoreSdk.BundledVersions.props"
MicrosoftNETCoreAppRefPackageVersion="$(MicrosoftNETCoreAppRefPackageVersion)"
MicrosoftNETILLinkTasksPackageVersion="$(MicrosoftNETILLinkTasksPackageVersion)"
NewSDKVersion="$(Version)"
OutputPath="$(SdkOutputDirectory)/Microsoft.NETCoreSdk.BundledVersions.props"/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ public sealed class OverrideAndCreateBundledNETCoreAppPackageVersion : Task
[Required] public string Stage0MicrosoftNETCoreAppRefPackageVersionPath { get; set; }

[Required] public string MicrosoftNETCoreAppRefPackageVersion { get; set; }

// TODO: remove this once linker packages are produced from dotnet/runtime
// and replace it with MicrosoftNETCoreAppRefPackageVersion.
[Required] public string MicrosoftNETILLinkTasksPackageVersion { get; set; }

[Required] public string NewSDKVersion { get; set; }

[Required] public string OutputPath { get; set; }
Expand All @@ -45,13 +50,15 @@ public override bool Execute()
ExecuteInternal(
File.ReadAllText(Stage0MicrosoftNETCoreAppRefPackageVersionPath),
MicrosoftNETCoreAppRefPackageVersion,
MicrosoftNETILLinkTasksPackageVersion,
NewSDKVersion));
return true;
}

public static string ExecuteInternal(
string stage0MicrosoftNETCoreAppRefPackageVersionContent,
string microsoftNETCoreAppRefPackageVersion,
string microsoftNETILLinkTasksPackageVersion,
string newSDKVersion)
{
var projectXml = XDocument.Parse(stage0MicrosoftNETCoreAppRefPackageVersionContent);
Expand Down Expand Up @@ -126,6 +133,24 @@ void CheckAndReplaceAttribute(XAttribute attribute)
CheckAndReplaceAttribute(itemGroup
.Elements(ns + "KnownRuntimePack").First().Attribute("LatestRuntimeFrameworkVersion"));

// TODO: remove this once we're using an SDK that contains KnownILLinkPack: https://github.com/dotnet/installer/pull/15106
{
itemGroup.Add(new XElement(ns + "KnownILLinkPack",
new XAttribute("Include", "Microsoft.NET.ILLink.Tasks"),
new XAttribute("TargetFramework", "net8.0"),
new XAttribute("ILLinkPackVersion", microsoftNETILLinkTasksPackageVersion)));

// Use 7.0 linker when targeting supported RIDS <= net7.0.
var net70Version = "7.0.100-1.22579.2";

foreach (var tfm in new[] { "net7.0", "net6.0", "net5.0", "netcoreapp3.1", "netcoreapp3.0" }) {
itemGroup.Add(new XElement(ns + "KnownILLinkPack",
new XAttribute("Include", "Microsoft.NET.ILLink.Tasks"),
new XAttribute("TargetFramework", tfm),
new XAttribute("ILLinkPackVersion", net70Version)));
}
}

return projectXml.ToString();
}

Expand Down
4 changes: 4 additions & 0 deletions src/Tasks/Common/Resources/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -883,4 +883,8 @@ You may need to build the project on another operating system or architecture, o
<value>NETSDK1194: The "--output" option isn't supported when building a solution.</value>
<comment>{StrBegin="NETSDK1194: "}</comment>
</data>
<data name="ILLinkNoValidRuntimePackageError" xml:space="preserve">
<value>NETSDK1195: Unable to optimize assemblies for size: a valid runtime package was not found. Either set the PublishTrimmed property to false, or use a supported target framework when publishing.</value>
<comment>{StrBegin="NETSDK1195: "}</comment>
</data>
</root>
5 changes: 5 additions & 0 deletions src/Tasks/Common/Resources/xlf/Strings.cs.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,11 @@
<target state="translated">NETSDK1144: Optimalizace velikosti sestavení neproběhla úspěšně. Optimalizaci je možné zakázat tím, že se nastaví vlastnost PublishTrimmed na false.</target>
<note>{StrBegin="NETSDK1144: "}</note>
</trans-unit>
<trans-unit id="ILLinkNoValidRuntimePackageError">
<source>NETSDK1195: Unable to optimize assemblies for size: a valid runtime package was not found. Either set the PublishTrimmed property to false, or use a supported target framework when publishing.</source>
<target state="new">NETSDK1195: Unable to optimize assemblies for size: a valid runtime package was not found. Either set the PublishTrimmed property to false, or use a supported target framework when publishing.</target>
<note>{StrBegin="NETSDK1195: "}</note>
</trans-unit>
<trans-unit id="ILLinkNotSupportedError">
<source>NETSDK1102: Optimizing assemblies for size is not supported for the selected publish configuration. Please ensure that you are publishing a self-contained app.</source>
<target state="translated">NETSDK1102: Pro vybranou konfiguraci publikování se optimalizace velikosti sestavení nepodporuje. Ujistěte se, že publikujete samostatnou aplikaci.</target>
Expand Down
5 changes: 5 additions & 0 deletions src/Tasks/Common/Resources/xlf/Strings.de.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,11 @@
<target state="translated">NETSDK1144: Fehler bei der Größenoptimierung von Assemblys. Die Optimierung kann durch Festlegen der PublishTrimmed-Eigenschaft auf FALSE deaktiviert werden.</target>
<note>{StrBegin="NETSDK1144: "}</note>
</trans-unit>
<trans-unit id="ILLinkNoValidRuntimePackageError">
<source>NETSDK1195: Unable to optimize assemblies for size: a valid runtime package was not found. Either set the PublishTrimmed property to false, or use a supported target framework when publishing.</source>
<target state="new">NETSDK1195: Unable to optimize assemblies for size: a valid runtime package was not found. Either set the PublishTrimmed property to false, or use a supported target framework when publishing.</target>
<note>{StrBegin="NETSDK1195: "}</note>
</trans-unit>
<trans-unit id="ILLinkNotSupportedError">
<source>NETSDK1102: Optimizing assemblies for size is not supported for the selected publish configuration. Please ensure that you are publishing a self-contained app.</source>
<target state="translated">NETSDK1102: Die Größenoptimierung von Assemblys wird für die ausgewählte Veröffentlichungskonfiguration nicht unterstützt. Stellen Sie sicher, dass Sie eine eigenständige App veröffentlichen.</target>
Expand Down
5 changes: 5 additions & 0 deletions src/Tasks/Common/Resources/xlf/Strings.es.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,11 @@
<target state="translated">NETSDK1144: Error al optimizar el tamaño de los ensamblados. Para deshabilitar la optimización, establezca la propiedad PublishTrimmed en false.</target>
<note>{StrBegin="NETSDK1144: "}</note>
</trans-unit>
<trans-unit id="ILLinkNoValidRuntimePackageError">
<source>NETSDK1195: Unable to optimize assemblies for size: a valid runtime package was not found. Either set the PublishTrimmed property to false, or use a supported target framework when publishing.</source>
<target state="new">NETSDK1195: Unable to optimize assemblies for size: a valid runtime package was not found. Either set the PublishTrimmed property to false, or use a supported target framework when publishing.</target>
<note>{StrBegin="NETSDK1195: "}</note>
</trans-unit>
<trans-unit id="ILLinkNotSupportedError">
<source>NETSDK1102: Optimizing assemblies for size is not supported for the selected publish configuration. Please ensure that you are publishing a self-contained app.</source>
<target state="translated">NETSDK1102: No se admite la optimización de tamaño de los ensamblados para la configuración de publicación seleccionada. Asegúrese de que está publicando una aplicación autónoma.</target>
Expand Down
5 changes: 5 additions & 0 deletions src/Tasks/Common/Resources/xlf/Strings.fr.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,11 @@
<target state="translated">NETSDK1144: L'optimisation de la taille des assemblys a échoué. Vous pouvez désactiver l'optimisation en affectant à la propriété PublishTrimmed la valeur false.</target>
<note>{StrBegin="NETSDK1144: "}</note>
</trans-unit>
<trans-unit id="ILLinkNoValidRuntimePackageError">
<source>NETSDK1195: Unable to optimize assemblies for size: a valid runtime package was not found. Either set the PublishTrimmed property to false, or use a supported target framework when publishing.</source>
<target state="new">NETSDK1195: Unable to optimize assemblies for size: a valid runtime package was not found. Either set the PublishTrimmed property to false, or use a supported target framework when publishing.</target>
<note>{StrBegin="NETSDK1195: "}</note>
</trans-unit>
<trans-unit id="ILLinkNotSupportedError">
<source>NETSDK1102: Optimizing assemblies for size is not supported for the selected publish configuration. Please ensure that you are publishing a self-contained app.</source>
<target state="translated">NETSDK1102: l'optimisation de la taille des assemblys n'est pas prise en charge pour la configuration de publication sélectionnée. Vérifiez que vous publiez une application autonome.</target>
Expand Down
5 changes: 5 additions & 0 deletions src/Tasks/Common/Resources/xlf/Strings.it.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,11 @@
<target state="translated">NETSDK1144: l'ottimizzazione degli assembly per le dimensioni non è riuscita. È possibile disabilitare l'ottimizzazione impostando la proprietà PublishTrimmed su false.</target>
<note>{StrBegin="NETSDK1144: "}</note>
</trans-unit>
<trans-unit id="ILLinkNoValidRuntimePackageError">
<source>NETSDK1195: Unable to optimize assemblies for size: a valid runtime package was not found. Either set the PublishTrimmed property to false, or use a supported target framework when publishing.</source>
<target state="new">NETSDK1195: Unable to optimize assemblies for size: a valid runtime package was not found. Either set the PublishTrimmed property to false, or use a supported target framework when publishing.</target>
<note>{StrBegin="NETSDK1195: "}</note>
</trans-unit>
<trans-unit id="ILLinkNotSupportedError">
<source>NETSDK1102: Optimizing assemblies for size is not supported for the selected publish configuration. Please ensure that you are publishing a self-contained app.</source>
<target state="translated">NETSDK1102: l'ottimizzazione degli assembly per le dimensioni non è supportata per la configurazione di pubblicazione selezionata. Assicurarsi di pubblicare un'app indipendente.</target>
Expand Down
5 changes: 5 additions & 0 deletions src/Tasks/Common/Resources/xlf/Strings.ja.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,11 @@
<target state="new">NETSDK1144: Optimizing assemblies for size failed. Optimization can be disabled by setting the PublishTrimmed property to false.</target>
<note>{StrBegin="NETSDK1144: "}</note>
</trans-unit>
<trans-unit id="ILLinkNoValidRuntimePackageError">
<source>NETSDK1195: Unable to optimize assemblies for size: a valid runtime package was not found. Either set the PublishTrimmed property to false, or use a supported target framework when publishing.</source>
<target state="new">NETSDK1195: Unable to optimize assemblies for size: a valid runtime package was not found. Either set the PublishTrimmed property to false, or use a supported target framework when publishing.</target>
<note>{StrBegin="NETSDK1195: "}</note>
</trans-unit>
<trans-unit id="ILLinkNotSupportedError">
<source>NETSDK1102: Optimizing assemblies for size is not supported for the selected publish configuration. Please ensure that you are publishing a self-contained app.</source>
<target state="new">NETSDK1102: Optimizing assemblies for size is not supported for the selected publish configuration. Please ensure that you are publishing a self-contained app.</target>
Expand Down
5 changes: 5 additions & 0 deletions src/Tasks/Common/Resources/xlf/Strings.ko.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,11 @@
<target state="translated">NETSDK1144: 어셈블리의 크기를 최적화하지 못했습니다. PublishTrimmed 속성을 false로 설정하여 최적화를 사용하지 않도록 설정할 수 있습니다.</target>
<note>{StrBegin="NETSDK1144: "}</note>
</trans-unit>
<trans-unit id="ILLinkNoValidRuntimePackageError">
<source>NETSDK1195: Unable to optimize assemblies for size: a valid runtime package was not found. Either set the PublishTrimmed property to false, or use a supported target framework when publishing.</source>
<target state="new">NETSDK1195: Unable to optimize assemblies for size: a valid runtime package was not found. Either set the PublishTrimmed property to false, or use a supported target framework when publishing.</target>
<note>{StrBegin="NETSDK1195: "}</note>
</trans-unit>
<trans-unit id="ILLinkNotSupportedError">
<source>NETSDK1102: Optimizing assemblies for size is not supported for the selected publish configuration. Please ensure that you are publishing a self-contained app.</source>
<target state="translated">NETSDK1102: 선택한 게시 구성에서는 크기에 대한 어셈블리 최적화가 지원되지 않습니다. 자체 포함 앱을 게시하고 있는지 확인하세요.</target>
Expand Down
5 changes: 5 additions & 0 deletions src/Tasks/Common/Resources/xlf/Strings.pl.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,11 @@
<target state="translated">NETSDK1144: Optymalizacja zestawów pod kątem rozmiaru nie powiodła się. Optymalizacja może zostać wyłączona przez ustawienie właściwości PublishTrimmed na wartość false.</target>
<note>{StrBegin="NETSDK1144: "}</note>
</trans-unit>
<trans-unit id="ILLinkNoValidRuntimePackageError">
<source>NETSDK1195: Unable to optimize assemblies for size: a valid runtime package was not found. Either set the PublishTrimmed property to false, or use a supported target framework when publishing.</source>
<target state="new">NETSDK1195: Unable to optimize assemblies for size: a valid runtime package was not found. Either set the PublishTrimmed property to false, or use a supported target framework when publishing.</target>
<note>{StrBegin="NETSDK1195: "}</note>
</trans-unit>
<trans-unit id="ILLinkNotSupportedError">
<source>NETSDK1102: Optimizing assemblies for size is not supported for the selected publish configuration. Please ensure that you are publishing a self-contained app.</source>
<target state="translated">NETSDK1102: Optymalizacja zestawów pod kątem rozmiaru nie jest obsługiwana w przypadku wybranej konfiguracji publikowania. Upewnij się, że publikujesz niezależną aplikację.</target>
Expand Down
5 changes: 5 additions & 0 deletions src/Tasks/Common/Resources/xlf/Strings.pt-BR.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,11 @@
<target state="translated">NETSDK1144: Falha na otimização de assemblies de tamanho. A otimização pode ser desabilitada definindo a propriedade PublishTrimmed como false.</target>
<note>{StrBegin="NETSDK1144: "}</note>
</trans-unit>
<trans-unit id="ILLinkNoValidRuntimePackageError">
<source>NETSDK1195: Unable to optimize assemblies for size: a valid runtime package was not found. Either set the PublishTrimmed property to false, or use a supported target framework when publishing.</source>
<target state="new">NETSDK1195: Unable to optimize assemblies for size: a valid runtime package was not found. Either set the PublishTrimmed property to false, or use a supported target framework when publishing.</target>
<note>{StrBegin="NETSDK1195: "}</note>
</trans-unit>
<trans-unit id="ILLinkNotSupportedError">
<source>NETSDK1102: Optimizing assemblies for size is not supported for the selected publish configuration. Please ensure that you are publishing a self-contained app.</source>
<target state="translated">NETSDK1102: não há suporte para a otimização de assemblies para tamanho na configuração de publicação selecionada. Verifique se você está publicando um aplicativo independente.</target>
Expand Down
5 changes: 5 additions & 0 deletions src/Tasks/Common/Resources/xlf/Strings.ru.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,11 @@
<target state="translated">NETSDK1144: не удалось оптимизировать сборки под размер. Оптимизацию можно отключить, установив значение false для свойства PublishTrimmed.</target>
<note>{StrBegin="NETSDK1144: "}</note>
</trans-unit>
<trans-unit id="ILLinkNoValidRuntimePackageError">
<source>NETSDK1195: Unable to optimize assemblies for size: a valid runtime package was not found. Either set the PublishTrimmed property to false, or use a supported target framework when publishing.</source>
<target state="new">NETSDK1195: Unable to optimize assemblies for size: a valid runtime package was not found. Either set the PublishTrimmed property to false, or use a supported target framework when publishing.</target>
<note>{StrBegin="NETSDK1195: "}</note>
</trans-unit>
<trans-unit id="ILLinkNotSupportedError">
<source>NETSDK1102: Optimizing assemblies for size is not supported for the selected publish configuration. Please ensure that you are publishing a self-contained app.</source>
<target state="translated">NETSDK1102: оптимизация сборок по размеру не поддерживается для выбранной конфигурации публикации. Убедитесь, что вы публикуете автономное приложение.</target>
Expand Down
5 changes: 5 additions & 0 deletions src/Tasks/Common/Resources/xlf/Strings.tr.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,11 @@
<target state="translated">NETSDK1144: Bütünleştirilmiş kodlar boyut için iyileştirilemedi. İyileştirme, PublishTrimmed özelliği false olarak ayarlanarak devre dışı bırakılabilir.</target>
<note>{StrBegin="NETSDK1144: "}</note>
</trans-unit>
<trans-unit id="ILLinkNoValidRuntimePackageError">
<source>NETSDK1195: Unable to optimize assemblies for size: a valid runtime package was not found. Either set the PublishTrimmed property to false, or use a supported target framework when publishing.</source>
<target state="new">NETSDK1195: Unable to optimize assemblies for size: a valid runtime package was not found. Either set the PublishTrimmed property to false, or use a supported target framework when publishing.</target>
<note>{StrBegin="NETSDK1195: "}</note>
</trans-unit>
<trans-unit id="ILLinkNotSupportedError">
<source>NETSDK1102: Optimizing assemblies for size is not supported for the selected publish configuration. Please ensure that you are publishing a self-contained app.</source>
<target state="translated">NETSDK1102: Derlemeleri boyut için iyileştirme, seçilen yayımlama yapılandırması için desteklenmiyor. Lütfen kendi içinde bulunan bir uygulama yayımladığınızdan emin olun.</target>
Expand Down
5 changes: 5 additions & 0 deletions src/Tasks/Common/Resources/xlf/Strings.zh-Hans.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,11 @@
<target state="translated">NETSDK1144: 优化程序集的大小失败。通过将 PublishTrimmed 属性设置为 false 可禁用优化。</target>
<note>{StrBegin="NETSDK1144: "}</note>
</trans-unit>
<trans-unit id="ILLinkNoValidRuntimePackageError">
<source>NETSDK1195: Unable to optimize assemblies for size: a valid runtime package was not found. Either set the PublishTrimmed property to false, or use a supported target framework when publishing.</source>
<target state="new">NETSDK1195: Unable to optimize assemblies for size: a valid runtime package was not found. Either set the PublishTrimmed property to false, or use a supported target framework when publishing.</target>
<note>{StrBegin="NETSDK1195: "}</note>
</trans-unit>
<trans-unit id="ILLinkNotSupportedError">
<source>NETSDK1102: Optimizing assemblies for size is not supported for the selected publish configuration. Please ensure that you are publishing a self-contained app.</source>
<target state="translated">NETSDK1102: 所选发布配置不支持优化程序集的大小。请确保你发布的是独立应用。</target>
Expand Down
Loading