Skip to content
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

Remove dependencies on non-live illink #91468

Merged
merged 34 commits into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
7d03a08
Remove dependencies on non-live illink
sbomer Sep 1, 2023
201713b
Fix properties
sbomer Sep 1, 2023
03940b2
Remove KnownILLinkPack
sbomer Sep 1, 2023
cb9f7b5
Merge remote-tracking branch 'origin/main' into liveILLink
sbomer Sep 1, 2023
a64cc2a
Don't require illink analyzers for source generator projects
sbomer Sep 1, 2023
abc514f
Only enable single-file analyzer for source projects
sbomer Sep 5, 2023
597a012
Separate imports
sbomer Sep 5, 2023
e83a2a0
Fix libraries build
sbomer Sep 5, 2023
32e13ab
Add _RequiresLiveILLink flag
sbomer Sep 5, 2023
214038a
Revert "Fix libraries build"
sbomer Sep 5, 2023
7a3362f
Revert "Separate imports"
sbomer Sep 5, 2023
679c0e1
Set _RequiresLiveILLink in illink.targets
sbomer Sep 5, 2023
12dd7dd
Don't restore KnownILLinkPack in trimming tests
sbomer Sep 5, 2023
d99b2d6
Import liveILLink.targets in libraries projects
sbomer Sep 5, 2023
e0279d2
Fix import path
sbomer Sep 5, 2023
a2c519a
Separate imports, PR feedback
sbomer Sep 6, 2023
ee2213f
Move liveILlink.targets import to top-level Directory.Build.targets
sbomer Sep 6, 2023
c42ad15
Clean up redundant setting
sbomer Sep 6, 2023
af28b58
Fix import ordering for nativeaot test build
sbomer Sep 6, 2023
6072a9a
Try removing imports from tests.mobile.targets
sbomer Sep 6, 2023
8cdd176
Keep ILC props/items before ILC targets import
sbomer Sep 6, 2023
a239c1a
Move liveILLink.targets import back down
sbomer Sep 7, 2023
59919ce
Fix illink path
sbomer Sep 8, 2023
928e6bb
Merge remote-tracking branch 'origin/main' into liveILLink
sbomer Sep 19, 2023
3b0bf85
Merge branch 'main' into liveILLink
ViktorHofer Sep 25, 2023
07b300f
Merge remote-tracking branch 'origin/main' into liveILLink
sbomer Sep 28, 2023
ea87914
Merge remote-tracking branch 'origin/main' into liveILLink
sbomer Sep 29, 2023
0fec310
Merge branch 'main' into liveILLink
ViktorHofer Oct 3, 2023
b442dbc
Apply suggestions from code review
sbomer Oct 3, 2023
d18a62d
Merge remote-tracking branch 'origin/main' into liveILLink
sbomer Oct 3, 2023
be50c35
Fix libs test project that sets PublishTrimmed
sbomer Oct 4, 2023
2c16391
Revert "Fix libs test project that sets PublishTrimmed"
sbomer Oct 4, 2023
96a663d
Revert condition on liveILLink.targets import
sbomer Oct 4, 2023
9b9ed8d
Skip nonexistent targets when copying native binaries
sbomer Oct 5, 2023
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
3 changes: 2 additions & 1 deletion eng/Analyzers.targets
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
<PropertyGroup Condition="'$(RunAnalyzers)' != 'false'">
<EnableSingleFileAnalyzer Condition="
'$(EnableSingleFileAnalyzer)' == '' And
'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">true</EnableSingleFileAnalyzer>
'$(TargetFrameworkIdentifier)' == '.NETCoreApp' And
sbomer marked this conversation as resolved.
Show resolved Hide resolved
'$(IsGeneratorProject)' != 'true'">true</EnableSingleFileAnalyzer>
sbomer marked this conversation as resolved.
Show resolved Hide resolved
</PropertyGroup>
<ItemGroup Condition="'$(RunAnalyzers)' != 'false'">
<EditorConfigFiles Include="$(MSBuildThisFileDirectory)CodeAnalysis.src.globalconfig" />
Expand Down
4 changes: 0 additions & 4 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -314,10 +314,6 @@
<Sha>976c2ab862494ef05e2b61535a3d08e26f131145</Sha>
<SourceBuild RepoName="runtime" ManagedOnly="false" />
</Dependency>
<Dependency Name="Microsoft.NET.ILLink.Tasks" Version="9.0.0-alpha.1.23426.3">
<Uri>https://github.com/dotnet/runtime</Uri>
<Sha>976c2ab862494ef05e2b61535a3d08e26f131145</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.ILCompiler" Version="9.0.0-alpha.1.23426.3">
<Uri>https://github.com/dotnet/runtime</Uri>
<Sha>976c2ab862494ef05e2b61535a3d08e26f131145</Sha>
Expand Down
2 changes: 0 additions & 2 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,6 @@
<CompilerPlatformTestingVersion>1.1.2-beta1.23323.1</CompilerPlatformTestingVersion>
<!-- Docs -->
<MicrosoftPrivateIntellisenseVersion>8.0.0-preview-20230828.1</MicrosoftPrivateIntellisenseVersion>
<!-- ILLink -->
<MicrosoftNETILLinkTasksVersion>9.0.0-alpha.1.23426.3</MicrosoftNETILLinkTasksVersion>
<!-- Mono Cecil -->
<MicrosoftDotNetCecilVersion>0.11.4-alpha.23428.2</MicrosoftDotNetCecilVersion>
<!-- ILCompiler -->
Expand Down
29 changes: 1 addition & 28 deletions eng/illink.targets
Original file line number Diff line number Diff line change
@@ -1,36 +1,9 @@
<Project>

