Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unneeded worker runtimes from linux-x64 publish #10681

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
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
23 changes: 20 additions & 3 deletions eng/build/Workers.Dotnet.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,28 @@
<PackageReference Include="Microsoft.Azure.Functions.DotNetIsolatedNativeHost" Version="1.0.11" />
</ItemGroup>

<Target Name="CleanDotnetWorkerFiles" BeforeTargets="AssignTargetPaths" Condition="$(RuntimeIdentifier.StartsWith(win))">
<Target Name="CleanDotnetWorkerFiles" BeforeTargets="AssignTargetPaths" Condition="'$(RuntimeIdentifier)' != ''">
<!-- Remove unnecessary dotnet isolated files -->
<PropertyGroup>
<!-- Using Path.Combine to ensure correct dir separator for the OS. -->
<_DotnetWorkerBinFolder>$([System.IO.Path]::Combine('workers', 'dotnet-isolated', 'bin'))</_DotnetWorkerBinFolder>
<_DotnetWorkerBinFolder>$([MSBuild]::EnsureTrailingSlash($(_DotnetWorkerBinFolder)))</_DotnetWorkerBinFolder>
<_DotnetWorkerManifestFolder>$([System.IO.Path]::Combine('$(_DotnetWorkerBinFolder)', 'prelaunchapps', '_manifest', 'spdx_2.2'))</_DotnetWorkerManifestFolder>
<_DotnetWorkerManifestFolder>$([MSBuild]::EnsureTrailingSlash($(_DotnetWorkerManifestFolder)))</_DotnetWorkerManifestFolder>
</PropertyGroup>

<ItemGroup>
<_DotnetWorkerFiles Include="@(None)" Condition="'%(None.DestinationSubDirectory)' == 'workers\dotnet-isolated\bin\'" />
<None Remove="@(_DotnetWorkerFiles)" Condition="'%(Extension)' != '.dll' AND '%(Extension)' != '.exe'" />
<!-- Get all files from the dotnet worker package. -->
<_DotnetWorkerFiles Include="@(None)" Condition="'%(None.NuGetPackageId)' == 'Microsoft.Azure.Functions.DotNetIsolatedNativeHost'" />
<!-- Remove 'bin/prelaunchapps/_manifest' folder for all runtimes. -->
<_DotnetWorkerToRemove Include="@(_DotnetWorkerFiles)" Condition="'%(DestinationSubDirectory)' == '$(_DotnetWorkerManifestFolder)'" />
<!-- Get files immediately under /bin -->
<_DotnetWorkerBinFiles Include="@(_DotnetWorkerFiles)" Condition="'%(DestinationSubDirectory)' == '$(_DotnetWorkerBinFolder)'" />
<!-- For Windows, remove all non .dll and .exe files -->
<_DotnetWorkerToRemove Include="@(_DotnetWorkerBinFiles)" Condition="$(RuntimeIdentifier.StartsWith('win')) AND '%(Extension)' != '.dll' AND '%(Extension)' != '.exe'" />
<!-- For Linux, remove all non no-extension and .so files -->
<_DotnetWorkerToRemove Include="@(_DotnetWorkerBinFiles)" Condition="$(RuntimeIdentifier.StartsWith('linux')) AND '%(Extension)' != '.so' AND '%(Extension)' != ''" />
<None Remove="@(_DotnetWorkerToRemove)" />
</ItemGroup>
</Target>

Expand Down
6 changes: 4 additions & 2 deletions eng/build/Workers.Powershell.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
<PackageReference Include="Microsoft.Azure.Functions.PowerShellWorker.PS7.4" Version="4.0.4026" />
</ItemGroup>

<Target Name="RemovePowershellWorkerRuntimes" BeforeTargets="AssignTargetPaths" Condition="$(RuntimeIdentifier.StartsWith(win))">
<Target Name="RemovePowershellWorkerRuntimes" BeforeTargets="AssignTargetPaths" Condition="'$(RuntimeIdentifier)' != ''">
<ItemGroup>
<_KeepPowerShellRuntime Include="win;win-x86;win10-x86;win-x64;win10-x64" />
<_KeepPowerShellRuntime Include="win;win-x86;win10-x86;win-x64;win10-x64" Condition="$(RuntimeIdentifier.StartsWith(win))" />
<_KeepPowerShellRuntime Include="linux;linux-x64" Condition="$(RuntimeIdentifier.StartsWith(linux))" />
</ItemGroup>

<PropertyGroup>
Expand All @@ -26,4 +27,5 @@
<None Remove="@(_PowershellRuntimeToRemove)" />
</ItemGroup>
</Target>

</Project>
Loading