Skip to content
Permalink
Browse files

Move to new ilasm version

The latest version of ilasm produced by coreclr is now a fully
independent executable; it no longer depends on having a full runtime
laid down next to it.

This means we can vastly simplify how it is deployde in our
infrastructure. The package can now be included and have ilasm manually
copied out. This is similar to the approach that we take for our
diasymreader native dependencies.

closes #37582
related #25930, #25144
  • Loading branch information...
jaredpar committed Aug 9, 2019
1 parent e589f6f commit c04a03779d3442e948726a041964a01f4e890fd5
@@ -142,8 +142,6 @@ Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "CSharpAnalyzerDriver", "src
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "BasicAnalyzerDriver", "src\Compilers\VisualBasic\BasicAnalyzerDriver\BasicAnalyzerDriver.shproj", "{E8F0BAA5-7327-43D1-9A51-644E81AE55F1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ILAsm", "src\Tools\ILTools\ILTools.proj", "{46B3E63A-C462-4133-9F27-3B85DA5E7D37}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Packages", "Packages", "{274B96B7-F815-47E3-9CA4-4024A57A478F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.NETCore.Compilers.Package", "src\NuGet\Microsoft.NETCore.Compilers\Microsoft.NETCore.Compilers.Package.csproj", "{15FEBD1B-55CE-4EBD-85E3-04898260A25B}"
@@ -405,10 +403,6 @@ Global
{E512C6C1-F085-4AD7-B0D9-E8F1A0A2A510}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E512C6C1-F085-4AD7-B0D9-E8F1A0A2A510}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E512C6C1-F085-4AD7-B0D9-E8F1A0A2A510}.Release|Any CPU.Build.0 = Release|Any CPU
{46B3E63A-C462-4133-9F27-3B85DA5E7D37}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{46B3E63A-C462-4133-9F27-3B85DA5E7D37}.Debug|Any CPU.Build.0 = Debug|Any CPU
{46B3E63A-C462-4133-9F27-3B85DA5E7D37}.Release|Any CPU.ActiveCfg = Release|Any CPU
{46B3E63A-C462-4133-9F27-3B85DA5E7D37}.Release|Any CPU.Build.0 = Release|Any CPU
{15FEBD1B-55CE-4EBD-85E3-04898260A25B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{15FEBD1B-55CE-4EBD-85E3-04898260A25B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{15FEBD1B-55CE-4EBD-85E3-04898260A25B}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -506,7 +500,6 @@ Global
{E512C6C1-F085-4AD7-B0D9-E8F1A0A2A510} = {B20208C3-D3A6-4020-A274-6BE3786D29FB}
{54E08BF5-F819-404F-A18D-0AB9EA81EA04} = {32A48625-F0AD-419D-828B-A50BDABA38EA}
{E8F0BAA5-7327-43D1-9A51-644E81AE55F1} = {C65C6143-BED3-46E6-869E-9F0BE6E84C37}
{46B3E63A-C462-4133-9F27-3B85DA5E7D37} = {FD0FAF5F-1DED-485C-99FA-84B97F3A8EEC}
{15FEBD1B-55CE-4EBD-85E3-04898260A25B} = {274B96B7-F815-47E3-9CA4-4024A57A478F}
{27B1EAE2-2E06-48EF-8A67-06D6FB3DC275} = {274B96B7-F815-47E3-9CA4-4024A57A478F}
{E0756C89-603F-4B48-8E64-1D53E62654C8} = {274B96B7-F815-47E3-9CA4-4024A57A478F}
@@ -342,8 +342,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.Edit
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AnalyzerRunner", "src\Tools\AnalyzerRunner\AnalyzerRunner.csproj", "{60166C60-813C-46C4-911D-2411B4ABBC0F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ILTools", "src\Tools\ILTools\ILTools.proj", "{DA8522ED-02BC-499C-AC71-1DF884F63987}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.Debugging.Package", "src\Dependencies\CodeAnalysis.Debugging\Microsoft.CodeAnalysis.Debugging.Package.csproj", "{FC2AE90B-2E4B-4045-9FDD-73D4F5ED6C89}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.PooledObjects.Package", "src\Dependencies\PooledObjects\Microsoft.CodeAnalysis.PooledObjects.Package.csproj", "{49E7C367-181B-499C-AC2E-8E17C81418D6}"
@@ -983,10 +981,6 @@ Global
{60166C60-813C-46C4-911D-2411B4ABBC0F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{60166C60-813C-46C4-911D-2411B4ABBC0F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{60166C60-813C-46C4-911D-2411B4ABBC0F}.Release|Any CPU.Build.0 = Release|Any CPU
{DA8522ED-02BC-499C-AC71-1DF884F63987}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DA8522ED-02BC-499C-AC71-1DF884F63987}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DA8522ED-02BC-499C-AC71-1DF884F63987}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DA8522ED-02BC-499C-AC71-1DF884F63987}.Release|Any CPU.Build.0 = Release|Any CPU
{FC2AE90B-2E4B-4045-9FDD-73D4F5ED6C89}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FC2AE90B-2E4B-4045-9FDD-73D4F5ED6C89}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FC2AE90B-2E4B-4045-9FDD-73D4F5ED6C89}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -1293,7 +1287,6 @@ Global
{2D36C343-BB6A-4CB5-902B-E2145ACCB58F} = {FD0FAF5F-1DED-485C-99FA-84B97F3A8EEC}
{FFB00FB5-8C8C-4A02-B67D-262B9D28E8B1} = {EE97CB90-33BB-4F3A-9B3D-69375DEC6AC6}
{60166C60-813C-46C4-911D-2411B4ABBC0F} = {FD0FAF5F-1DED-485C-99FA-84B97F3A8EEC}
{DA8522ED-02BC-499C-AC71-1DF884F63987} = {FD0FAF5F-1DED-485C-99FA-84B97F3A8EEC}
{FC2AE90B-2E4B-4045-9FDD-73D4F5ED6C89} = {C2D1346B-9665-4150-B644-075CF1636BAA}
{49E7C367-181B-499C-AC2E-8E17C81418D6} = {C2D1346B-9665-4150-B644-075CF1636BAA}
{037F06F0-3BE8-42D0-801E-2F74FC380AB8} = {55A62CFA-1155-46F1-ADF3-BEEE51B58AB5}
@@ -24,6 +24,7 @@
<MicrosoftCodeAnalysisTestingVersion>1.0.0-beta1-63310-01</MicrosoftCodeAnalysisTestingVersion>
<CodeStyleAnalyzerVersion>3.3.0-beta2-19376-02</CodeStyleAnalyzerVersion>
<VisualStudioEditorPackagesVersion>16.1.101</VisualStudioEditorPackagesVersion>
<ILToolsPackageVersion>5.0.0-alpha1.19409.1</ILToolsPackageVersion>
</PropertyGroup>
<!--
Dependency versions
@@ -216,6 +217,10 @@
<MicrosoftCodeAnalysisCSharpWorkspacesFixedVersion>$(CodeStyleLayerCodeAnalysisVersion)</MicrosoftCodeAnalysisCSharpWorkspacesFixedVersion>
<MicrosoftCodeAnalysisVisualBasicFixedVersion>$(CodeStyleLayerCodeAnalysisVersion)</MicrosoftCodeAnalysisVisualBasicFixedVersion>
<MicrosoftCodeAnalysisVisualBasicWorkspacesFixedVersion>$(CodeStyleLayerCodeAnalysisVersion)</MicrosoftCodeAnalysisVisualBasicWorkspacesFixedVersion>