<PropertyGroup>
<_ILLinkTasksSourceDir>$(ToolsProjectRoot)illink\src\ILLink.Tasks\</_ILLinkTasksSourceDir>
<ILLinkAnalyzersPropsPath>$(ToolsProjectRoot)illink\src\ILLink.RoslynAnalyzer\build\Microsoft.NET.ILLink.Analyzers.props</ILLinkAnalyzersPropsPath>
</PropertyGroup>

<ItemGroup>
<!-- The assembly shouldn't be referenced, nor promoted to a package dependency, nor copied to the output directory. -->
<ProjectReference Include="$(_ILLinkTasksSourceDir)ILLink.Tasks.csproj"
ReferenceOutputAssembly="false"
PrivateAssets="all"
Private="false"
SetConfiguration="Configuration=$(ToolsConfiguration)">
<!-- Keep TFMs in sync with ILLink.Tasks.csproj -->
<SetTargetFramework Condition="'$(MSBuildRuntimeType)' == 'Core'">TargetFramework=$(NetCoreAppToolCurrent)</SetTargetFramework>
<SetTargetFramework Condition="'$(MSBuildRuntimeType)' != 'Core'">TargetFramework=$(NetFrameworkToolCurrent)</SetTargetFramework>
</ProjectReference>
</ItemGroup>

<Import Project="$(_ILLinkTasksSourceDir)build\Microsoft.NET.ILLink.Tasks.props" />
<Import Project="$(MSBuildThisFileDirectory)liveILLink.targets" />

<PropertyGroup>
<IsTrimmable Condition="'$(IsTrimmable)' == ''">true</IsTrimmable>
<!-- Don't use SDK's trimming functionality.
Once we have an SDK with
https://github.com/dotnet/sdk/commit/bdce224bba472ccad4bade07b757ac5275040c0e
and
https://github.com/dotnet/sdk/commit/f051b536cc12190488231f3a889df44214c1bc2e,
we might be able to use built-in functionality instead of a packagereference.
-->
<_RequiresILLinkPack>false</_RequiresILLinkPack>
<ILLinkTasksAssembly>$(ToolsILLinkDir)$(NetCoreAppToolCurrent)/ILLink.Tasks.dll</ILLinkTasksAssembly>
<PrepareResourcesDependsOn>_EmbedILLinkXmls;$(PrepareResourcesDependsOn)</PrepareResourcesDependsOn>
<TargetsTriggeredByCompilation Condition="'$(DesignTimeBuild)' != 'true'">$(TargetsTriggeredByCompilation);ILLinkTrimAssembly</TargetsTriggeredByCompilation>

