From a0840c705dbb1c0dc2c68d5eb5e524ed73af2357 Mon Sep 17 00:00:00 2001 From: Andon Andonov Date: Wed, 6 Dec 2017 16:39:56 -0800 Subject: [PATCH 1/3] ILCompiler Package Multi-Runtime Package Support --- buildpipeline/DotNet-CoreRT-Publish.json | 6 +- dir.props | 2 +- .../Microsoft.DotNet.ILCompiler.Common.props | 47 ++++ .../Microsoft.DotNet.ILCompiler.builds | 20 +- .../Microsoft.DotNet.ILCompiler.pkgproj | 45 ++-- .../Microsoft.DotNet.ILCompiler.targets | 204 +++++++++++++++++- .../linux/Microsoft.DotNet.ILCompiler.pkgproj | 12 ++ .../osx/Microsoft.DotNet.ILCompiler.pkgproj | 12 ++ .../targets/BuildFrameworkNativeObjects.proj | 44 ++++ .../targets/BuildIntegration.proj | 18 ++ .../Microsoft.NETCore.Native.Publish.targets | 66 ++++++ .../Microsoft.NETCore.Native.Unix.props | 68 ++++++ .../Microsoft.NETCore.Native.Windows.props | 80 +++++++ .../win/Microsoft.DotNet.ILCompiler.pkgproj | 12 ++ .../Microsoft.NETCore.Native.Windows.props | 2 +- 15 files changed, 599 insertions(+), 39 deletions(-) create mode 100644 pkg/Microsoft.DotNet.ILCompiler/Microsoft.DotNet.ILCompiler.Common.props create mode 100644 pkg/Microsoft.DotNet.ILCompiler/linux/Microsoft.DotNet.ILCompiler.pkgproj create mode 100644 pkg/Microsoft.DotNet.ILCompiler/osx/Microsoft.DotNet.ILCompiler.pkgproj create mode 100644 pkg/Microsoft.DotNet.ILCompiler/targets/BuildFrameworkNativeObjects.proj create mode 100644 pkg/Microsoft.DotNet.ILCompiler/targets/BuildIntegration.proj create mode 100644 pkg/Microsoft.DotNet.ILCompiler/targets/Microsoft.NETCore.Native.Publish.targets create mode 100644 pkg/Microsoft.DotNet.ILCompiler/targets/Microsoft.NETCore.Native.Unix.props create mode 100644 pkg/Microsoft.DotNet.ILCompiler/targets/Microsoft.NETCore.Native.Windows.props create mode 100644 pkg/Microsoft.DotNet.ILCompiler/win/Microsoft.DotNet.ILCompiler.pkgproj diff --git a/buildpipeline/DotNet-CoreRT-Publish.json b/buildpipeline/DotNet-CoreRT-Publish.json index ed451610e6d..3589bf04e90 100644 --- a/buildpipeline/DotNet-CoreRT-Publish.json +++ b/buildpipeline/DotNet-CoreRT-Publish.json @@ -94,7 +94,7 @@ "scriptType": "inlineScript", "scriptName": "", "arguments": "", - "inlineScript": "if ($env:Configuration -ne \"Release\") { exit }\n\n& $env:Build_SourcesDirectory\\scripts\\DotNet-Trusted-Publish\\Embed-Index.ps1 `\n $env:Pipeline_SourcesDirectory\\packages\\AzureTransfer\\Windows_NT.x64.$env:Configuration\\$env:AzureContainerSymbolPackageGlob `\n $env:Build_StagingDirectory\\IndexedSymbolPackages", + "inlineScript": "if ($env:Configuration -ne \"Release\") { exit }\n\n& $env:Build_SourcesDirectory\\scripts\\DotNet-Trusted-Publish\\Embed-Index.ps1 `\n $env:Pipeline_SourcesDirectory\\packages\\AzureTransfer\\$env:Configuration\\$env:AzureContainerSymbolPackageGlob `\n $env:Build_StagingDirectory\\IndexedSymbolPackages", "workingFolder": "", "failOnStandardError": "true" } @@ -152,7 +152,7 @@ "scriptType": "inlineScript", "scriptName": "", "arguments": "$(MyGetApiKey)", - "inlineScript": "param($ApiKey)\nif ($env:Configuration -ne \"Release\") { exit }\n& $env:CustomNuGetPath push $env:Pipeline_SourcesDirectory\\packages\\AzureTransfer\\Windows_NT.x64.$env:Configuration\\$env:AzureContainerPackageGlob $ApiKey -Source $env:MyGetFeedUrl -Timeout 3600", + "inlineScript": "param($ApiKey)\nif ($env:Configuration -ne \"Release\") { exit }\n& $env:CustomNuGetPath push $env:Pipeline_SourcesDirectory\\packages\\AzureTransfer\\$env:Configuration\\$env:AzureContainerPackageGlob $ApiKey -Source $env:MyGetFeedUrl -Timeout 3600", "workingFolder": "", "failOnStandardError": "true" } @@ -192,7 +192,7 @@ "scriptType": "inlineScript", "scriptName": "", "arguments": "-gitHubAuthToken $(UpdatePublishedVersions.AuthToken) -root $(Pipeline.SourcesDirectory)", - "inlineScript": "param($gitHubAuthToken, $root)\nif ($env:Configuration -ne \"Release\") { exit }\ncd $root\n. $root\\buildscripts\\UpdatePublishedVersions.ps1 `\n -gitHubUser dotnet-build-bot -gitHubEmail dotnet-build-bot@microsoft.com `\n -gitHubAuthToken $gitHubAuthToken `\n -versionsRepoOwner $env:VersionsRepoOwner -versionsRepo $env:VersionsRepo `\n -versionsRepoPath build-info/dotnet/$env:GitHubRepositoryName/$env:SourceBranch `\n -nupkgPath $root\\packages\\AzureTransfer\\Windows_NT.x64.$env:Configuration\\$env:AzureContainerPackageGlob", + "inlineScript": "param($gitHubAuthToken, $root)\nif ($env:Configuration -ne \"Release\") { exit }\ncd $root\n. $root\\buildscripts\\UpdatePublishedVersions.ps1 `\n -gitHubUser dotnet-build-bot -gitHubEmail dotnet-build-bot@microsoft.com `\n -gitHubAuthToken $gitHubAuthToken `\n -versionsRepoOwner $env:VersionsRepoOwner -versionsRepo $env:VersionsRepo `\n -versionsRepoPath build-info/dotnet/$env:GitHubRepositoryName/$env:SourceBranch `\n -nupkgPath $root\\packages\\AzureTransfer\\$env:Configuration\\$env:AzureContainerPackageGlob", "workingFolder": "", "failOnStandardError": "true" } diff --git a/dir.props b/dir.props index 5c78f0c1e3d..6e9f1a4f732 100644 --- a/dir.props +++ b/dir.props @@ -135,7 +135,7 @@ $(DotnetCliPath) - $(PackageOutputRoot)$(OSPlatformConfig)/ + $(PackageOutputRoot)$(BinDirConfiguration)/ $(PackageOutputPath)symbols/ diff --git a/pkg/Microsoft.DotNet.ILCompiler/Microsoft.DotNet.ILCompiler.Common.props b/pkg/Microsoft.DotNet.ILCompiler/Microsoft.DotNet.ILCompiler.Common.props new file mode 100644 index 00000000000..ad43122c87a --- /dev/null +++ b/pkg/Microsoft.DotNet.ILCompiler/Microsoft.DotNet.ILCompiler.Common.props @@ -0,0 +1,47 @@ + + + + + + true + false + x64; + true + true + true + + + + + targets + + + tools + + + sdk + + + framework + + + + sdk + + + sdk + + + sdk + + + sdk + + + sdk + + + + + \ No newline at end of file diff --git a/pkg/Microsoft.DotNet.ILCompiler/Microsoft.DotNet.ILCompiler.builds b/pkg/Microsoft.DotNet.ILCompiler/Microsoft.DotNet.ILCompiler.builds index 841203881cb..e814a633bcf 100644 --- a/pkg/Microsoft.DotNet.ILCompiler/Microsoft.DotNet.ILCompiler.builds +++ b/pkg/Microsoft.DotNet.ILCompiler/Microsoft.DotNet.ILCompiler.builds @@ -1,12 +1,26 @@ + + OSX + + + $(OS) + win + linux + osx + + + + - Windows_NT - Linux - Mac + AnyOS + + + + diff --git a/pkg/Microsoft.DotNet.ILCompiler/Microsoft.DotNet.ILCompiler.pkgproj b/pkg/Microsoft.DotNet.ILCompiler/Microsoft.DotNet.ILCompiler.pkgproj index a94ce651b38..e933a5b3f99 100644 --- a/pkg/Microsoft.DotNet.ILCompiler/Microsoft.DotNet.ILCompiler.pkgproj +++ b/pkg/Microsoft.DotNet.ILCompiler/Microsoft.DotNet.ILCompiler.pkgproj @@ -5,44 +5,35 @@ false x64; true + true true true - + + true + + + + + + + + - + + build - - targets - - + + + tools - - sdk - - - framework - - - - sdk - - - sdk - - - sdk - - - sdk - - - sdk + + targets diff --git a/pkg/Microsoft.DotNet.ILCompiler/Microsoft.DotNet.ILCompiler.targets b/pkg/Microsoft.DotNet.ILCompiler/Microsoft.DotNet.ILCompiler.targets index 28e6f9aa7c1..bbe84920f9d 100644 --- a/pkg/Microsoft.DotNet.ILCompiler/Microsoft.DotNet.ILCompiler.targets +++ b/pkg/Microsoft.DotNet.ILCompiler/Microsoft.DotNet.ILCompiler.targets @@ -1,7 +1,203 @@ - + - <_ILCompilerRootDir>$(MSBuildThisFileDirectory)../ - $(_ILCompilerRootDir)targets/ + false + <_ILCompilerPackageRootDir>$(MSBuildThisFileDirectory)../ + $(_ILCompilerPackageRootDir)targets/ + + + OSX + + + $(OS) + + win-x64 + linux-x64 + osx-x64 + <_RuntimeILCompilerPackageName Condition="'$(TargetRuntime)' != ''">runtime.$(TargetRuntime).Microsoft.DotNet.ILCompiler + $(IlCompilerTargetsDir)$(_RuntimeILCompilerPackageName).targets - + + + + $(IntermediateOutputPath)native\ + $(OutputPath)native\ + true + + + + .obj + .o + .bc + .lib + .a + $(NativeObjectExt) + .cpp + .bc + .exe + + .dll + .dylib + .so + .lib + .a + .html + $(NativeIntermediateOutputPath)$(TargetName)$(NativeObjectExt) + $(NativeOutputPath)$(TargetName)$(NativeBinaryExt) + $(NativeObject) + $(NativeIntermediateOutputPath)$(TargetName).cpp + IlcCompile + CppCompile + IlcCompile + $(NativeOutputPath) + $(NativeIntermediateOutputPath) + $(FrameworkLibPath)\Framework$(LibFileExt) + $(FrameworkLibPath)\libframework$(LibFileExt) + + + + Compile;ComputeIlcCompileInputs + $(IlcCompileDependsOn);BuildFrameworkLib + + + + + + + + + + + + + + + + + + + + + $(RuntimePackagePath) + $(RuntimePackagePath)\tools\ILCompiler.Build.Tasks.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IntermediateOutputPath=$(IntermediateOutputPath); FrameworkLibPath=$(FrameworkLibPath); FrameworkObjPath=$(FrameworkObjPath); RuntimePackagePath=$(RuntimePackagePath) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pkg/Microsoft.DotNet.ILCompiler/linux/Microsoft.DotNet.ILCompiler.pkgproj b/pkg/Microsoft.DotNet.ILCompiler/linux/Microsoft.DotNet.ILCompiler.pkgproj new file mode 100644 index 00000000000..ee248648040 --- /dev/null +++ b/pkg/Microsoft.DotNet.ILCompiler/linux/Microsoft.DotNet.ILCompiler.pkgproj @@ -0,0 +1,12 @@ + + + + + + linux-x64 + + + + + diff --git a/pkg/Microsoft.DotNet.ILCompiler/osx/Microsoft.DotNet.ILCompiler.pkgproj b/pkg/Microsoft.DotNet.ILCompiler/osx/Microsoft.DotNet.ILCompiler.pkgproj new file mode 100644 index 00000000000..da5cafaf13a --- /dev/null +++ b/pkg/Microsoft.DotNet.ILCompiler/osx/Microsoft.DotNet.ILCompiler.pkgproj @@ -0,0 +1,12 @@ + + + + + + osx-x64 + + + + + diff --git a/pkg/Microsoft.DotNet.ILCompiler/targets/BuildFrameworkNativeObjects.proj b/pkg/Microsoft.DotNet.ILCompiler/targets/BuildFrameworkNativeObjects.proj new file mode 100644 index 00000000000..9607cf9356b --- /dev/null +++ b/pkg/Microsoft.DotNet.ILCompiler/targets/BuildFrameworkNativeObjects.proj @@ -0,0 +1,44 @@ + + + + ComputeIlcCompileInputs;BuildOneFrameworkLibrary + BuildAllFrameworkLibrariesAsSingleLib + true + $(FrameworkObjPath)\ + true + + + + + + + + + LibraryToCompile=%(DefaultFrameworkAssemblies.Identity) + + + + + + + + + + + + + + + + true + + + + + + + + diff --git a/pkg/Microsoft.DotNet.ILCompiler/targets/BuildIntegration.proj b/pkg/Microsoft.DotNet.ILCompiler/targets/BuildIntegration.proj new file mode 100644 index 00000000000..5340405aa8a --- /dev/null +++ b/pkg/Microsoft.DotNet.ILCompiler/targets/BuildIntegration.proj @@ -0,0 +1,18 @@ + + + + $(BaseOutputPath)$(OSPlatformConfig)/build + + + + + + + + + + + + + + diff --git a/pkg/Microsoft.DotNet.ILCompiler/targets/Microsoft.NETCore.Native.Publish.targets b/pkg/Microsoft.DotNet.ILCompiler/targets/Microsoft.NETCore.Native.Publish.targets new file mode 100644 index 00000000000..21c72dd97ad --- /dev/null +++ b/pkg/Microsoft.DotNet.ILCompiler/targets/Microsoft.NETCore.Native.Publish.targets @@ -0,0 +1,66 @@ + + + + $(MSBuildThisFileDirectory)..\tools\ILCompiler.Build.Tasks.dll + + + false + + + + + + + + + + + + + + + + + + <_NativeIntermediateAssembly Include="@(IntermediateAssembly->'$(NativeOutputPath)%(Filename)$(NativeBinaryExt)')" /> + + + + + + + + + + + + + + + + + + + + + diff --git a/pkg/Microsoft.DotNet.ILCompiler/targets/Microsoft.NETCore.Native.Unix.props b/pkg/Microsoft.DotNet.ILCompiler/targets/Microsoft.NETCore.Native.Unix.props new file mode 100644 index 00000000000..903282f11b8 --- /dev/null +++ b/pkg/Microsoft.DotNet.ILCompiler/targets/Microsoft.NETCore.Native.Unix.props @@ -0,0 +1,68 @@ + + + + + + clang + clang-3.9 + $(CppCompilerAndLinker) + $(CppCompilerAndLinker) + ar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pkg/Microsoft.DotNet.ILCompiler/targets/Microsoft.NETCore.Native.Windows.props b/pkg/Microsoft.DotNet.ILCompiler/targets/Microsoft.NETCore.Native.Windows.props new file mode 100644 index 00000000000..f5b1622ee41 --- /dev/null +++ b/pkg/Microsoft.DotNet.ILCompiler/targets/Microsoft.NETCore.Native.Windows.props @@ -0,0 +1,80 @@ + + + + + + cl + link + lib + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pkg/Microsoft.DotNet.ILCompiler/win/Microsoft.DotNet.ILCompiler.pkgproj b/pkg/Microsoft.DotNet.ILCompiler/win/Microsoft.DotNet.ILCompiler.pkgproj new file mode 100644 index 00000000000..433dc4652a6 --- /dev/null +++ b/pkg/Microsoft.DotNet.ILCompiler/win/Microsoft.DotNet.ILCompiler.pkgproj @@ -0,0 +1,12 @@ + + + + + + win-x64 + + + + + diff --git a/src/BuildIntegration/Microsoft.NETCore.Native.Windows.props b/src/BuildIntegration/Microsoft.NETCore.Native.Windows.props index 41b0227a604..4387068c1ba 100644 --- a/src/BuildIntegration/Microsoft.NETCore.Native.Windows.props +++ b/src/BuildIntegration/Microsoft.NETCore.Native.Windows.props @@ -75,5 +75,5 @@ See the LICENSE file in the project root for more information. - + From faebf5219b3dd17f283bc7f7a979763efca49d5f Mon Sep 17 00:00:00 2001 From: Andon Andonov Date: Wed, 13 Dec 2017 20:02:12 -0800 Subject: [PATCH 2/3] Add .a files to Unix packages and fix OS detection --- .../Microsoft.DotNet.ILCompiler.Common.props | 2 +- .../Microsoft.DotNet.ILCompiler.targets | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/pkg/Microsoft.DotNet.ILCompiler/Microsoft.DotNet.ILCompiler.Common.props b/pkg/Microsoft.DotNet.ILCompiler/Microsoft.DotNet.ILCompiler.Common.props index ad43122c87a..70aebe043af 100644 --- a/pkg/Microsoft.DotNet.ILCompiler/Microsoft.DotNet.ILCompiler.Common.props +++ b/pkg/Microsoft.DotNet.ILCompiler/Microsoft.DotNet.ILCompiler.Common.props @@ -22,7 +22,7 @@ sdk - + framework diff --git a/pkg/Microsoft.DotNet.ILCompiler/Microsoft.DotNet.ILCompiler.targets b/pkg/Microsoft.DotNet.ILCompiler/Microsoft.DotNet.ILCompiler.targets index bbe84920f9d..1aefcb0466e 100644 --- a/pkg/Microsoft.DotNet.ILCompiler/Microsoft.DotNet.ILCompiler.targets +++ b/pkg/Microsoft.DotNet.ILCompiler/Microsoft.DotNet.ILCompiler.targets @@ -11,10 +11,11 @@ $(OS) - win-x64 - linux-x64 - osx-x64 - <_RuntimeILCompilerPackageName Condition="'$(TargetRuntime)' != ''">runtime.$(TargetRuntime).Microsoft.DotNet.ILCompiler + win-x64 + linux-x64 + osx-x64 + + <_RuntimeILCompilerPackageName Condition="'$(TargetRuntimeIdentifier)' != ''">runtime.$(TargetRuntimeIdentifier).Microsoft.DotNet.ILCompiler $(IlCompilerTargetsDir)$(_RuntimeILCompilerPackageName).targets From 94ebbb75364baf7e0045d093ad231e0fa4422983 Mon Sep 17 00:00:00 2001 From: Andon Andonov Date: Thu, 14 Dec 2017 11:24:23 -0800 Subject: [PATCH 3/3] Fix Perf Issue --- .../Microsoft.DotNet.ILCompiler.targets | 4 ++-- .../targets/BuildFrameworkNativeObjects.proj | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/Microsoft.DotNet.ILCompiler/Microsoft.DotNet.ILCompiler.targets b/pkg/Microsoft.DotNet.ILCompiler/Microsoft.DotNet.ILCompiler.targets index 1aefcb0466e..2832fe6b7cf 100644 --- a/pkg/Microsoft.DotNet.ILCompiler/Microsoft.DotNet.ILCompiler.targets +++ b/pkg/Microsoft.DotNet.ILCompiler/Microsoft.DotNet.ILCompiler.targets @@ -111,7 +111,7 @@ BuildFrameworkLib is invoked before IlcCompile in multi-module builds to produce the shared framework library on demand --> - + @@ -119,7 +119,7 @@ - + diff --git a/pkg/Microsoft.DotNet.ILCompiler/targets/BuildFrameworkNativeObjects.proj b/pkg/Microsoft.DotNet.ILCompiler/targets/BuildFrameworkNativeObjects.proj index 9607cf9356b..6f6c82b12f0 100644 --- a/pkg/Microsoft.DotNet.ILCompiler/targets/BuildFrameworkNativeObjects.proj +++ b/pkg/Microsoft.DotNet.ILCompiler/targets/BuildFrameworkNativeObjects.proj @@ -8,7 +8,7 @@ true - +