Skip to content

Commit

Permalink
Remove some redundant / unused binplace directories (dotnet#54890)
Browse files Browse the repository at this point in the history
* Remove some redundant / unused binplace directories

* Fix runtime pack path

* Use OuputRid instead of PackageRID

On linux-musl, OutputRID differs from PackageRID.

* Add RuntimeOS to installer leg for musl

So that we have consistent values of $(PackageRID) for installer and libraries

* Move LibrariesConfiguration definition earlier in src/tests

This property was being defined after a number of places where it was
consumed resulting in quite a few inconsistent derived properties.
  • Loading branch information
ericstj authored Jun 30, 2021
1 parent c3b6307 commit f399076
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 53 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@
<MicrosoftNetCoreAppRefPackRefDir>$([MSBuild]::NormalizeDirectory('$(MicrosoftNetCoreAppRefPackDir)', 'ref', '$(NetCoreAppCurrent)'))</MicrosoftNetCoreAppRefPackRefDir>
<MicrosoftNetCoreAppRefPackDataDir>$([MSBuild]::NormalizeDirectory('$(MicrosoftNetCoreAppRefPackDir)', 'data'))</MicrosoftNetCoreAppRefPackDataDir>

<MicrosoftNetCoreAppRuntimePackDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'microsoft.netcore.app.runtime.$(PackageRID)', '$(Configuration)'))</MicrosoftNetCoreAppRuntimePackDir>
<MicrosoftNetCoreAppRuntimePackDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'microsoft.netcore.app.runtime.$(PackageRID)', '$(LibrariesConfiguration)'))</MicrosoftNetCoreAppRuntimePackDir>
<MicrosoftNetCoreAppRuntimePackRidDir>$([MSBuild]::NormalizeDirectory('$(MicrosoftNetCoreAppRuntimePackDir)', 'runtimes', '$(PackageRID)'))</MicrosoftNetCoreAppRuntimePackRidDir>
<MicrosoftNetCoreAppRuntimePackRidLibTfmDir>$([MSBuild]::NormalizeDirectory('$(MicrosoftNetCoreAppRuntimePackRidDir)', 'lib', '$(NetCoreAppCurrent)'))</MicrosoftNetCoreAppRuntimePackRidLibTfmDir>
<MicrosoftNetCoreAppRuntimePackNativeDir>$([MSBuild]::NormalizeDirectory('$(MicrosoftNetCoreAppRuntimePackRidDir)', 'native'))</MicrosoftNetCoreAppRuntimePackNativeDir>
Expand Down
4 changes: 2 additions & 2 deletions eng/liveBuilds.targets
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
<LibrariesAllConfigShippingPackagesDir>$([MSBuild]::NormalizeDirectory('$(LibrariesAllConfigPackagesDir)', 'Shipping'))</LibrariesAllConfigShippingPackagesDir>
<LibrariesAllConfigNonShippingPackagesDir>$([MSBuild]::NormalizeDirectory('$(LibrariesAllConfigPackagesDir)', 'NonShipping'))</LibrariesAllConfigNonShippingPackagesDir>

<LibrariesSharedFrameworkRefArtifactsPath Condition="'$(LibrariesSharedFrameworkRefArtifactsPath)' == ''">$([MSBuild]::NormalizeDirectory('$(LibrariesArtifactsPath)', 'bin', 'ref', 'microsoft.netcore.app', '$(LibrariesConfiguration)'))</LibrariesSharedFrameworkRefArtifactsPath>
<LibrariesSharedFrameworkRefArtifactsPath Condition="'$(LibrariesSharedFrameworkRefArtifactsPath)' == ''">$(MicrosoftNetCoreAppRefPackRefDir)</LibrariesSharedFrameworkRefArtifactsPath>
<LibrariesAllRefArtifactsPath Condition="'$(LibrariesAllRefArtifactsPath)' == ''">$([MSBuild]::NormalizeDirectory('$(LibrariesArtifactsPath)', 'bin', 'ref', '$(NetCoreAppCurrent)'))</LibrariesAllRefArtifactsPath>
<LibrariesSharedFrameworkBinArtifactsPath Condition="'$(LibrariesSharedFrameworkBinArtifactsPath)' == ''">$([MSBuild]::NormalizeDirectory('$(LibrariesArtifactsPath)', 'bin', 'pkg', '$(NetCoreAppCurrent)', 'runtime'))$(LibrariesTargetOSConfigurationArchitecture)\</LibrariesSharedFrameworkBinArtifactsPath>
<LibrariesSharedFrameworkBinArtifactsPath Condition="'$(LibrariesSharedFrameworkBinArtifactsPath)' == ''">$(MicrosoftNetCoreAppRuntimePackRidLibTfmDir)</LibrariesSharedFrameworkBinArtifactsPath>
<LibrariesAllBinArtifactsPath Condition="'$(LibrariesAllBinArtifactsPath)' == ''">$([MSBuild]::NormalizeDirectory('$(LibrariesArtifactsPath)', 'bin', 'runtime'))$(NetCoreAppCurrent)-$(LibrariesTargetOSConfigurationArchitecture)\</LibrariesAllBinArtifactsPath>
<LibrariesNativeArtifactsPath Condition="'$(LibrariesNativeArtifactsPath)' == ''">$([MSBuild]::NormalizeDirectory('$(LibrariesArtifactsPath)', 'bin', 'native'))$(NetCoreAppCurrent)-$(LibrariesTargetOSConfigurationArchitecture)\</LibrariesNativeArtifactsPath>

