Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorAndon Andonov <andon.andonov@microsoft.com>2017-12-16 05:17:57 +0300
committerJan Kotas <jkotas@microsoft.com>2017-12-16 05:17:57 +0300
commitdf56bb3bd070ea115c4f4e157c2bee4cc6d05701 (patch)
tree79c96e3d0b06fe54a41c0fc564fe10f6a28b8fc5 /pkg
parentdb571b1b45f06877a18899d6a6e5856e063a24db (diff)
ILCompiler Package Multi-Runtime Package Support (#5123)
As it stands we only produce a Windows ILCompiler package. This work implements building and publishing of OS-specific runtime packages and spins off ILCompiler as a meta-package, which can be referenced when adding to a project. Working on this, a quirk in MSBuild behavior under .NET Core popped up - build artifacts (i.e. .targets and .props files) are imported for direct project package references, but not for runtime-specific packages, defined as dependencies in the meta-package. This doesn't seem to be the case in vanilla MSBuild. The below is a serious hack to work around this - during runtime, we find the resolved runtime package reference and define the path to it on disk, from which all OS-specific components are loaded and run. The motivation behind the workaround was to keep the package as small as possible, particularly because of the large intersection of components between OS implementations. All workarounds are marked as such and should be removed once Microsoft/msbuild#2807 is resolved. There is some slowdown because of sequential resolution of targets, but not immediately noticeable and is unfortunately unavoidable - almost entirely avoided if CoreRT build targets are referenced directly (excluding MSBuild overhead).
Diffstat (limited to 'pkg')
-rw-r--r--pkg/Microsoft.DotNet.ILCompiler/Microsoft.DotNet.ILCompiler.builds9
-rw-r--r--pkg/Microsoft.DotNet.ILCompiler/Microsoft.DotNet.ILCompiler.pkgproj37
-rw-r--r--pkg/Microsoft.DotNet.ILCompiler/Microsoft.DotNet.ILCompiler.targets7
-rw-r--r--pkg/Microsoft.DotNet.ILCompiler/TargetSpecific/Microsoft.DotNet.ILCompiler.pkgproj53
4 files changed, 67 insertions, 39 deletions
diff --git a/pkg/Microsoft.DotNet.ILCompiler/Microsoft.DotNet.ILCompiler.builds b/pkg/Microsoft.DotNet.ILCompiler/Microsoft.DotNet.ILCompiler.builds
index 841203881..3c6ea9fc8 100644
--- a/pkg/Microsoft.DotNet.ILCompiler/Microsoft.DotNet.ILCompiler.builds
+++ b/pkg/Microsoft.DotNet.ILCompiler/Microsoft.DotNet.ILCompiler.builds
@@ -1,12 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+
<ItemGroup>
<Project Include="Microsoft.DotNet.ILCompiler.pkgproj" >
- <OSGroup>Windows_NT</OSGroup>
- <OSGroup>Linux</OSGroup>
- <OSGroup>Mac</OSGroup>
+ <OSGroup>AnyOS</OSGroup>
</Project>
+
+ <!-- Include this to force a build of platform-specific packages-->
+ <Project Include="$(MSBuildThisFileDirectory)\TargetSpecific\Microsoft.DotNet.ILCompiler.pkgproj" />
+
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.traversal.targets))\dir.traversal.targets" />
</Project>
diff --git a/pkg/Microsoft.DotNet.ILCompiler/Microsoft.DotNet.ILCompiler.pkgproj b/pkg/Microsoft.DotNet.ILCompiler/Microsoft.DotNet.ILCompiler.pkgproj
index a94ce651b..ac7f6c2b1 100644
--- a/pkg/Microsoft.DotNet.ILCompiler/Microsoft.DotNet.ILCompiler.pkgproj
+++ b/pkg/Microsoft.DotNet.ILCompiler/Microsoft.DotNet.ILCompiler.pkgproj
@@ -5,44 +5,23 @@
<BaseLinePackageDependencies>false</BaseLinePackageDependencies>
<PackagePlatforms>x64;</PackagePlatforms>
<PreventImplementationReference>true</PreventImplementationReference>
+ <RestorePackages>true</RestorePackages>
<SkipValidatePackage>true</SkipValidatePackage>
<IncludeSymbolsInPackage Condition="'$(IncludeSymbolsInPackage)' == ''">true</IncludeSymbolsInPackage>
-
+ <!-- Mark this package as a lineup (meta-) package -->
+ <IsLineupPackage Condition="'$(IsLineupPackage)' == ''">true</IsLineupPackage>
<!-- Override this property so that the package name won't look like runtime.[RID].[TFM].[ID] -->
<PackageTargetRuntime></PackageTargetRuntime>
</PropertyGroup>
+
<ItemGroup>
- <File Include="$(MSBuildThisFileDirectory)\Microsoft.DotNet.ILCompiler.targets" >
- <TargetPath>build</TargetPath>
- </File>
<File Include="$(PackageSourceDirectory)\BuildIntegration\*">
- <TargetPath>targets</TargetPath>
- </File>
- <File Include="$(BaseOutputPath)\$(OSPlatformConfig)\tools\*" Exclude="$(BaseOutputPath)\$(OSPlatformConfig)\tools\*.pdb">
- <TargetPath>tools</TargetPath>
- </File>
- <File Include="$(BaseOutputPath)\$(OSPlatformConfig)\sdk\*" Exclude="$(BaseOutputPath)\$(OSPlatformConfig)\sdk\*.pdb">
- <TargetPath>sdk</TargetPath>
- </File>
- <File Include="$(BaseOutputPath)\$(OSPlatformConfig)\framework\*.dll">
- <TargetPath>framework</TargetPath>
+ <TargetPath>build</TargetPath>
</File>
- <!-- Workaround to avoid linker warnings on Windows - include all pdb files for static native libraries -->
- <File Condition="Exists('$(BaseOutputPath)\$(OSPlatformConfig)\sdk\bootstrapper.pdb')" Include="$(BaseOutputPath)\$(OSPlatformConfig)\sdk\bootstrapper.pdb">
- <TargetPath>sdk</TargetPath>
- </File>
- <File Condition="Exists('$(BaseOutputPath)\$(OSPlatformConfig)\sdk\bootstrappercpp.pdb')" Include="$(BaseOutputPath)\$(OSPlatformConfig)\sdk\bootstrappercpp.pdb">
- <TargetPath>sdk</TargetPath>
- </File>
- <File Condition="Exists('$(BaseOutputPath)\$(OSPlatformConfig)\sdk\bootstrapperdll.pdb')" Include="$(BaseOutputPath)\$(OSPlatformConfig)\sdk\bootstrapperdll.pdb">
- <TargetPath>sdk</TargetPath>
- </File>
- <File Condition="Exists('$(BaseOutputPath)\$(OSPlatformConfig)\sdk\Runtime.pdb')" Include="$(BaseOutputPath)\$(OSPlatformConfig)\sdk\Runtime.pdb">
- <TargetPath>sdk</TargetPath>
- </File>
- <File Condition="Exists('$(BaseOutputPath)\$(OSPlatformConfig)\sdk\PortableRuntime.pdb')" Include="$(BaseOutputPath)\$(OSPlatformConfig)\sdk\PortableRuntime.pdb">
- <TargetPath>sdk</TargetPath>
+ <!-- This assembly is needed so the build tasks can be resolved and run from the metapackage -->
+ <File Include="$(BaseOutputPath)\$(OSPlatformConfig)\tools\\ILCompiler.Build.Tasks.dll" Exclude="$(BaseOutputPath)\$(OSPlatformConfig)\tools\*.pdb">
+ <TargetPath>tools</TargetPath>
</File>
</ItemGroup>
diff --git a/pkg/Microsoft.DotNet.ILCompiler/Microsoft.DotNet.ILCompiler.targets b/pkg/Microsoft.DotNet.ILCompiler/Microsoft.DotNet.ILCompiler.targets
deleted file mode 100644
index 28e6f9aa7..000000000
--- a/pkg/Microsoft.DotNet.ILCompiler/Microsoft.DotNet.ILCompiler.targets
+++ /dev/null
@@ -1,7 +0,0 @@
-<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <_ILCompilerRootDir>$(MSBuildThisFileDirectory)../</_ILCompilerRootDir>
- <IlCompilerTargetsDir>$(_ILCompilerRootDir)targets/</IlCompilerTargetsDir>
- </PropertyGroup>
- <Import Project="$(IlCompilerTargetsDir)/Microsoft.NETCore.Native.targets"/>
-</Project>
diff --git a/pkg/Microsoft.DotNet.ILCompiler/TargetSpecific/Microsoft.DotNet.ILCompiler.pkgproj b/pkg/Microsoft.DotNet.ILCompiler/TargetSpecific/Microsoft.DotNet.ILCompiler.pkgproj
new file mode 100644
index 000000000..df63fb391
--- /dev/null
+++ b/pkg/Microsoft.DotNet.ILCompiler/TargetSpecific/Microsoft.DotNet.ILCompiler.pkgproj
@@ -0,0 +1,53 @@
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+
+ <PropertyGroup>
+ <PackageTargetRuntime Condition="'$(OSGroup)' == 'Windows_NT'">win-x64</PackageTargetRuntime>
+ <PackageTargetRuntime Condition="'$(OSGroup)' == 'Linux'">linux-x64</PackageTargetRuntime>
+ <PackageTargetRuntime Condition="'$(OSGroup)' == 'OSX'">osx-x64</PackageTargetRuntime>
+ </PropertyGroup>
+
+ <!-- This target defines files and properties that need to be included in the package regardless of platform -->
+ <PropertyGroup>
+ <SkipPackageFileCheck>true</SkipPackageFileCheck>
+ <BaseLinePackageDependencies>false</BaseLinePackageDependencies>
+ <PackagePlatforms>x64;</PackagePlatforms>
+ <PreventImplementationReference>true</PreventImplementationReference>
+ <SkipValidatePackage>true</SkipValidatePackage>
+ <IncludeSymbolsInPackage Condition="'$(IncludeSymbolsInPackage)' == ''">true</IncludeSymbolsInPackage>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <File Include="$(PackageSourceDirectory)\BuildIntegration\*">
+ <TargetPath>targets</TargetPath>
+ </File>
+ <File Include="$(BaseOutputPath)\$(OSPlatformConfig)\tools\*" Exclude="$(BaseOutputPath)\$(OSPlatformConfig)\tools\*.pdb">
+ <TargetPath>tools</TargetPath>
+ </File>
+ <File Include="$(BaseOutputPath)\$(OSPlatformConfig)\sdk\*" Exclude="$(BaseOutputPath)\$(OSPlatformConfig)\sdk\*.pdb">
+ <TargetPath>sdk</TargetPath>
+ </File>
+ <File Include="$(BaseOutputPath)\$(OSPlatformConfig)\framework\*">
+ <TargetPath>framework</TargetPath>
+ </File>
+ <!-- Workaround to avoid linker warnings on Windows - include all pdb files for static native libraries -->
+ <File Condition="Exists('$(BaseOutputPath)\$(OSPlatformConfig)\sdk\bootstrapper.pdb')" Include="$(BaseOutputPath)\$(OSPlatformConfig)\sdk\bootstrapper.pdb">
+ <TargetPath>sdk</TargetPath>
+ </File>
+ <File Condition="Exists('$(BaseOutputPath)\$(OSPlatformConfig)\sdk\bootstrappercpp.pdb')" Include="$(BaseOutputPath)\$(OSPlatformConfig)\sdk\bootstrappercpp.pdb">
+ <TargetPath>sdk</TargetPath>
+ </File>
+ <File Condition="Exists('$(BaseOutputPath)\$(OSPlatformConfig)\sdk\bootstrapperdll.pdb')" Include="$(BaseOutputPath)\$(OSPlatformConfig)\sdk\bootstrapperdll.pdb">
+ <TargetPath>sdk</TargetPath>
+ </File>
+ <File Condition="Exists('$(BaseOutputPath)\$(OSPlatformConfig)\sdk\Runtime.pdb')" Include="$(BaseOutputPath)\$(OSPlatformConfig)\sdk\Runtime.pdb">
+ <TargetPath>sdk</TargetPath>
+ </File>
+ <File Condition="Exists('$(BaseOutputPath)\$(OSPlatformConfig)\sdk\PortableRuntime.pdb')" Include="$(BaseOutputPath)\$(OSPlatformConfig)\sdk\PortableRuntime.pdb">
+ <TargetPath>sdk</TargetPath>
+ </File>
+ </ItemGroup>
+ <Target Name="GetPackageDependencies"/>
+
+ <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\src\dir.targets" />
+</Project>