Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions TestProjects.props
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<Project>
<Import Project="BranchInfo.props" />
<Import Project="src\test\Assets\TestProjects\MNADeprecationWorkaround.props" />
</Project>
6 changes: 0 additions & 6 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,6 @@
"Project": "publish\\publish.proj"
}
},
"sharedfx-netcoreapp": {
"description": "Build legacy netcoreapp Shared Framework project.",
"settings": {
"Project": "src\\sharedframework\\sharedframework.proj"
}
},
"sharedfx": {
"description": "Build Shared Framework projects.",
"settings": {
Expand Down
3 changes: 2 additions & 1 deletion dir.props
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,8 @@
<SymbolPackageOutputPath Condition="'$(SymbolPackageOutputPath)'==''">$(PackageOutputPath)</SymbolPackageOutputPath>
<PackageSymbolsBinDir Condition="'$(PackageSymbolsBinDir)' == ''">$(PackagesBasePath)symbols/</PackageSymbolsBinDir>

<SharedFrameworkPublishDir>$(IntermediateOutputRootPath)sharedFrameworkPublish\</SharedFrameworkPublishDir>
<!-- Use '/' instead of '\': used directly by WiX which doesn't accept trailing '\'. -->
<SharedFrameworkPublishDir>$(IntermediateOutputRootPath)sharedFrameworkPublish/</SharedFrameworkPublishDir>
<SharedFrameworkPublishSymbolsDir>$(IntermediateOutputRootPath)sharedFrameworkPublish.symbols\</SharedFrameworkPublishSymbolsDir>
</PropertyGroup>

Expand Down
6 changes: 0 additions & 6 deletions eng/jobs/windows-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,6 @@ jobs:
condition: succeeded()

# Build Shared Frameworks
- script: build.cmd -sharedfx-netcoreapp
-- '$(CommonMSBuildArgs)
/bl:$(Build.SourcesDirectory)\sharedframework-netcoreapp.binlog'
displayName: Build sharedframework layout (legacy infrastructure)
condition: succeeded()

- script: build.cmd -sharedfx
-- '$(CommonMSBuildArgs)
/bl:$(Build.SourcesDirectory)\sharedframework.binlog'
Expand Down
1 change: 0 additions & 1 deletion src/dir.proj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
<ItemGroup>
<Project Include="$(MSBuildThisFileDirectory)src.builds" />
<Project Include="$(MSBuildThisFileDirectory)pkg/dir.proj" />
<Project Include="$(MSBuildThisFileDirectory)sharedFramework/sharedFramework.proj" />
<Project Include="$(MSBuildThisFileDirectory)pkg/projects/sharedfx.builds" />
</ItemGroup>

Expand Down
3 changes: 2 additions & 1 deletion src/pkg/packaging-tools/framework.packaging.targets
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

<Target Name="GenerateInstallers"
DependsOnTargets="
GetInstallerProperties;
GenerateDeb;
GenerateRpm;
GenerateMsi;
Expand Down Expand Up @@ -158,7 +159,7 @@
<Target Name="GenerateZip"
Condition="'$(OSGroup)' == 'Windows_NT'">
<ZipFileCreateFromDirectory
SourceDirectory="$(SharedFrameworkLayoutDir)"
SourceDirectory="$(SharedFrameworkArchiveSourceDir)"
DestinationArchive="$(CompressedArchiveFile)"
OverwriteDestination="true" />
</Target>
Expand Down
22 changes: 21 additions & 1 deletion src/pkg/packaging-tools/packaging-tools.targets
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,29 @@

<!-- Location to place the installer, in bin. -->
<InstallerFileNameWithoutExtension>$(InstallerName)-$(InstallerBuildPart)</InstallerFileNameWithoutExtension>
<InstallerFile>$(AssetOutputPath)$(InstallerFileNameWithoutExtension)$(InstallerExtension)</InstallerFile>
<InstallerFile Condition="'$(InstallerFile)' == ''">$(AssetOutputPath)$(InstallerFileNameWithoutExtension)$(InstallerExtension)</InstallerFile>
<CompressedArchiveFile>$(AssetOutputPath)$(InstallerFileNameWithoutExtension)$(CompressedFileExtension)</CompressedArchiveFile>
</PropertyGroup>

<!-- By default, a shared framework only has files in shared/, so archive that. -->
<PropertyGroup>
<SharedFrameworkArchiveSourceDir Condition="'$(SharedFrameworkArchiveSourceDir)' == ''">$(SharedFrameworkLayoutDir)shared/</SharedFrameworkArchiveSourceDir>
</PropertyGroup>

<!-- Use existing infra for non-Windows shared frameworks for now. -->
<PropertyGroup Condition="'$(GenerateSharedFramework)' == 'true'">
<GeneratePkg>false</GeneratePkg>
<BuildDebPackage>false</BuildDebPackage>
<BuildRpmPackage>false</BuildRpmPackage>
</PropertyGroup>
</Target>

<!--
By default, shared frameworks are generated based on the package. This can be overridden by the
project, and in the future, the runtime pack is likely to be used to assemble the sfx.
-->
<Target Name="GetSharedFrameworkPackageReferences"
DependsOnTargets="GetPackageIdentity"
Returns="@(_PackageIdentity)" />

</Project>
85 changes: 83 additions & 2 deletions src/pkg/packaging-tools/sharedFramework/sharedFramework.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,21 @@
Projects="$(SharedFrameworkPkgprojFile)"
Targets="GetPackageIdentity"
RemoveProperties="Configuration">
<Output TaskParameter="TargetOutputs" ItemName="PackageReference" />
<Output TaskParameter="TargetOutputs" ItemName="SfxIdentity" />
</MSBuild>

<PropertyGroup>
<PublishDir>$(SharedFrameworkLayoutDir)%(PackageReference.Identity)/%(PackageReference.Version)/</PublishDir>
<SfxIdentity>%(SfxIdentity.Identity)</SfxIdentity>
<SfxVersion>%(SfxIdentity.Version)</SfxVersion>
<PublishDir>$(SharedFrameworkLayoutDir)shared/$(SfxIdentity)/$(SfxVersion)/</PublishDir>
</PropertyGroup>

<MSBuild
Projects="$(SharedFrameworkPkgprojFile)"
Targets="GetSharedFrameworkPackageReferences"
RemoveProperties="Configuration">
<Output TaskParameter="TargetOutputs" ItemName="PackageReference" />
</MSBuild>
</Target>

<!--
Expand Down Expand Up @@ -113,18 +122,76 @@
Overwrite="true" />
</Target>

<!--
NETCoreApp (and only NETCoreApp) carries the host and host resolver in the shared framework,
which lives outside the shared/ directory. These were included in publish through package
references and the files must be moved.
-->
<Target Name="MoveSharedFrameworkHost"
Condition="'$(SfxIdentity)' == 'Microsoft.NETCore.App'"
AfterTargets="Publish">
<!-- Use the muxer we intended to consume (either restored a shipped version or the one we built) -->
<Move SourceFiles="$(PublishDir)dotnet$(ExeSuffix)" DestinationFolder="$(SharedFrameworkLayoutDir)" />

<!-- Use the FXR Resolver we intended to consume (either restored a shipped version or the one we built) -->
<Move SourceFiles="$(PublishDir)$(LibPrefix)hostfxr$(LibSuffix)" DestinationFolder="$(SharedFrameworkLayoutDir)\host\fxr\$(HostResolverVersion)" />

<!-- Ensure the host is executable. See https://github.com/NuGet/Home/issues/4424 -->
<Exec Command="chmod u+x $(SharedFrameworkLayoutDir)dotnet$(ExeSuffix)"
Condition="'$(OSGroup)' != 'Windows_NT'" />
</Target>

<!-- Clean up artifacts that dotnet-publish generates which we don't need -->
<Target Name="DeleteUnnecessaryPublishOutputs" AfterTargets="Publish">
<ItemGroup>
<ToDelete Include="$(PublishDir)apphost$(ExeSuffix)" />
<ToDelete Include="$(PublishDir)$(LibPrefix)comhost$(LibSuffix)" />
<ToDelete Include="$(PublishDir)$(LibPrefix)hostfxr$(LibSuffix)" />
<ToDelete Include="$(PublishDir)$(LibPrefix)ijwhost$(LibSuffix)" />
<!--
On Windows, LibSuffix is .dll (for dynamic libraries), but for this particular file, we also
build a .lib (static library). Make sure neither is included.

We only build this library on Windows, so other static library formats don't need to be
handled yet.
-->
<ToDelete Include="$(PublishDir)$(LibPrefix)ijwhost.lib" />
Comment thread
dagood marked this conversation as resolved.
Resolved
</ItemGroup>

<Delete Files="@(ToDelete)" />
</Target>

<!-- Preserve symbol files for compressed symbol archive. -->
<Target Name="CopySymbolsToPublishFolder"
Condition="'$(SfxIdentity)' == 'Microsoft.NETCore.App'"
AfterTargets="Publish">
<PropertyGroup>
<!--
Microsoft.NETCore.App is the name of the shared framework, but the internal package is
the one doing the crossgen.
-->
<CrossgennedPackageId>Microsoft.NETCore.App.Internal</CrossgennedPackageId>
<CrossgennedPackageSymbolDir>$(PackageSymbolsBinDir)$(CrossgennedPackageId)/</CrossgennedPackageSymbolDir>
</PropertyGroup>

<ItemGroup>
<SharedFrameworkSymbols Include="$(CrossgennedPackageSymbolDir)**/*.pdb" />
<SharedFrameworkSymbols Include="$(CrossgennedPackageSymbolDir)**/*$(SymbolFileExtension)" />

<SharedFrameworkSymbols
Include="$(CrossgennedPackageSymbolDir)**/*$(CrossGenSymbolExtension)"
Condition="'$(CrossGenSymbolExtension)' != ''" />
</ItemGroup>

<RemoveDir
Directories="$(SharedFrameworkPublishSymbolsDir)"
Condition="Exists('$(SharedFrameworkPublishSymbolsDir)')" />

<MakeDir Directories="$(SharedFrameworkPublishSymbolsDir)" />

<Copy SourceFiles="@(SharedFrameworkSymbols)" DestinationFolder="$(SharedFrameworkPublishSymbolsDir)" />
</Target>

<Target Name="GenerateRuntimeGraph"
Condition="'$(GenerateRuntimeGraph)' == 'true'"
AfterTargets="Publish">
Expand All @@ -137,8 +204,22 @@
<RuntimeGraphGeneratorRuntime Condition="'$(RuntimeGraphGeneratorRuntime)'==''">linux</RuntimeGraphGeneratorRuntime>
</PropertyGroup>

<!--
Packages to trim from Microsoft.NETCore.App.deps.json for parity with earlier sfx releases.
To be removed once the sfx is constructed from Runtime Packs, which don't have deps.
-->
<ItemGroup>
<TrimPkgsFromDeps Include="runtime.$(PackageTargetRid).microsoft.netcore.dotnethost" />
<TrimPkgsFromDeps Include="runtime.$(PackageTargetRid).microsoft.netcore.dotnetapphost" />
<TrimPkgsFromDeps Include="runtime.$(PackageTargetRid).microsoft.netcore.dotnethostresolver" />
<TrimPkgsFromDeps Include="microsoft.netcore.dotnethost" />
<TrimPkgsFromDeps Include="microsoft.netcore.dotnetapphost" />
<TrimPkgsFromDeps Include="microsoft.netcore.dotnethostresolver" />
</ItemGroup>

<ProcessSharedFrameworkDeps AssetsFilePath="$(SharedFrameworkAssetsFile)"
DepsFilePath="$(SharedFrameworkDepsFile)"
PackagesToRemove="@(TrimPkgsFromDeps)"
Runtime="$(RuntimeGraphGeneratorRuntime)"
BuildToolsTaskDir="$(BuildToolsTaskDir)" />
</Target>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<?include "..\Variables.wxi" ?>
<Fragment>
<!-- Set registry keys to allow WER to generate correct dumps. -->
<Component Id="BreadcrumbStoreFolder" Directory="BreadcrumbStore" Guid="{DA957490-EA59-42B9-B9D6-3E80F6FB0ED0}">
<CreateFolder Directory="BreadcrumbStore">
<Permission
User="Everyone"
CreateChild="no"
CreateFile="yes"
Delete="no"
DeleteChild="no"
Read="yes"
ReadAttributes="yes"
ReadExtendedAttributes="yes"
ReadPermission="yes"
Traverse="yes" />
<Permission
User="SYSTEM"
GenericAll="yes" />
<Permission
User="Administrators"
GenericAll="yes" />
</CreateFolder>
</Component>

<DirectoryRef Id="TARGETDIR">
<Directory Id="CommonAppDataFolder">
<Directory Id="MicrosoftCommonAppData" Name="Microsoft">
<Directory Id="NetFrameworkCommonAppData" Name="NetFramework">
<Directory Id="BreadcrumbStore" Name="BreadcrumbStore" />
</Directory>
</Directory>
</Directory>
</DirectoryRef>
</Fragment>
</Wix>
8 changes: 8 additions & 0 deletions src/pkg/packaging-tools/windows/sharedFramework/product.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@
<Feature Id="MainFeature" Title="Main Feature" Level="1">
<ComponentGroupRef Id="InstallFiles" />
<ComponentGroupRef Id="AuthoredRegistryKeys"/>

<?ifdef WerRelatedKeys ?>
<ComponentGroupRef Id="WerRelatedKeys"/>
<?endif?>

<?ifdef BreadcrumbStoreFolder ?>
<ComponentRef Id="BreadcrumbStoreFolder"/>
<?endif?>
</Feature>
</Product>

Expand Down
52 changes: 52 additions & 0 deletions src/pkg/packaging-tools/windows/sharedFramework/werrelatedkeys.wxs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?xml version="1.0"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<?include "..\Variables.wxi" ?>
<Fragment>
<!-- Set registry keys to allow WER to genereate correct dumps-->
<ComponentGroup Id="WerRelatedKeys">
<Component Directory="TARGETDIR">
<RegistryKey Root="HKLM" Key="SOFTWARE\Microsoft\Windows\Windows Error Reporting\RuntimeExceptionHelperModules">
<RegistryValue
Action="write"
Name="[DOTNETHOME]shared\$(var.FrameworkName)\$(var.NugetVersion)\mscordaccore.dll"
Type="integer"
Value="0"
KeyPath="yes"/>
</RegistryKey>
</Component>

<Component Directory="TARGETDIR">
<RegistryKey Root="HKLM" Key="SOFTWARE\Microsoft\Windows NT\CurrentVersion\KnownManagedDebuggingDlls">
<RegistryValue
Action="write"
Name="[DOTNETHOME]shared\$(var.FrameworkName)\$(var.NugetVersion)\mscordaccore.dll"
Type="integer"
Value="0"
KeyPath="yes"/>
</RegistryKey>
</Component>

<Component Directory="TARGETDIR">
<RegistryKey Root="HKLM" Key="SOFTWARE\Microsoft\Windows NT\CurrentVersion\KnownFunctionTableDlls">
<RegistryValue
Action="write"
Name="[DOTNETHOME]shared\$(var.FrameworkName)\$(var.NugetVersion)\mscordaccore.dll"
Type="integer"
Value="0"
KeyPath="yes"/>
</RegistryKey>
</Component>

<Component Directory="TARGETDIR">
<RegistryKey Root="HKLM" Key="SOFTWARE\Microsoft\Windows NT\CurrentVersion\MiniDumpAuxiliaryDlls">
<RegistryValue
Action="write"
Name="[DOTNETHOME]shared\$(var.FrameworkName)\$(var.NugetVersion)\coreclr.dll"
Type="string"
Value="[DOTNETHOME]shared\$(var.FrameworkName)\$(var.NugetVersion)\mscordaccore.dll"
KeyPath="yes"/>
</RegistryKey>
</Component>
</ComponentGroup>
</Fragment>
</Wix>
18 changes: 16 additions & 2 deletions src/pkg/packaging-tools/windows/wix.targets
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

<ItemGroup Condition="'$(GenerateSharedFramework)' == 'true'">
<DirectoryToHarvest
Include="$(SharedFrameworkLayoutDir)"
Include="$(SharedFrameworkLayoutDir)shared/"
Name="install-shared-framework"
SubstituteVar="SharedFrameworkSrc"
ComponentGroupName="InstallFiles"
Expand All @@ -44,6 +44,16 @@
<WixSrcFile Include="$(MSBuildThisFileDirectory)sharedFramework/registrykeys.wxs" />
</ItemGroup>

<ItemGroup Condition="'$(IncludeWerRelatedKeys)' == 'true'">
<WixSrcFile Include="$(MSBuildThisFileDirectory)sharedFramework/werrelatedkeys.wxs" />
<CandleVariables Include="WerRelatedKeys" Value="true" />
</ItemGroup>

<ItemGroup Condition="'$(IncludeBreadcrumbStoreFolder)' == 'true'">
<WixSrcFile Include="$(MSBuildThisFileDirectory)sharedFramework/breadcrumbstorefolder.wxs" />
<CandleVariables Include="BreadcrumbStoreFolder" Value="true" />
</ItemGroup>

<ItemGroup>
<WixSrcFile Include="$(MSBuildThisFileDirectory)provider.wxs" />
</ItemGroup>
Expand Down Expand Up @@ -79,6 +89,10 @@
GetWixBuildConfiguration;
GetUpgradeCode;
GenerateMsiVersionString">
<ItemGroup>
<CandleVariables Include="%(DirectoryToHarvest.SubstituteVar)" Value="%(DirectoryToHarvest.Identity)" />
</ItemGroup>

<PropertyGroup>
<_wixArgs></_wixArgs>
<_wixArgs>$(_wixArgs) -nologo</_wixArgs>
Expand All @@ -93,7 +107,7 @@
<_wixArgs>$(_wixArgs) -dTargetArchitecture="$(TargetArchitecture)"</_wixArgs>
<_wixArgs>$(_wixArgs) -dUpgradeCode="$(UpgradeCode)"</_wixArgs>
<_wixArgs>$(_wixArgs) -dDependencyKeyName="$(InstallerName.Replace('-', '_'))"</_wixArgs>
<_wixArgs>$(_wixArgs) @(DirectoryToHarvest -> '-d%(SubstituteVar)="%(Identity)', ' ')" </_wixArgs>
<_wixArgs>$(_wixArgs) @(CandleVariables -> '-d%(Identity)="%(Value)"', ' ')</_wixArgs>

<_wixArgs>$(_wixArgs) @(WixSrcFile -> '"%(Identity)"', ' ')</_wixArgs>
<_wixArgs>$(_wixArgs) @(DirectoryToHarvest -> '"%(WixSourceFile)"', ' ')</_wixArgs>
Expand Down
Loading