Skip to content

Commit

Permalink
Only include ponyc.exe in the bin directory of Windows release zi…
Browse files Browse the repository at this point in the history
…p files

Previously the tests and benchmark executables were included, which doubled the size of the zip file.  This PR removes those files before zipping the release archive.

We do it this way because the Powershell command `Compress-Archive` cannot add a single file to a directory other than the root directory of the zip file, so we can't specify just `bin\ponyc.exe` in the list of things to add to the archive; it'll add it to the root directory.  Ponyc expects to find its lib and packages directories one directory below where it is.

Fixes #4272
  • Loading branch information
chalcolith committed Dec 9, 2023
1 parent 40f3826 commit 9579e44
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions make.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,8 @@ switch ($Command.ToLower())
$package = "ponyc-x86-64-pc-windows-msvc.zip"
Write-Output "Creating $buildDir\..\$package"

# Remove unneeded files; we do it this way because Compress-Archive cannot add a single file to anything other than the root directory
Get-ChildItem -File -Path "$Prefix\bin\*" -Exclude ponyc.exe | Remove-Item
Compress-Archive -Path "$Prefix\bin", "$Prefix\lib", "$Prefix\packages", "$Prefix\examples" -DestinationPath "$buildDir\..\$package" -Force
break
}
Expand Down

0 comments on commit 9579e44

Please sign in to comment.