diff options
-rw-r--r-- | Directory.Build.props | 7 | ||||
-rw-r--r-- | eng/Subsets.props | 3 | ||||
-rw-r--r-- | eng/liveBuilds.targets | 1 | ||||
-rw-r--r-- | eng/testing/tests.singlefile.targets | 2 | ||||
-rw-r--r-- | src/coreclr/tools/Common/TypeSystem/Ecma/SymbolReader/UnmanagedPdbSymbolReader.cs | 2 | ||||
-rw-r--r-- | src/coreclr/tools/aot/ILCompiler/ILCompiler.props | 6 | ||||
-rw-r--r-- | src/coreclr/tools/aot/crossgen2/crossgen2.csproj | 63 | ||||
-rw-r--r-- | src/coreclr/tools/aot/crossgen2/crossgen2.props | 10 | ||||
-rw-r--r-- | src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj | 110 | ||||
-rw-r--r-- | src/libraries/externals.csproj | 2 |
10 files changed, 131 insertions, 75 deletions
diff --git a/Directory.Build.props b/Directory.Build.props index ba959a65cba..5cc6f25e1d6 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -164,7 +164,8 @@ <_runtimeOS Condition="$(_runtimeOS.StartsWith('tizen'))">linux</_runtimeOS> <_runtimeOS Condition="'$(PortableBuild)' == 'true'">$(_portableOS)</_runtimeOS> - <_packageOS Condition="'$(CrossBuild)' == 'true'">$(_hostOS.ToLowerInvariant)</_packageOS> + <_packageLibc Condition="$(_runtimeOS.Contains('musl'))">-musl</_packageLibc> + <_packageOS Condition="'$(CrossBuild)' == 'true'">$(_hostOS.ToLowerInvariant)$(_packageLibc)</_packageOS> <_packageOS Condition="'$(_packageOS)' == '' and '$(PortableBuild)' == 'true'">$(_portableOS)</_packageOS> <_packageOS Condition="'$(_packageOS)' == ''">$(_runtimeOS)</_packageOS> </PropertyGroup> @@ -194,10 +195,6 @@ <PackageRID>$(_packageOS)-$(TargetArchitecture)</PackageRID> - <!-- Crossgen2 does not support armel, so we will use arm instead. --> - <Crossgen2PackageRID Condition="'$(TargetArchitecture)' == 'armel'">$(_packageOS)-arm</Crossgen2PackageRID> - <Crossgen2PackageRID Condition="'$(TargetArchitecture)' != 'armel'">$(PackageRID)</Crossgen2PackageRID> - <OutputRid Condition="'$(OutputRid)' == ''">$(PackageRID)</OutputRid> <OutputRid Condition="'$(PortableBuild)' == 'true'">$(_portableOS)-$(TargetArchitecture)</OutputRid> </PropertyGroup> diff --git a/eng/Subsets.props b/eng/Subsets.props index 524ef40f8a9..f967b3e50ec 100644 --- a/eng/Subsets.props +++ b/eng/Subsets.props @@ -71,8 +71,7 @@ <DefaultLibrariesSubsets Condition="'$(BuildTargetFramework)' == '$(NetCoreAppCurrent)' or '$(BuildTargetFramework)' == '' or '$(BuildAllConfigurations)' == 'true'">libs.native+</DefaultLibrariesSubsets> - <DefaultLibrariesSubsets>$(DefaultLibrariesSubsets)libs.sfx+libs.oob</DefaultLibrariesSubsets> - <DefaultLibrariesSubsets Condition="'$(DotNetBuildFromSource)' != 'true'">$(DefaultLibrariesSubsets)+libs.pretest</DefaultLibrariesSubsets> + <DefaultLibrariesSubsets>$(DefaultLibrariesSubsets)libs.sfx+libs.oob+libs.pretest</DefaultLibrariesSubsets> <DefaultHostSubsets>host.native+host.tools</DefaultHostSubsets> <DefaultHostSubsets Condition="'$(DotNetBuildFromSource)' != 'true'">$(DefaultHostSubsets)+host.pkg+host.tests</DefaultHostSubsets> diff --git a/eng/liveBuilds.targets b/eng/liveBuilds.targets index a8e8fffe470..77e9a90b97d 100644 --- a/eng/liveBuilds.targets +++ b/eng/liveBuilds.targets @@ -49,6 +49,7 @@ <CoreCLRCrossTargetComponentDirName Condition="'$(TargetArchitecture)' == 'arm' and '$(BuildArchitecture)' != 'arm' and '$(TargetsWindows)' == 'true'">x86</CoreCLRCrossTargetComponentDirName> <CoreCLRCrossTargetComponentDirName Condition="'$(TargetArchitecture)' == 'arm' and '$(BuildArchitecture)' != 'arm' and '$(TargetsLinux)' == 'true'">x64</CoreCLRCrossTargetComponentDirName> <CoreCLRCrossTargetComponentDirName Condition="'$(TargetArchitecture)' == 'armel' and '$(BuildArchitecture)' != 'armel' and '$(TargetsLinux)' == 'true'">x64</CoreCLRCrossTargetComponentDirName> + <SingleFileHostSourcePath>$(CoreCLRArtifactsPath)/corehost/singlefilehost$(ExeSuffix)</SingleFileHostSourcePath> </PropertyGroup> <Target Name="ResolveRuntimeFilesFromLocalBuild"> diff --git a/eng/testing/tests.singlefile.targets b/eng/testing/tests.singlefile.targets index e5f12a683a9..f95e1957de0 100644 --- a/eng/testing/tests.singlefile.targets +++ b/eng/testing/tests.singlefile.targets @@ -16,8 +16,6 @@ <PublishSingleFile>true</PublishSingleFile> <UseAppHost>true</UseAppHost> <SelfContained>true</SelfContained> - <SingleFileHostSourcePath>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'coreclr', '$(TargetOS).$(TargetArchitecture).$(Configuration)', 'corehost'))/singlefilehost</SingleFileHostSourcePath> - <SingleFileHostSourcePath Condition="'$(TargetOS)' == 'windows'">$(SingleFileHostSourcePath).exe</SingleFileHostSourcePath> </PropertyGroup> <PropertyGroup Condition="'$(TestNativeAot)' == 'true'"> diff --git a/src/coreclr/tools/Common/TypeSystem/Ecma/SymbolReader/UnmanagedPdbSymbolReader.cs b/src/coreclr/tools/Common/TypeSystem/Ecma/SymbolReader/UnmanagedPdbSymbolReader.cs index 24af734e55a..d4b6f3686be 100644 --- a/src/coreclr/tools/Common/TypeSystem/Ecma/SymbolReader/UnmanagedPdbSymbolReader.cs +++ b/src/coreclr/tools/Common/TypeSystem/Ecma/SymbolReader/UnmanagedPdbSymbolReader.cs @@ -25,7 +25,7 @@ namespace Internal.TypeSystem.Ecma /// </summary> public abstract class UnmanagedPdbSymbolReader : PdbSymbolReader { - public static PdbSymbolReader TryOpenSymbolReaderForMetadataFile(string metadataFileName, string searchPath) + public static PdbSymbolReader? TryOpenSymbolReaderForMetadataFile(string metadataFileName, string searchPath) { return null; } diff --git a/src/coreclr/tools/aot/ILCompiler/ILCompiler.props b/src/coreclr/tools/aot/ILCompiler/ILCompiler.props index 4b9d53b16c6..8c4fce52390 100644 --- a/src/coreclr/tools/aot/ILCompiler/ILCompiler.props +++ b/src/coreclr/tools/aot/ILCompiler/ILCompiler.props @@ -125,16 +125,18 @@ <TargetSpec>$(TargetOSComponent)_$(TargetArchitectureForLocalJitBuild)_$(TargetArchitectureForSharedLibraries)</TargetSpec> <JitInterfaceLibraryName>$(LibPrefix)jitinterface_$(TargetArchitectureForSharedLibraries)$(LibSuffix)</JitInterfaceLibraryName> + <!-- This will be provided when using the liveBuild, and unset otherwise. --> + <CoreCLRArtifactsPath Condition="'$(CoreCLRArtifactsPath)' == ''">$(RuntimeBinDir)$(CrossHostArch)</CoreCLRArtifactsPath> </PropertyGroup> <ItemGroup> - <Content Include="$(RuntimeBinDir)$(CrossHostArch)/$(JitInterfaceLibraryName)" + <Content Include="$(CoreCLRArtifactsPath)/$(JitInterfaceLibraryName)" CopyToOutputDirectory="PreserveNewest" CopyToPublishDirectory="PreserveNewest" Link="%(FileName)%(Extension)" /> - <Content Include="$(RuntimeBinDir)$(CrossHostArch)/$(LibPrefix)clrjit_*_$(TargetArchitectureForSharedLibraries)$(LibSuffix)" + <Content Include="$(CoreCLRArtifactsPath)/$(LibPrefix)clrjit_*_$(TargetArchitectureForSharedLibraries)$(LibSuffix)" CopyToOutputDirectory="PreserveNewest" CopyToPublishDirectory="PreserveNewest" Link="%(FileName)%(Extension)" diff --git a/src/coreclr/tools/aot/crossgen2/crossgen2.csproj b/src/coreclr/tools/aot/crossgen2/crossgen2.csproj index 7959568995a..42f192a3f12 100644 --- a/src/coreclr/tools/aot/crossgen2/crossgen2.csproj +++ b/src/coreclr/tools/aot/crossgen2/crossgen2.csproj @@ -1,9 +1,62 @@ -<Project Sdk="Microsoft.NET.Sdk"> +<Project> + + <Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" /> + <PropertyGroup> - <OutputPath>$(RuntimeBinDir)/crossgen2</OutputPath> - <!-- The default value for macOS is false --> - <UseAppHost>true</UseAppHost> - <AppHostRuntimeIdentifier>$(Crossgen2PackageRID)</AppHostRuntimeIdentifier> + <OutputPath>$(RuntimeBinDir)crossgen2</OutputPath> + <!-- Can't use NativeAOT in source build yet https://github.com/dotnet/runtime/issues/66859 and we + don't want to ship using NativeAOT on MacOS --> + <NativeAotSupported Condition="'$(DotNetBuildFromSource)' == 'true' or '$(TargetOS)' == 'osx'">false</NativeAotSupported> + <!-- Trimming is not currently working, but set the appropriate feature flags for NativeAOT --> + <PublishTrimmed Condition="'$(NativeAotSupported)' == 'true'">true</PublishTrimmed> + <RuntimeIdentifiers Condition="'$(RunningPublish)' != 'true' and '$(DotNetBuildFromSource)' != 'true'">linux-x64;linux-musl-x64;linux-arm;linux-musl-arm;linux-arm64;linux-musl-arm64;freebsd-x64;osx-x64;osx-arm64;win-x64;win-x86;win-arm64;win-arm</RuntimeIdentifiers> + <RuntimeIdentifiers Condition="'$(DotNetBuildFromSource)' == 'true'">$(PackageRID)</RuntimeIdentifiers> + <SelfContained>false</SelfContained> + <SelfContained Condition="'$(RunningPublish)' == 'true'">true</SelfContained> </PropertyGroup> + <Import Project="crossgen2.props" /> + + <PropertyGroup Condition="'$(NativeAotSupported)' != 'true'"> + <PublishSingleFile>true</PublishSingleFile> + <PublishReadyToRun>true</PublishReadyToRun> + <!-- Disable crossgen on NetBSD, illumos and Solaris for now. This can be revisited when we have full support. --> + <PublishReadyToRun Condition="'$(TargetOS)'=='NetBSD' Or '$(TargetOS)'=='illumos' Or '$(TargetOS)'=='Solaris'">false</PublishReadyToRun> + <!-- Disable crossgen on FreeBSD when cross building from Linux. --> + <PublishReadyToRun Condition="'$(TargetOS)'=='FreeBSD' and '$(CrossBuild)'=='true'">false</PublishReadyToRun> + <PublishReadyToRunComposite>true</PublishReadyToRunComposite> + </PropertyGroup> + + <Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" /> + + <PropertyGroup Condition="'$(NativeAotSupported)' == 'true'"> + <IlcToolsPath>$(CoreCLRILCompilerDir)</IlcToolsPath> + <IlcToolsPath Condition="'$(TargetArchitecture)' != '$(BuildArchitecture)'">$(CoreCLRCrossILCompilerDir)</IlcToolsPath> + <CppCompilerAndLinker Condition="'$(TargetArchitecture)' != '$(BuildArchitecture)' and '$(HostOS)' != 'windows'">clang-9</CppCompilerAndLinker> + <SysRoot Condition="'$(TargetArchitecture)' != '$(BuildArchitecture)' and '$(HostOS)' != 'windows'">$(ROOTFS_DIR)</SysRoot> + <IlcBuildTasksPath>$(CoreCLRILCompilerDir)netstandard/ILCompiler.Build.Tasks.dll</IlcBuildTasksPath> + <IlcSdkPath>$(CoreCLRAotSdkDir)</IlcSdkPath> + <IlcFrameworkPath>$(MicrosoftNetCoreAppRuntimePackRidLibTfmDir)</IlcFrameworkPath> + <IlcFrameworkNativePath>$(MicrosoftNetCoreAppRuntimePackNativeDir)</IlcFrameworkNativePath> + <TrimmerSingleWarn>false</TrimmerSingleWarn> + </PropertyGroup> + + <Import Project="$(R2ROverridePath)" Condition="'$(R2ROverridePath)' != ''" /> + <Import Project="$(CoreCLRBuildIntegrationDir)Microsoft.DotNet.ILCompiler.targets" + Condition="'$(NativeAotSupported)' == 'true' and '$(RunningPublish)' == 'true'" /> + + <Target Name="RewriteRuntimePackDir" + Condition="'$(RunningPublish)' == 'true'" + DependsOnTargets="ResolveRuntimeFilesFromLocalBuild" + BeforeTargets="ResolveRuntimePackAssets"> + <ItemGroup> + <!-- Remove AspNetCore runtime pack since we don't build it locally --> + <ResolvedRuntimePack Remove="Microsoft.AspNetCore.App.Runtime.$(RuntimeIdentifier)" /> + + <ResolvedRuntimePack Update="Microsoft.NETCore.App.Runtime.$(RuntimeIdentifier)"> + <PackageDirectory>$(MicrosoftNetCoreAppRuntimePackDir)</PackageDirectory> + </ResolvedRuntimePack> + </ItemGroup> + </Target> + </Project> diff --git a/src/coreclr/tools/aot/crossgen2/crossgen2.props b/src/coreclr/tools/aot/crossgen2/crossgen2.props index a0d31077248..d544530d813 100644 --- a/src/coreclr/tools/aot/crossgen2/crossgen2.props +++ b/src/coreclr/tools/aot/crossgen2/crossgen2.props @@ -68,16 +68,18 @@ <TargetSpec>$(TargetOSComponent)_$(TargetArchitectureForLocalJitBuild)_$(TargetArchitectureForSharedLibraries)</TargetSpec> <JitInterfaceLibraryName>$(LibPrefix)jitinterface_$(TargetArchitectureForSharedLibraries)$(LibSuffix)</JitInterfaceLibraryName> + <!-- This will be provided when using the liveBuild, and unset otherwise. --> + <CoreCLRArtifactsPath Condition="'$(CoreCLRArtifactsPath)' == ''">$(RuntimeBinDir)$(CrossHostArch)</CoreCLRArtifactsPath> </PropertyGroup> <ItemGroup> - <Content Include="$(RuntimeBinDir)$(CrossHostArch)/$(JitInterfaceLibraryName)" + <Content Include="$(CoreCLRArtifactsPath)/$(JitInterfaceLibraryName)" CopyToOutputDirectory="PreserveNewest" CopyToPublishDirectory="PreserveNewest" Link="%(FileName)%(Extension)" /> - <Content Include="$(RuntimeBinDir)$(CrossHostArch)/$(LibPrefix)clrjit_*_$(TargetArchitectureForSharedLibraries)$(LibSuffix)" + <Content Include="$(CoreCLRArtifactsPath)/$(LibPrefix)clrjit_*_$(TargetArchitectureForSharedLibraries)$(LibSuffix)" CopyToOutputDirectory="PreserveNewest" CopyToPublishDirectory="PreserveNewest" Link="%(FileName)%(Extension)" @@ -104,7 +106,9 @@ <DiaSymReaderTargetArch>$(TargetArchitectureForSharedLibraries)</DiaSymReaderTargetArch> <DiaSymReaderTargetArch Condition="'$(DiaSymReaderTargetArch)' == 'x64'">amd64</DiaSymReaderTargetArch> <DiaSymReaderTargetArchFileName>Microsoft.DiaSymReader.Native.$(DiaSymReaderTargetArch).dll</DiaSymReaderTargetArchFileName> - <DiaSymReaderTargetArchPath>$(PkgMicrosoft_DiaSymReader_Native)\runtimes\win\native\$(DiaSymReaderTargetArchFileName)</DiaSymReaderTargetArchPath> + <DiaSymReaderTargetArchPath Condition="'$(PkgMicrosoft_DiaSymReader_Native)' != ''">$(PkgMicrosoft_DiaSymReader_Native)\runtimes\win\native\$(DiaSymReaderTargetArchFileName)</DiaSymReaderTargetArchPath> + <!-- When publishing we won't have the NuGet packages, so use the copy from the build artifacts directory. --> + <DiaSymReaderTargetArchPath Condition="'$(PkgMicrosoft_DiaSymReader_Native)' == ''">$(CoreCLRArtifactsPath)crossgen2/$(DiaSymReaderTargetArchFileName)</DiaSymReaderTargetArchPath> </PropertyGroup> <ItemGroup Condition="'$(TargetOS)' == 'windows'"> diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj index 2dbe486d053..2e0ef08ec34 100644 --- a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj +++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj @@ -3,8 +3,9 @@ <Import Project="Sdk.props" Sdk="Microsoft.DotNet.SharedFramework.Sdk" /> <PropertyGroup> - <SkipBuild Condition="'$(RuntimeFlavor)' == 'Mono'">true</SkipBuild> - <PlatformPackageType>RuntimePack</PlatformPackageType> + <!-- Crossgen is not used for Mono, and does not currently create freebsd packages --> + <SkipBuild Condition="'$(RuntimeFlavor)' == 'Mono' or '$(RuntimeIdentifier)' == 'freebsd-x64'">true</SkipBuild> + <PlatformPackageType>ToolPack</PlatformPackageType> <SharedFrameworkName>$(SharedFrameworkName).Crossgen2</SharedFrameworkName> <PgoSuffix Condition="'$(PgoInstrument)' != ''">.PGO</PgoSuffix> <OverridePackageId>$(SharedFrameworkName)$(PgoSuffix).$(RuntimeIdentifier)</OverridePackageId> @@ -13,56 +14,70 @@ <!-- Build this pack for any RID if building from source. Otherwise, only build select RIDs. --> <RuntimeIdentifiers Condition="'$(DotNetBuildFromSource)' != 'true'">linux-x64;linux-musl-x64;linux-arm;linux-musl-arm;linux-arm64;linux-musl-arm64;freebsd-x64;osx-x64;osx-arm64;win-x64;win-x86;win-arm64;win-arm</RuntimeIdentifiers> <GenerateInstallers>false</GenerateInstallers> - <GetSharedFrameworkFilesForReadyToRunDependsOn> - AddRuntimeFilesToPackage; - AddFrameworkFilesToPackage - </GetSharedFrameworkFilesForReadyToRunDependsOn> - <PublishReadyToRun>true</PublishReadyToRun> - <!-- Disable crossgen on NetBSD, illumos and Solaris for now. This can be revisited when we have full support. --> - <PublishReadyToRun Condition="'$(TargetOS)'=='NetBSD' Or '$(TargetOS)'=='illumos' Or '$(TargetOS)'=='Solaris'">false</PublishReadyToRun> - <!-- Disable crossgen on FreeBSD when cross building from Linux. --> - <PublishReadyToRun Condition="'$(TargetOS)'=='FreeBSD' and '$(CrossBuild)'=='true'">false</PublishReadyToRun> <HostJsonTargetPath>tools/</HostJsonTargetPath> <PermitDllAndExeFilesLackingFileVersion>true</PermitDllAndExeFilesLackingFileVersion> + <!-- Publishing as single-file or NativeAOT means we can't examine the interior DLLs --> + <ShouldVerifyClosure>false</ShouldVerifyClosure> </PropertyGroup> - <PropertyGroup> - <TargetOSComponent>unix</TargetOSComponent> - <TargetOSComponent Condition="'$(TargetOS)' == 'windows'">win</TargetOSComponent> - <TargetSpec>$(TargetOSComponent)-$(TargetArchitecture)</TargetSpec> - </PropertyGroup> + <Target Name="PublishCrossgen" + BeforeTargets="GetFilesToPackage"> + + <!-- Copy System.Private.CoreLib from the coreclr bin directory to the runtime pack directory, + as we always need the copy of System.Private.CoreLib that matches exactly with the runtime. --> + <Copy SourceFiles="$(CoreCLRArtifactsPath)System.Private.CoreLib.dll" + DestinationFolder="$(MicrosoftNetCoreAppRuntimePackNativeDir)" + SkipUnchangedFiles="true" /> - <ItemGroup> - <NativeRuntimeAsset Include="$(CoreCLRCrossgen2Dir)crossgen2$(ExeSuffix)" TargetPath="tools/" /> - <Reference Include="$(CoreCLRCrossgen2Dir)crossgen2.dll" /> - <Reference Include="$(CoreCLRCrossgen2Dir)ILCompiler*.dll" /> - <Reference Condition="'$(DotNetBuildFromSource)' != 'true'" Include="$(CoreCLRCrossgen2Dir)Microsoft.DiaSymReader.dll" /> - <NativeRuntimeAsset Include="$(CoreCLRCrossgen2Dir)$(LibPrefix)jitinterface_$(TargetArchitecture)$(LibSuffix)" TargetPath="tools/" /> - <NativeRuntimeAsset Include="$(CoreCLRCrossgen2Dir)$(LibPrefix)clrjit_win_x86_$(TargetArchitecture)$(LibSuffix)" TargetPath="tools/" /> - <NativeRuntimeAsset Include="$(CoreCLRCrossgen2Dir)$(LibPrefix)clrjit_universal_arm_$(TargetArchitecture)$(LibSuffix)" TargetPath="tools/" /> - <NativeRuntimeAsset Condition="'$(TargetArchitecture)' == 'arm64' or '$(TargetArchitecture)' == 'x64'" Include="$(CoreCLRCrossgen2Dir)$(LibPrefix)clrjit_win_x64_$(TargetArchitecture)$(LibSuffix)" TargetPath="tools/" /> - <NativeRuntimeAsset Condition="'$(TargetArchitecture)' == 'arm64' or '$(TargetArchitecture)' == 'x64'" Include="$(CoreCLRCrossgen2Dir)$(LibPrefix)clrjit_unix_x64_$(TargetArchitecture)$(LibSuffix)" TargetPath="tools/" /> - <NativeRuntimeAsset Condition="'$(TargetArchitecture)' == 'arm64' or '$(TargetArchitecture)' == 'x64'" Include="$(CoreCLRCrossgen2Dir)$(LibPrefix)clrjit_universal_arm64_$(TargetArchitecture)$(LibSuffix)" TargetPath="tools/" /> - <!-- Include the native hosting layer --> - <NativeRuntimeAsset Include="$(DotNetHostBinDir)/$(LibPrefix)hostfxr$(LibSuffix)" TargetPath="tools/" /> - <NativeRuntimeAsset Include="$(DotNetHostBinDir)/$(LibPrefix)hostpolicy$(LibSuffix)" TargetPath="tools/" /> - </ItemGroup> +<MSBuild Projects="$(RepoRoot)src/coreclr/tools/aot/crossgen2/crossgen2.csproj" + Targets="Restore" + Properties="MSBuildRestoreSessionId=$([System.Guid]::NewGuid()) + ;RunningPublish=true + ;RuntimeIdentifier=$(PackageRID) + ;CoreCLRArtifactsPath=$(CoreCLRArtifactsPath) + ;R2ROverridePath=$(MSBuildThisFileDirectory)ReadyToRun.targets" /> + + <MSBuild Projects="$(RepoRoot)src/coreclr/tools/aot/crossgen2/crossgen2.csproj" + Targets="Publish;PublishItemsOutputGroup" + Properties="RunningPublish=true + ;RuntimeIdentifier=$(PackageRID) + ;CoreCLRArtifactsPath=$(CoreCLRArtifactsPath) + ;R2ROverridePath=$(MSBuildThisFileDirectory)ReadyToRun.targets"> + <Output TaskParameter="TargetOutputs" + ItemName="_RawCrossgenPublishFiles" /> + </MSBuild> - <Target Name="AddRuntimeFilesToPackage" DependsOnTargets="ResolveRuntimeFilesFromLocalBuild"> <ItemGroup> - <CrossgenFile Include="@(RuntimeFiles)" Condition="'%(Filename)' == 'crossgen'" /> - <OptimizationDataFile Include="@(RuntimeFiles)" Condition="'%(Filename)' == 'StandardOptimizationData'" /> - <ReferenceCopyLocalPaths Include="@(RuntimeFiles)" Exclude="@(CrossgenFile);@(OptimizationDataFile)" /> - <ReferenceCopyLocalPaths TargetPath="tools/" /> + <_CrossgenPublishFiles Include="@(_RawCrossgenPublishFiles->'%(OutputPath)')" + KeepMetadata="REMOVE_ALL" /> + </ItemGroup> + <ItemGroup Condition="'$(NativeAotSupported)' != 'true'"> + <FilesToPackage Include="@(_CrossgenPublishFiles)" + Exclude="*.pdb;*.h;*.lib" + TargetPath="tools/" /> + </ItemGroup> + <ItemGroup Condition="'$(NativeAotSupported)' == 'true'"> + <!-- Treat all native aot assets as native runtime assets --> + <FilesToPackage Include="@(_CrossgenPublishFiles->Distinct())" + Condition="'%(Extension)' != '.pdb'" + TargetPath="tools/" /> </ItemGroup> </Target> - <Target Name="AddFrameworkFilesToPackage" DependsOnTargets="ResolveLibrariesFromLocalBuild"> - <ItemGroup> - <ReferenceCopyLocalPaths Include="@(LibrariesRuntimeFiles)" TargetPath="tools/" /> - </ItemGroup> + <Target Name="RunPublishedCrossgen" AfterTargets="PublishCrossgen" + Condition="'$(TargetOS)' == '$(HostOS)' and '$(TargetArchitecture)' == '$(BuildArchitecture)'"> + <!-- Run the published crossgen if we're not cross-compiling --> + <Exec Command="@(FilesToPackage) $(CoreCLRArtifactsPath)IL/System.Private.CoreLib.dll --out $(IntermediateOutputPath)S.P.C.tmp" Condition="'%(FileName)%(Extension)' == 'crossgen2$(ExeSuffix)'"> + <Output TaskParameter="ExitCode" PropertyName="CrossgenExitCode" /> + </Exec> </Target> + <PropertyGroup> + <TargetOSComponent>unix</TargetOSComponent> + <TargetOSComponent Condition="'$(TargetOS)' == 'windows'">win</TargetOSComponent> + <TargetSpec>$(TargetOSComponent)-$(TargetArchitecture)</TargetSpec> + </PropertyGroup> + <Target Name="AddCrossgen2SymbolFilesToPackage" BeforeTargets="GetFilesToPackage"> <ItemGroup> <_Crossgen2SymbolFilesToPackage Include="@(Reference->'$(CoreCLRArtifactsPath)PDB\%(FileName).pdb')" /> @@ -75,22 +90,8 @@ </ItemGroup> </Target> - <PropertyGroup Condition="'$(TargetOS)' == 'windows'"> - <!-- DiaSymReader for the target architecture, which is placed into the package --> - <_diaSymTargetArch>$(TargetArchitecture)</_diaSymTargetArch> - <_diaSymTargetArch Condition="'$(TargetArchitecture)' == 'x64'">amd64</_diaSymTargetArch> - <_diaSymReaderTargetArchPath>$(PkgMicrosoft_DiaSymReader_Native)/runtimes/win/native/Microsoft.DiaSymReader.Native.$(_diaSymTargetArch).dll</_diaSymReaderTargetArchPath> - </PropertyGroup> - - <ItemGroup Condition="Exists('$(_diaSymReaderTargetArchPath)')"> - <NativeRuntimeAsset Include="$(_diaSymReaderTargetArchPath)" TargetPath="tools/" /> - </ItemGroup> - - <Import Project="$(Crossgen2SdkOverridePropsPath)" /> <Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" /> <Import Project="Sdk.targets" Sdk="Microsoft.DotNet.SharedFramework.Sdk" /> - <Import Project="$(Crossgen2SdkOverrideTargetsPath)" /> - <Import Project="ReadyToRun.targets" /> <Target Name="GetFilesToPublish"> <MSBuild Projects="$(MSBuildProjectFullPath)" @@ -106,4 +107,5 @@ TargetPath="" /> </ItemGroup> </Target> + </Project> diff --git a/src/libraries/externals.csproj b/src/libraries/externals.csproj index d97fef376bc..fc4a732a1ad 100644 --- a/src/libraries/externals.csproj +++ b/src/libraries/externals.csproj @@ -9,7 +9,7 @@ <BinPlaceNative>true</BinPlaceNative> <BinPlaceRuntime>false</BinPlaceRuntime> <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies> - <UseLiveBuiltDotNetHost Condition="'$(TargetArchitecture)' == 's390x' or '$(TargetArchitecture)' == 'armv6'">true</UseLiveBuiltDotNetHost> + <UseLiveBuiltDotNetHost Condition="'$(DotNetBuildFromSource)' == 'true' or '$(TargetArchitecture)' == 's390x' or '$(TargetArchitecture)' == 'armv6'">true</UseLiveBuiltDotNetHost> </PropertyGroup> <PropertyGroup> |