Expand Down
3 changes: 3 additions & 0 deletions eng/pipelines/installer/jobs/base-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,8 @@ jobs:
# lowercase for RID format. (Detection normally converts, but we're preventing it.)
- name: OutputRidArg
value: /p:OutputRid=linux-musl-${{ parameters.archType }}
- name: RuntimeOSArg
value: /p:RuntimeOS=linux-musl
- name: _PortableBuild
value: true

Expand All @@ -231,6 +233,7 @@ jobs:
$(LiveOverridePathArgs)
$(CommonMSBuildArgs)
$(OutputRidArg)
$(RuntimeOSArg)
- name: PublishArguments
value: >-
Expand Down
50 changes: 14 additions & 36 deletions eng/pipelines/libraries/prepare-for-bin-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,46 +6,24 @@ parameters:
steps:
- ${{ if ne(parameters.isOfficialBuild, true) }}:
- task: CopyFiles@2
displayName: Prepare testhost folder to publish
displayName: Prepare bin folders to publish (unofficial build)
inputs:
sourceFolder: $(Build.SourcesDirectory)/artifacts/bin/testhost
targetFolder: $(Build.ArtifactStagingDirectory)/artifacts/bin/testhost
sourceFolder: $(Build.SourcesDirectory)/artifacts/bin
targetFolder: $(Build.ArtifactStagingDirectory)/artifacts/bin
contents: |
ref/**
runtime/**
testhost/**
- task: CopyFiles@2
displayName: Prepare runtime folder to publish
inputs:
sourceFolder: $(Build.SourcesDirectory)/artifacts/bin/runtime
targetFolder: $(Build.ArtifactStagingDirectory)/artifacts/bin/runtime

- task: CopyFiles@2
displayName: Prepare ref folder to publish
inputs:
sourceFolder: $(Build.SourcesDirectory)/artifacts/bin/ref
targetFolder: $(Build.ArtifactStagingDirectory)/artifacts/bin/ref

- task: CopyFiles@2
displayName: Prepare shared framework ref assemblies to publish
inputs:
sourceFolder: $(Build.SourcesDirectory)/artifacts/bin/ref/microsoft.netcore.app
targetFolder: $(Build.ArtifactStagingDirectory)/artifacts/bin/ref/microsoft.netcore.app

- task: CopyFiles@2
displayName: Prepare docs folder to publish
inputs:
sourceFolder: $(Build.SourcesDirectory)/artifacts/bin/docs
targetFolder: $(Build.ArtifactStagingDirectory)/artifacts/bin/docs

- task: CopyFiles@2
displayName: Prepare shared framework runtime folder to publish
inputs:
sourceFolder: $(Build.SourcesDirectory)/artifacts/bin/pkg
targetFolder: $(Build.ArtifactStagingDirectory)/artifacts/bin/pkg

- task: CopyFiles@2
displayName: Prepare native folder to publish
displayName: Prepare bin folders to publish
inputs:
sourceFolder: $(Build.SourcesDirectory)/artifacts/bin/native
targetFolder: $(Build.ArtifactStagingDirectory)/artifacts/bin/native
sourceFolder: $(Build.SourcesDirectory)/artifacts/bin
targetFolder: $(Build.ArtifactStagingDirectory)/artifacts/bin
contents: |
docs/**
microsoft.netcore.app.*/**
native/**
- task: CopyFiles@2
displayName: Prepare artifacts packages folder to publish
Expand Down
4 changes: 0 additions & 4 deletions src/libraries/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,6 @@
<TestArchiveTestsDir>$(TestArchiveTestsRoot)$(OSPlatformConfig)/</TestArchiveTestsDir>
<TestArchiveRuntimeRoot>$(TestArchiveRoot)runtime/</TestArchiveRuntimeRoot>

<!-- Paths to binplace package content -->
<NETCoreAppPackageRefPath>$(ArtifactsBinDir)pkg\$(NetCoreAppCurrent)\ref</NETCoreAppPackageRefPath>
<NETCoreAppPackageRuntimePath>$(ArtifactsBinDir)pkg\$(NetCoreAppCurrent)\lib</NETCoreAppPackageRuntimePath>

<ASPNETCoreAppPackageRefPath>$(ArtifactsBinDir)pkg\aspnetcoreapp\ref</ASPNETCoreAppPackageRefPath>
<ASPNETCoreAppPackageRuntimePath>$(ArtifactsBinDir)pkg\aspnetcoreapp\lib</ASPNETCoreAppPackageRuntimePath>

Expand Down
7 changes: 0 additions & 7 deletions src/libraries/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,8 @@
<RuntimePath>$(NetCoreAppCurrentRuntimePath)</RuntimePath>
</BinPlaceTargetFrameworks>

<!-- binplace to directories for packages -->
<BinPlaceTargetFrameworks Include="$(NetCoreAppCurrent)-$(TargetOS)"
Condition="'$(BuildTargetFramework)' == '$(NetCoreAppCurrent)' or '$(BuildTargetFramework)' == ''">
<PackageFileNativePath Condition="'$(IsNETCoreAppSrc)' == 'true'">$(NETCoreAppPackageRuntimePath)</PackageFileNativePath>
<PackageFileRefPath Condition="'$(IsNETCoreAppRef)' == 'true'">$(NETCoreAppPackageRefPath)</PackageFileRefPath>
<PackageFileRuntimePath Condition="'$(IsNETCoreAppSrc)' == 'true'">$(NETCoreAppPackageRuntimePath)</PackageFileRuntimePath>
<NativePath Condition="'$(IsNETCoreAppSrc)' == 'true'">$(NETCoreAppPackageRuntimePath)\..\runtime\$(TargetOS)-$(Configuration)-$(TargetArchitecture)</NativePath>
<RefPath Condition="'$(IsNETCoreAppRef)' == 'true'">$(RefRootPath)microsoft.netcore.app\$(Configuration)</RefPath>
<RuntimePath Condition="'$(IsNETCoreAppSrc)' == 'true'">$(NETCoreAppPackageRuntimePath)\..\runtime\$(TargetOS)-$(Configuration)-$(TargetArchitecture)</RuntimePath>
<!-- enable trimming for any runtime project that's part of the shared framework and hasn't already set ILLinkTrimAssembly -->
<SetProperties Condition="'$(IsNETCoreAppSrc)' == 'true' and
'$(BinPlaceRuntime)' == 'true' and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<DisablePackageAssetsCache>true</DisablePackageAssetsCache>
<RuntimeIdentifiers>win-arm;win-arm64;win-x64;win-x86;$(PackageRID)</RuntimeIdentifiers>
<IncludeOOBLibraries>true</IncludeOOBLibraries>
<LibrariesConfiguration>Release</LibrariesConfiguration>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Diagnostics.Tools.RuntimeClient" Version="$(MicrosoftDiagnosticsToolsRuntimeClientVersion)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<DisablePackageAssetsCache>true</DisablePackageAssetsCache>
<RuntimeIdentifiers>win-arm;win-arm64;win-x64;win-x86;$(PackageRID)</RuntimeIdentifiers>
<IncludeOOBLibraries>true</IncludeOOBLibraries>
<LibrariesConfiguration>Release</LibrariesConfiguration>
</PropertyGroup>

<Target Name="Build" DependsOnTargets="$(TraversalBuildDependsOn)" />
Expand Down
4 changes: 4 additions & 0 deletions src/tests/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<LibrariesConfiguration>Release</LibrariesConfiguration>
</PropertyGroup>

<Import Project="$(MSBuildThisFileDirectory)\Common\dir.sdkbuild.props" Condition="'$(UsingMicrosoftNETSdk)' == 'true'" />
<Import Project="$(MSBuildThisFileDirectory)\Common\dir.common.props" Condition="'$(UsingMicrosoftNETSdk)' != 'true'" />

Expand Down
1 change: 0 additions & 1 deletion src/tests/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,6 @@

<PropertyGroup>
<IncludeOOBLibraries>true</IncludeOOBLibraries>
<LibrariesConfiguration>Release</LibrariesConfiguration>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit f399076

Please sign in to comment.