-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Updating S.R.CS.Unsafe to be built using the ilproj sdk. #31512
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -54,6 +54,8 @@ | |
| <!-- Input Directories --> | ||
| <PackagesDir>$(DotNetRestorePackagesPath)</PackagesDir> | ||
| <PackagesDir Condition="'$(PackagesDir)'==''">$(ProjectDir)packages/</PackagesDir> | ||
| <RestorePackagesPath Condition="'$(RestorePackagesPath)'==''">$(PackagesDir)</RestorePackagesPath> | ||
| <NuGetPackageRoot Condition="'$(NuGetPackageRoot)'==''">$(PackagesDir)</NuGetPackageRoot> | ||
| <ToolsDir Condition="'$(ToolsDir)'==''">$(ProjectDir)Tools/</ToolsDir> | ||
| <IlasmToolPath>$(ToolsDir)ilasm/ilasm</IlasmToolPath> | ||
| <CodeAnalysisRuleset>$(MSBuildThisFileDirectory)CodeAnalysis.ruleset</CodeAnalysisRuleset> | ||
|
|
@@ -149,6 +151,7 @@ | |
| <_runtimeOS Condition="'$(_runtimeOS)' == 'tizen.4.0.0'">ubuntu.14.04</_runtimeOS> | ||
| <_runtimeOS Condition="'$(PortableBuild)' == 'true'">$(_portableOS)</_runtimeOS> | ||
| <ToolRuntimeRID>$(_runtimeOS)-x64</ToolRuntimeRID> | ||
| <MicrosoftNetCoreIlasmPackageRuntimeId Condition="'$(MicrosoftNetCoreIlasmPackageRuntimeId)' == ''">$(ToolRuntimeRID)</MicrosoftNetCoreIlasmPackageRuntimeId> | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated to use
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we have any builds that work on a 32-bit OS.... Do we? The only 32-bit builds that I know of are
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we have any CI legs, but this was more a question of "Do we support building 32-bit CoreFX from 32-bit Windows?". If we don't, this is probably fine; otherwise, this should probably be updated to be "correct".
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure if that is supported. @weshaggard ?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not aware of us supporting 32-bit OS's. I think using the ToolRuntimeRID here should be just fine.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This property is only used in 1 spot. Does it need to be in the root .props file that everyone imports?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we can move it into the ilproj, but I will handle in a follow-up PR to avoid more maestro merge-conflicts. |
||
|
|
||
| <!-- support cross-targeting by choosing a RID to restore when running on a different machine that what we're build for --> | ||
| <_portableOS Condition="'$(OSGroup)' == 'Unix' AND '$(_runtimeOSFamily)' != 'osx' AND '$(_runtimeOSFamily)' != 'FreeBSD'">linux</_portableOS> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,6 +34,7 @@ | |
| <CoreFxExpectedPrerelease>preview1-26824-01</CoreFxExpectedPrerelease> | ||
| <MicrosoftNETCorePlatformsPackageVersion>3.0.0-preview1-26824-01</MicrosoftNETCorePlatformsPackageVersion> | ||
| <MicrosoftNETCoreRuntimeCoreCLRPackageVersion>3.0.0-preview1-26824-01</MicrosoftNETCoreRuntimeCoreCLRPackageVersion> | ||
| <MicrosoftNetCoreIlasmPackageVersion>3.0.0-preview1-26824-01</MicrosoftNetCoreIlasmPackageVersion> | ||
| <ProjectNTfsExpectedPrerelease>beta-26823-00</ProjectNTfsExpectedPrerelease> | ||
| <ProjectNTfsTestILCExpectedPrerelease>beta-26823-00</ProjectNTfsTestILCExpectedPrerelease> | ||
| <ProjectNTfsTestILCPackageVersion>1.0.0-beta-26823-00</ProjectNTfsTestILCPackageVersion> | ||
|
|
@@ -136,6 +137,17 @@ | |
| <ElementName>MicrosoftNETCoreRuntimeCoreCLRPackageVersion</ElementName> | ||
| <PackageId>Microsoft.NETCore.Runtime.CoreCLR</PackageId> | ||
| </XmlUpdateStep> | ||
| <XmlUpdateStep Include="CoreClr"> | ||
| <Path>$(MSBuildThisFileFullPath)</Path> | ||
| <ElementName>MicrosoftNetCoreIlasmPackageVersion</ElementName> | ||
| <PackageId>Microsoft.NETCore.ILAsm</PackageId> | ||
| </XmlUpdateStep> | ||
| <UpdateStep Include="CoreCLR"> | ||
| <UpdaterType>MSBuildSdk</UpdaterType> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice I didn't realize we already had this updater.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We didn't. 😄 @tannergooding added it. dotnet/buildtools#2117 Welcome back, BTW.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great thanks @tannergooding for adding this support. |
||
| <Path>$(MSBuildThisFileDirectory)global.json</Path> | ||
| <PackageId>Microsoft.NET.Sdk.IL</PackageId> | ||
| <MSBuildSdkName>Microsoft.NET.Sdk.IL</MSBuildSdkName> | ||
| </UpdateStep> | ||
| <XmlUpdateStep Include="Standard"> | ||
| <Path>$(MSBuildThisFileFullPath)</Path> | ||
| <ElementName>NETStandardLibraryPackageVersion</ElementName> | ||
|
|
@@ -180,11 +192,6 @@ | |
| <UpdaterType>File</UpdaterType> | ||
| <Path>$(MSBuildThisFileDirectory)BuildToolsVersion.txt</Path> | ||
| <PackageId>Microsoft.DotNet.BuildTools</PackageId> | ||
| </UpdateStep> | ||
| <UpdateStep Include="BuildTools"> | ||
| <UpdaterType>File</UpdaterType> | ||
| <Path>$(MSBuildThisFileDirectory)tools-local/ILAsmVersion.txt</Path> | ||
| <PackageId>Microsoft.NETCore.ILAsm</PackageId> | ||
| </UpdateStep> | ||
| <XmlUpdateStep Include="BuildTools"> | ||
| <Path>$(MSBuildThisFileFullPath)</Path> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
| <PropertyGroup> | ||
| <BuildConfigurations> | ||
| netcoreapp-Windows_NT; | ||
| netcoreappaot-Windows_NT; | ||
| netcoreapp-Unix; | ||
| uap10.0.16299; | ||
| uap10.0.16299aot; | ||
| uap; | ||
| uapaot; | ||
| mono; | ||
| </BuildConfigurations> | ||
| </PropertyGroup> | ||
| </Project> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build"> | ||
| <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.props))\Directory.Build.props" /> | ||
|
|
||
| <PropertyGroup> | ||
| <EnableBinPlacing>false</EnableBinPlacing> | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Needed to set |
||
| <NugetRuntimeIdentifier>$(ToolRuntimeRID)</NugetRuntimeIdentifier> | ||
| <RidSpecificAssets>true</RidSpecificAssets> | ||
| <NoWarn>$(NoWarn);NU1603;NU1605</NoWarn> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="Microsoft.NETCore.ILAsm"> | ||
| <Version>$(MicrosoftNetCoreIlasmPackageVersion)</Version> | ||
| </PackageReference> | ||
| <PackageReference Include="Microsoft.NETCore.ILDAsm"> | ||
| <Version>$(MicrosoftNetCoreIlasmPackageVersion)</Version> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there ever a case where these version numbers will be different? I see we are using the ILAsm version number to get the ILDAsm package.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They should always be the same. |
||
| </PackageReference> | ||
| </ItemGroup> | ||
|
|
||
| <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.targets))\Directory.Build.targets" /> | ||
| </Project> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "msbuild-sdks": { | ||
| "Microsoft.NET.Sdk.IL": "3.0.0-preview1-26824-01" | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,5 @@ | |
| <AssemblyVersion>4.0.5.0</AssemblyVersion> | ||
| <AssemblyKey>MSFT</AssemblyKey> | ||
| <IsUAP>true</IsUAP> | ||
| <LanguageTargets Condition="'$(MSBuildProjectExtension)' == '.ilproj'">$(ToolsDir)\IL.targets</LanguageTargets> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are we going to delete the
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. First, CoreCLR needs to move all of its ilproj to the SDK as well.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| </PropertyGroup> | ||
| </Project> | ||
| </Project> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
| <Project Sdk="Microsoft.NET.Sdk.IL"> | ||
| <PropertyGroup> | ||
| <DocumentationFile>$(MSBuildThisFileDirectory)System.Runtime.CompilerServices.Unsafe.xml</DocumentationFile> | ||
| <ProjectGuid>{04BA3E3C-6979-4792-B19E-C797AD607F42}</ProjectGuid> | ||
|
|
@@ -8,18 +8,29 @@ | |
| <!-- cannot build on unix, but package as OS-agnostic --> | ||
| <PackageTargetRuntime /> | ||
| <Configurations>netcoreapp-Debug;netcoreapp-Release;netcoreapp2.0-Debug;netcoreapp2.0-Release;netstandard-Debug;netstandard-Release;netstandard1.0-Debug;netstandard1.0-Release</Configurations> | ||
| <MicrosoftNetCoreIldasmPackageName>runtime.$(MicrosoftNetCoreIlasmPackageRuntimeId).microsoft.netcore.ildasm</MicrosoftNetCoreIldasmPackageName> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <Compile Include="System.Runtime.CompilerServices.Unsafe.il" /> | ||
| <Reference Include="System.Runtime" /> | ||
| <PackageReference Include="$(MicrosoftNetCoreIldasmPackageName)" Version="$(MicrosoftNetCoreIlasmPackageVersion)" PrivateAssets="all" /> | ||
| </ItemGroup> | ||
|
|
||
| <Target Name="AddResourcesFileToIlasm" | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This target is very CoreFX centric and doesn't readily apply to the more general ilproj, so I didn't port it over. |
||
| BeforeTargets="CoreCompile" | ||
| Condition="'$(OS)'=='Windows_NT'" | ||
| Inputs="$(ContractOutputPath)/$(MSBuildProjectName).dll" | ||
| Outputs="$(IntermediateOutputPath)$(MSBuildProjectName).ref.res.obj"> | ||
| <ItemGroup> | ||
| <_IlasmSourceFiles Include="$(NuGetPackageRoot)\$(MicrosoftNetCoreIldasmPackageName)\$(MicrosoftNetCoreIlasmPackageVersion)\runtimes\$(MicrosoftNetCoreIlasmPackageRuntimeId)\native\**\*" /> | ||
| <_IlasmSourceFiles Include="$(NuGetPackageRoot)\$(MicrosoftNetCoreRuntimeCoreClrPackageName)\$(MicrosoftNetCoreIlasmPackageVersion)\runtimes\$(MicrosoftNetCoreIlasmPackageRuntimeId)\native\**\*" /> | ||
| <_IlasmSourceFiles Include="$(NuGetPackageRoot)\$(MicrosoftNetCoreJitPackageName)\$(MicrosoftNetCoreIlasmPackageVersion)\runtimes\$(MicrosoftNetCoreIlasmPackageRuntimeId)\native\**\*" /> | ||
| </ItemGroup> | ||
|
|
||
| <PropertyGroup> | ||
| <_IlasmDir>$(ToolsDir)\ilasm</_IlasmDir> | ||
|
|
||
| <_IldasmCommand>$(ToolsDir)ilasm/ildasm.exe</_IldasmCommand> | ||
| <_IldasmCommand>$(_IldasmCommand) $(ContractOutputPath)/$(MSBuildProjectName).dll</_IldasmCommand> | ||
| <_IldasmCommand>$(_IldasmCommand) /OUT=$(IntermediateOutputPath)/$(MSBuildProjectName).ref.il</_IldasmCommand> | ||
|
|
@@ -36,6 +47,10 @@ | |
| <FileWrites Include="$(IntermediateOutputPath)$(MSBuildProjectName).ref.*" /> | ||
| </ItemGroup> | ||
|
|
||
| <!-- Having to copy these binaries is really inefficient. https://github.com/dotnet/coreclr/issues/18892 tracks making the ilasm tool self-contained --> | ||
| <MakeDir Directories="$(_IlasmDir)" /> | ||
| <Copy DestinationFolder="$(_IlasmDir)" SourceFiles="@(_IlasmSourceFiles)" /> | ||
|
|
||
| <!-- Getting the res file by disassemblying the contract assembly --> | ||
| <Exec Command="$(_IldasmCommand)" ConsoleToMSBuild="true" StandardOutputImportance="Low"> | ||
| <Output TaskParameter="ExitCode" PropertyName="_IldasmCommandExitCode" /> | ||
|
|
@@ -52,4 +67,4 @@ | |
| <IlasmResourceFile>$(IntermediateOutputPath)$(MSBuildProjectName).ref.res.obj</IlasmResourceFile> | ||
| </PropertyGroup> | ||
| </Target> | ||
| </Project> | ||
| </Project> | ||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Due to the way restore happens for CoreFX, we need to ensure that this is set so that it can be used by the ilproj-sdk.