<runtimeWinX64MicrosoftNETCoreILAsmPackageVersion>$(ILToolsPackageVersion)</runtimeWinX64MicrosoftNETCoreILAsmPackageVersion>
<runtimeLinuxX64MicrosoftNETCoreILAsmPackageVersion>$(ILToolsPackageVersion)</runtimeLinuxX64MicrosoftNETCoreILAsmPackageVersion>
<runtimeOSXX64MicrosoftNETCoreILAsmPackageVersion>$(ILToolsPackageVersion)</runtimeOSXX64MicrosoftNETCoreILAsmPackageVersion>
</PropertyGroup>
<!--
The following packages are considered implementation details and will not be included
@@ -0,0 +1,37 @@
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<Project>

<PropertyGroup>
<_ILToolsVersion>5.0.0-dev.19379.1</_ILToolsVersion>
</PropertyGroup>

<!--
This logic is adding the ILASM executable to the runtime directory of all projects that
include this target file. Several of our projects compile IL on the fly and need this
exe.
-->
<ItemGroup Condition="'$(DotNetBuildFromSource)' != 'true'">
<Content Include="$(NuGetPackageRoot)\runtime.win-x64.Microsoft.NETCore.ILAsm\$(_ILToolsVersion)\runtimes\**\*.*">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<LinkBase>runtime</LinkBase>
<Visible>false</Visible>
<Pack>false</Pack>
</Content>
<Content Include="$(NuGetPackageRoot)\runtime.linux-x64.Microsoft.NETCore.ILAsm\$(_ILToolsVersion)\runtimes\**\*.*">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<LinkBase>runtime</LinkBase>
<Visible>false</Visible>
<Pack>false</Pack>
</Content>
<Content Include="$(NuGetPackageRoot)\runtime.osx-x64.Microsoft.NETCore.ILAsm\$(_ILToolsVersion)\runtimes\**\*.*">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<LinkBase>runtime</LinkBase>
<Visible>false</Visible>
<Pack>false</Pack>
</Content>