Expand Down
29 changes: 29 additions & 0 deletions eng/liveILLink.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<Project>

<PropertyGroup>
<_ILLinkTasksSourceDir>$(ToolsProjectRoot)illink\src\ILLink.Tasks\</_ILLinkTasksSourceDir>
<ILLinkAnalyzersPropsPath>$(ToolsProjectRoot)illink\src\ILLink.RoslynAnalyzer\build\Microsoft.NET.ILLink.Analyzers.props</ILLinkAnalyzersPropsPath>
</PropertyGroup>

<Import Project="$(_ILLinkTasksSourceDir)build\Microsoft.NET.ILLink.Tasks.props" />

<PropertyGroup>
<!-- Don't use SDK's trimming functionality. -->
<_RequiresILLinkPack>false</_RequiresILLinkPack>
<ILLinkTasksAssembly>$(ToolsILLinkDir)$(NetCoreAppToolCurrent)/ILLink.Tasks.dll</ILLinkTasksAssembly>
sbomer marked this conversation as resolved.
Show resolved Hide resolved
</PropertyGroup>

<ItemGroup>
<!-- The assembly shouldn't be referenced, nor promoted to a package dependency, nor copied to the output directory. -->
<ProjectReference Include="$(_ILLinkTasksSourceDir)ILLink.Tasks.csproj"
ReferenceOutputAssembly="false"
PrivateAssets="all"
Private="false"
SetConfiguration="Configuration=$(ToolsConfiguration)">
<!-- Keep TFMs in sync with ILLink.Tasks.csproj -->
<SetTargetFramework Condition="'$(MSBuildRuntimeType)' == 'Core'">TargetFramework=$(NetCoreAppToolCurrent)</SetTargetFramework>
<SetTargetFramework Condition="'$(MSBuildRuntimeType)' != 'Core'">TargetFramework=$(NetFrameworkToolCurrent)</SetTargetFramework>
</ProjectReference>
</ItemGroup>

</Project>
7 changes: 0 additions & 7 deletions eng/targetingpacks.targets
sbomer marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,6 @@
Condition="'@(KnownAppHostPack)' == '' or !@(KnownAppHostPack->AnyHaveMetadataValue('TargetFramework', '$(NetCoreAppCurrent)'))" />
</ItemGroup>

<!-- Add known packs from the downlevel TFM until we are building with an SDK that supports the new TFM all-up. -->
<ItemGroup Condition="'$(NetCoreAppToolCurrent)' != '$(NetCoreAppCurrent)'">
<KnownILLinkPack Include="@(KnownILLinkPack->WithMetadataValue('Identity', 'Microsoft.NET.ILLink.Tasks')->WithMetadataValue('TargetFramework', '$(NetCoreAppToolCurrent)'))">
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
</KnownILLinkPack>
</ItemGroup>

<!-- Simple name references will be resolved from the targeting pack folders and should never be copied to the output. -->
<ItemGroup>
<Reference Update="@(Reference)">
Expand Down
4 changes: 1 addition & 3 deletions src/libraries/sendtohelix-mobile.targets
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@
<_XHarnessAppleCustomCommand Condition="'$(NeedsiOSSDK)' == 'true'">
source build-apple-app.sh
</_XHarnessAppleCustomCommand>
<!-- Use ILLink.Tasks version matching the SDK used to build. See comment about _RequiresILLinkPack in eng/illink.targets -->
<ILLinkDir>$([MSBuild]::NormalizeDirectory('$(NuGetPackageRoot)', 'microsoft.net.illink.tasks', '$(BundledNETCoreAppPackageVersion)'))</ILLinkDir>
</PropertyGroup>

