Skip to content

Commit

Permalink
Add (IL)linker opt-in flag (#6936)
Browse files Browse the repository at this point in the history
* Add (IL)linker opt-in flag
  • Loading branch information
ViktorHofer authored Feb 11, 2021
1 parent 043b787 commit 023bcee
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>2fc92d84e746c3aab75f0930278ea6675cd5bb5c</Sha>
</Dependency>
<Dependency Name="Microsoft.NET.ILLink.Tasks" Version="6.0.0-alpha.1.21109.4">
<Uri>https://github.com/mono/linker</Uri>
<Sha>b2979aecc948be066551d83acd281a22ad0378a8</Sha>
</Dependency>
<Dependency Name="Microsoft.SourceLink.GitHub" Version="1.1.0-beta-21109-02">
<Uri>https://github.com/dotnet/sourcelink</Uri>
<Sha>92f1252a59eb67391c1883a5c39920a385157f1a</Sha>
Expand Down
1 change: 1 addition & 0 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
<MicrosoftExtensionsLoggingConsoleVersion>2.1.1</MicrosoftExtensionsLoggingConsoleVersion>
<MicrosoftNETCorePlatformsVersion>2.1.0</MicrosoftNETCorePlatformsVersion>
<MicrosoftNetCompilersToolsetVersion>3.9.0-4.21104.8</MicrosoftNetCompilersToolsetVersion>
<MicrosoftNetILLinkTasksVersion>6.0.0-alpha.1.21109.4</MicrosoftNetILLinkTasksVersion>
<MicrosoftNetTestSdkVersion>16.7.1</MicrosoftNetTestSdkVersion>
<MoqVersion>4.8.3</MoqVersion>
<MonoOptionsVersion>5.3.0.1</MonoOptionsVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
<PropertyGroup>
<ArcadeSdkVersion>$(PackageVersion)</ArcadeSdkVersion>
<MicrosoftNetCompilersToolsetVersion>$(MicrosoftNetCompilersToolsetVersion)</MicrosoftNetCompilersToolsetVersion>
<MicrosoftNetILLinkTasksVersion>$(MicrosoftNetILLinkTasksVersion)</MicrosoftNetILLinkTasksVersion>
<MicrosoftSourceLinkVersion>$(MicrosoftSourceLinkVersion)</MicrosoftSourceLinkVersion>
<MicrosoftDiaSymReaderPdb2PdbVersion>$(MicrosoftDiaSymReaderPdb2PdbVersion)</MicrosoftDiaSymReaderPdb2PdbVersion>
<XliffTasksVersion>$(XliffTasksVersion)</XliffTasksVersion>
Expand Down
6 changes: 6 additions & 0 deletions src/Microsoft.DotNet.Arcade.Sdk/tools/DefaultVersions.props
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@
Repo can set this property to true if it needs to use a different version of the compiler than the one in the dotnet SDK.
-->
<UsingToolMicrosoftNetCompilers Condition="'$(UsingToolMicrosoftNetCompilers)' == ''">false</UsingToolMicrosoftNetCompilers>

<!--
Use IL linker from the Microsoft.NET.ILLink.Tasks package.
Repo can set this property to true if it needs to use a different version of the IL linker than the one in the dotnet SDK.
-->
<UsingToolMicrosoftNetILLinkTasks Condition="'$(UsingToolMicrosoftNetILLinkTasks)' == ''">false</UsingToolMicrosoftNetILLinkTasks>
</PropertyGroup>

<!--
Expand Down
7 changes: 7 additions & 0 deletions src/Microsoft.DotNet.Arcade.Sdk/tools/Linker.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. -->
<Project>
<ItemGroup>
<PackageReference Include="Microsoft.NET.ILLink.Tasks" Version="$(MicrosoftNetILLinkTasksVersion)" PrivateAssets="all" IsImplicitlyDefined="true" />

This comment has been minimized.

Copy link
@safern

safern Feb 13, 2021

Member

@ViktorHofer it seems like consuming a new version of arcade in dotnet/runtime after this change and setting: UsingToolMicrosoftNetILLinkTasks=true, causes build errors:

error NETSDK1023: A PackageReference for 'Microsoft.NET.ILLink.Tasks' was included in your project. This package is implicitly referenced by the .NET SDK and you do not typically need to reference it from your project. For more information, see https://aka.ms/sdkimplicitrefs [/__w/1/s/Build.proj]

https://dev.azure.com/dnceng/public/_build/results?buildId=993206&view=logs&j=b6e5d97f-d4f8-506b-9e47-e3e32385754a&t=94ce2805-f3e2-5f9a-1d92-0da5613f733d&l=59

This comment has been minimized.

Copy link
@ViktorHofer

ViktorHofer Feb 17, 2021

Author Member

Tracked via dotnet/runtime#48409

</ItemGroup>
</Project>
1 change: 1 addition & 0 deletions src/Microsoft.DotNet.Arcade.Sdk/tools/Settings.props
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<Import Project="Workarounds.props"/>

<Import Project="Compiler.props" Condition="'$(UsingToolMicrosoftNetCompilers)' == 'true'" />
<Import Project="Linker.props" Condition="'$(UsingToolMicrosoftNetILLinkTasks)' == 'true'" />
<Import Project="VisualStudio.props" Condition="'$(UsingToolVSSDK)' == 'true' and '$(MSBuildRuntimeType)' != 'Core'"/>

<!--
Expand Down

0 comments on commit 023bcee

Please sign in to comment.