<PackageReference Include="runtime.win-x64.Microsoft.NETCore.ILAsm" Version="$(runtimeWinX64MicrosoftNETCoreILAsmPackageVersion)" ExcludeAssets="all" />
<PackageReference Include="runtime.linux-x64.Microsoft.NETCore.ILAsm" Version="$(runtimeLinuxX64MicrosoftNETCoreILAsmPackageVersion)" ExcludeAssets="all" />
<PackageReference Include="runtime.osx-x64.Microsoft.NETCore.ILAsm" Version="$(runtimeOSXX64MicrosoftNETCoreILAsmPackageVersion)" ExcludeAssets="all" />
</ItemGroup>
</Project>
@@ -41,4 +41,5 @@
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<Import Project="$(RepositoryEngineeringDir)targets\ILTools.targets" />
</Project>
@@ -22,4 +22,5 @@
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<Import Project="$(RepositoryEngineeringDir)targets\ILTools.targets" />
</Project>
@@ -20,4 +20,5 @@
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<Import Project="$(RepositoryEngineeringDir)targets\ILTools.targets" />
</Project>
@@ -22,4 +22,5 @@
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<Import Project="$(RepositoryEngineeringDir)targets\ILTools.targets" />
</Project>
@@ -186,4 +186,5 @@
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<Import Project="$(RepositoryEngineeringDir)targets\ILTools.targets" />
</Project>
@@ -94,4 +94,5 @@
<Compile Remove="Semantics\OverloadResolutionTestSource.vb" />
<Compile Remove="Semantics\PrintResultTestSource.vb" />
</ItemGroup>
<Import Project="$(RepositoryEngineeringDir)targets\ILTools.targets" />
</Project>
@@ -32,4 +32,5 @@
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<Import Project="$(RepositoryEngineeringDir)targets\ILTools.targets" />
</Project>
@@ -21,36 +21,32 @@ public static DisposableFile CreateTempAssembly(string declarations, bool prepen

private static string GetIlasmPath()
{
if (ExecutionConditionUtil.IsWindowsDesktop)
{
return Path.Combine(
Path.GetDirectoryName(RuntimeUtilities.GetAssemblyLocation(typeof(object))),
"ilasm.exe");
}
else
{
var ilasmExeName = PlatformInformation.IsWindows ? "ilasm.exe" : "ilasm";
var ilasmExeName = PlatformInformation.IsWindows ? "ilasm.exe" : "ilasm";
var directory = Path.GetDirectoryName(RuntimeUtilities.GetAssemblyLocation(typeof(RuntimeUtilities)));
string ridName = null;

var directory = Path.GetDirectoryName(RuntimeUtilities.GetAssemblyLocation(typeof(RuntimeUtilities)));
string path = null;
#if DEBUG
const string configuration = "Debug";
#else
const string configuration = "Release";
#endif

while (directory != null && !File.Exists(path = Path.Combine(directory, "artifacts", "tools", "ILTools", configuration, ilasmExeName)))
if (ExecutionConditionUtil.Architecture == ExecutionArchitecture.x64)
{
if (ExecutionConditionUtil.IsWindows)
{
directory = Path.GetDirectoryName(directory);
ridName = "win-x64";
}

if (directory == null)
else if (ExecutionConditionUtil.IsUnix)
{
throw new NotSupportedException("Unable to find CoreCLR ilasm tool. Has the Microsoft.NETCore.ILAsm package been published to /artifacts/tools?");
ridName = "linux-x64";
}
else if (ExecutionConditionUtil.IsMacOS)
{
ridName = "osx-x64";
}
}

return path;
if (ridName is null)
{
throw new Exception("Runtime platform not supported for testing");
}

return Path.Combine(directory, "runtime", ridName, "native", ilasmExeName);
}

private static readonly string IlasmPath = GetIlasmPath();
@@ -13,13 +13,6 @@
<ProjectReference Include="..\..\..\Compilers\CSharp\Portable\Microsoft.CodeAnalysis.CSharp.csproj" />
<ProjectReference Include="..\..\..\Compilers\VisualBasic\Portable\Microsoft.CodeAnalysis.VisualBasic.vbproj" />

<!--
Reference ILAsm deploy project to make sure it's built since we need its outputs, but not reference the outputs themselves.
Note SkipGetTargetFrameworkProperties makes it possible to reference project with incompatible TFM.
GlobalPropertiesToRemove makes sure TargetFramework isn't set as a global property for the target project.
-->
<ProjectReference Include="..\..\..\Tools\ILTools\ILTools.proj" ReferenceOutputAssembly="false" SkipGetTargetFrameworkProperties="true" GlobalPropertiesToRemove="TargetFramework" Condition="'$(TargetFramework)' == 'netcoreapp2.1'" />

</ItemGroup>
<ItemGroup>
<!-- Needed to find the Unsafe.dll binary to lay out at runtime for the compiler when testing analyzers. -->

This file was deleted.

0 comments on commit c04a037

Please sign in to comment.
You can’t perform that action at this time.