<ItemGroup Condition="'$(NeedsiOSSDK)' == 'true'">
Expand All @@ -79,7 +77,7 @@
Destination="build/BuildIntegration" />
<HelixCorrelationPayload Include="$(CoreCLRAotSdkDir)" Condition="'$(RuntimeFlavor)' == 'coreclr'"
Destination="build/aotsdk" />
<HelixCorrelationPayload Include="$(ILLinkDir)" Destination="build/microsoft.net.illink.tasks" />
<HelixCorrelationPayload Include="$(ToolsILLinkDir)" Destination="build/microsoft.net.illink.tasks" />
</ItemGroup>

<ItemGroup Condition="'$(TargetsAppleMobile)' == 'true'">
Expand Down
2 changes: 1 addition & 1 deletion src/mono/msbuild/apple/build/AppleBuild.LocalBuild.props
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<IlcFrameworkPath>$(MicrosoftNetCoreAppRuntimePackLibDir)</IlcFrameworkPath>
<IlcFrameworkNativePath>$(MicrosoftNetCoreAppRuntimePackNativeDir)</IlcFrameworkNativePath>
<ILLinkTargetsPath>$([MSBuild]::NormalizePath('$(BuildBaseDir)', 'microsoft.net.illink.tasks', 'build', 'Microsoft.NET.ILLink.targets'))</ILLinkTargetsPath>
<ILLinkTasksAssembly>$([MSBuild]::NormalizePath('$(BuildBaseDir)', 'microsoft.net.illink.tasks', 'tools', '$(_NetCoreAppToolCurrent)', 'ILLink.Tasks.dll'))</ILLinkTasksAssembly>
<ILLinkTasksAssembly>$([MSBuild]::NormalizePath('$(BuildBaseDir)', 'microsoft.net.illink.tasks', '$(_NetCoreAppToolCurrent)', 'ILLink.Tasks.dll'))</ILLinkTasksAssembly>
<_MonoAotCrossCompilerPath>$([MSBuild]::NormalizePath($(MonoAotCrossDir), 'mono-aot-cross'))</_MonoAotCrossCompilerPath>
<_MonoAotCrossCompilerPath Condition="$([MSBuild]::IsOSPlatform('WINDOWS'))">$(_MonoAotCrossCompilerPath).exe</_MonoAotCrossCompilerPath>
</PropertyGroup>
Expand Down
2 changes: 0 additions & 2 deletions src/tests/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<LibrariesConfiguration>Release</LibrariesConfiguration>
<!-- NativeAot tests rely on presence of ILLink targets, but don't actually run ILLink. -->
<UsingToolMicrosoftNetILLinkTasks Condition="'$(UsingToolMicrosoftNetILLinkTasks)' == ''">true</UsingToolMicrosoftNetILLinkTasks>
</PropertyGroup>

<Import Project="$(MSBuildThisFileDirectory)\Common\dir.sdkbuild.props" Condition="'$(UsingMicrosoftNETSdk)' == 'true'" />
Expand Down
1 change: 1 addition & 0 deletions src/tests/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,7 @@

<Import Project="$(RepoRoot)/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.props" />
<Import Project="$(RepoRoot)eng/liveBuilds.targets" />
<Import Project="$(RepoRoot)eng/liveILLink.targets" />
<Import Project="$(MSBuildProjectFullPath).targets" Condition="Exists('$(MSBuildProjectFullPath).targets')"/>
<Import Project="$(RepoRoot)/src/tests/Common/mergedrunner.targets" Condition="'$(IsMergedTestRunnerAssembly)' == 'true'" />

Expand Down