Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 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
15 changes: 11 additions & 4 deletions eng/build/Minified.targets
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,24 @@

<!-- Workers to delete in minified builds -->
<ItemGroup Condition="'$(IsMinified)' == 'true'">
<_LanguageWorkers Include="$(PublishDir)workers\python" />
<_LanguageWorkers Include="$(PublishDir)workers\java" />
<_LanguageWorkers Include="$(PublishDir)workers\powershell" />
<_LanguageWorkers Include="$(PublishDir)workers\node" />
<_LanguageWorkers Include="$(PublishDir)\workers\python" />
<_LanguageWorkers Include="$(PublishDir)\workers\java" />
<_LanguageWorkers Include="$(PublishDir)\workers\powershell" />
<_LanguageWorkers Include="$(PublishDir)\workers\node" />
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PublishDir already ends in \ so this change isn't necessary

</ItemGroup>

<!-- Remove worker directories from minified builds -->
<!-- Cannot remove entire directory due to this bug: https://github.com/Azure/azure-functions-core-tools/issues/2380 -->
<Target Name="RemoveLanguageWorkersForMin" AfterTargets="Publish" BeforeTargets="PrepareZipArtifacts" Condition="'$(RuntimeIdentifier)' != ''">
<Message Importance="low" Text="Removing language workers for minified build..." />
<RemoveDir Directories="@(_LanguageWorkers)" />

<!-- Check if any directories still exist and fail the build -->
<ItemGroup>
<_FailedToDelete Include="@(_LanguageWorkers)" Condition="Exists('%(Identity)')" />
</ItemGroup>

<Error Text="Failed to delete one or more language worker directories: %(Identity)" Condition="'@(_FailedToDelete)' != ''" />
</Target>

<!-- Write artifactsconfig.json for minified builds -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,22 @@ jobs:
displayName: 'Download artifact'
artifact: func-cli-${{ parameters.arch }}

- ${{ if startsWith(parameters.arch, 'min.') }}:
- task: ExtractFiles@1
displayName: 'Unzip func-cli (minified)'
inputs:
archiveFilePatterns: '$(Pipeline.Workspace)/func-cli-${{ parameters.arch }}/func-cli/*.zip'
destinationFolder: '$(Pipeline.Workspace)/minified-test'
cleanDestinationFolder: true
overwriteExistingFiles: true

- task: PowerShell@2
displayName: 'Verify workers directory is absent for minified build'
inputs:
targetType: filePath
filePath: '$(Build.SourcesDirectory)/eng/scripts/artifact-assembler/check-minified-dir-exists.ps1'


# Testing for non-min versions of the CLI as some of the tests require the workers.
- ${{ if not(startsWith(parameters.arch, 'min.')) }}:
- task: ExtractFiles@1
Expand Down
11 changes: 11 additions & 0 deletions eng/scripts/artifact-assembler/check-minified-dir-exists.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
$workersPath = "$(Pipeline.Workspace)/minified-test/workers"

if (-Not (Test-Path $workersPath)) {
Write-Error "Workers directory is missing at $workersPath. It must exist in minified builds."
}

$contents = Get-ChildItem -Path $workersPath

if ($contents.Count -ne 0) {
Write-Error "Workers directory is not empty. Minified builds should not include language workers."
}
1 change: 1 addition & 0 deletions release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@

- Add support for .NET 10 isolated model (#4589)
- Update log streaming to support both connection string and instrumentation Key (#4586)
- Remove content of workers dir from minified versions (#4609)
Loading