Windows releases ship a symbols zip: the release build's PDBs for profilers (#688)

package.ps1 now also writes photocraft-<v>-windows-<arch>-symbols.zip with photocraft.pdb and
photocraft_cli.pdb from the same optimized build as the signed exes, plus symbols.txt on loading
them in WPA, Superluminal or Visual Studio. It's a separate optional asset, so the MSI and
portable zip keep their size; the shared release workflow uploads everything in dist/release.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Higgs32584
2026-10-15 19:42:38 -04:00
parent 2b3d05636f
commit 7cf4f27cf6
3 changed files with 49 additions and 3 deletions
+7 -2
View File
@@ -49,8 +49,8 @@ in the dialog.
| Platform | Artifacts | Built on |
|---|---|---|
| macOS 11+ (universal: Apple silicon + Intel) | `photocraft-<v>-macos-universal.dmg`, `photocraft-cli-<v>-macos-universal.zip` | `macos-15` |
| Windows 10+ x64 | `photocraft-<v>-windows-x64.msi`, `photocraft-<v>-windows-x64-portable.zip` | `windows-latest` |
| Windows 10+ x86 (32-bit) | `photocraft-<v>-windows-x86.msi`, `photocraft-<v>-windows-x86-portable.zip` | `windows-latest` |
| Windows 10+ x64 | `photocraft-<v>-windows-x64.msi`, `photocraft-<v>-windows-x64-portable.zip`, `photocraft-<v>-windows-x64-symbols.zip` | `windows-latest` |
| Windows 10+ x86 (32-bit) | `photocraft-<v>-windows-x86.msi`, `photocraft-<v>-windows-x86-portable.zip`, `photocraft-<v>-windows-x86-symbols.zip` | `windows-latest` |
| Linux x86_64 | `photocraft-<v>-linux-x86_64.{AppImage,AppImage.zsync,deb,rpm,tar.gz,flatpak}` | `ubuntu-22.04` (Flatpak: `ubuntu-24.04`) |
| Linux aarch64 | `photocraft-<v>-linux-aarch64.{AppImage,AppImage.zsync,deb,rpm,tar.gz,flatpak}` | `ubuntu-22.04-arm` (Flatpak: `ubuntu-24.04-arm`) |
| Linux riscv64 (glibc 2.39+) | `photocraft-<v>-linux-riscv64.tar.gz` | cross-compiled on `ubuntu-24.04` (ports.ubuntu.com riscv64 libs); CLI smoke-tested under QEMU |
@@ -158,6 +158,11 @@ goes in `CARGO_TARGET_<TRIPLE>_RUSTFLAGS`, so host build scripts aren't affected
of `%APPDATA%\Photocraft`. If that folder isn't writable the app warns and uses `%APPDATA%`.
The MSI has no marker. The logic is in `apps/photocraft/src/app_dirs.rs` and works the same
on macOS and Linux.
- **Symbols zip:** `photocraft.pdb` and `photocraft_cli.pdb` from the same release build, plus
`packaging/windows/symbols.txt` (how to load them in a profiler). An optional download, so the
MSI and portable zip stay their size; it lets anyone profile the released exes with function
names (#688). Only that build's PDBs match its exes, so they can't be rebuilt later; the
release profile has no line tables, so they carry function names, not source lines.
- **Signing:** `packaging/windows/sign.ps1` signs both `.exe` files and then the `.msi` with
`signtool`, using SHA-256 and an RFC 3161 timestamp. It uses whichever material is present:
1. a `.pfx` file (`WINDOWS_CERTIFICATE`, `WINDOWS_CERTIFICATE_PASSWORD`), timestamped by
+21 -1
View File
@@ -6,6 +6,7 @@
Produces, in $env:DIST (default: dist/release):
photocraft-<version>-windows-<arch>.msi per-machine installer (WiX v5)
photocraft-<version>-windows-<arch>-portable.zip photocraft.exe + photocraft-cli.exe + portable.txt
photocraft-<version>-windows-<arch>-symbols.zip photocraft.pdb + photocraft_cli.pdb (optional, for profilers)
The binaries link the C runtime statically (+crt-static), so neither the MSI nor the portable
zip needs the Visual C++ redistributable. Signing is delegated to sign.ps1 (skipped with a
@@ -170,6 +171,25 @@ $Zip = Join-Path $Dist "photocraft-$Version-windows-$Arch-portable.zip"
Remove-Item -Force $Zip -ErrorAction SilentlyContinue
Compress-Archive -Path $Portable -DestinationPath $Zip
# ---- debug symbols -----------------------------------------------------------------------------
# The linker writes a PDB beside each exe, and the exe names it without a path (photocraft.pdb,
# photocraft_cli.pdb). They ship as a separate, optional download so profilers (Windows Performance
# Analyzer, Superluminal, Visual Studio) show PhotoCraft's function names for the released
# binaries (#688). Signing doesn't change the PDB signature an exe records, so they match the
# signed exes; a rebuild of the same commit writes a PDB that doesn't.
$Symbols = Join-Path $TargetDir "windows-package\photocraft-$Version-windows-$Arch-symbols"
Remove-Item -Recurse -Force $Symbols -ErrorAction SilentlyContinue
New-Item -ItemType Directory -Force -Path $Symbols | Out-Null
foreach ($pdb in 'photocraft.pdb', 'photocraft_cli.pdb') {
$p = Join-Path $Bin $pdb
if (-not (Test-Path $p)) { throw "$pdb is missing from $($Bin), where the release build writes it" }
Copy-Item $p $Symbols
}
Copy-Item (Join-Path $PSScriptRoot 'symbols.txt') $Symbols
$SymbolsZip = Join-Path $Dist "photocraft-$Version-windows-$Arch-symbols.zip"
Remove-Item -Force $SymbolsZip -ErrorAction SilentlyContinue
Compress-Archive -Path $Symbols -DestinationPath $SymbolsZip
# Smoke-test the CLI when this machine can run it. An ARM64 build made on an x64 runner can't run
# here; .github/workflows/windows-arm64.yml installs and runs it on ARM64 instead.
$HostArch = [System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture.ToString().ToLowerInvariant()
@@ -178,4 +198,4 @@ if ($Arch -ne 'arm64' -or $HostArch -eq 'arm64') {
} else {
Write-Output "skipping photocraft-cli --version: an $Arch build doesn't run on this $HostArch machine"
}
Get-Item $Msi, $Zip | Format-Table Name, Length
Get-Item $Msi, $Zip, $SymbolsZip | Format-Table Name, Length
+21
View File
@@ -0,0 +1,21 @@
PhotoCraft debug symbols
photocraft.pdb and photocraft_cli.pdb are the debug symbols of photocraft.exe and
photocraft-cli.exe from the release with the same version and architecture as this zip. They
were written by the same build as those exes, so they match only them: a PDB from a local build
of the same commit doesn't.
They hold PhotoCraft's function names (release builds carry no source line tables), which is
what a profiler needs to show where the time goes. PhotoCraft doesn't need them to run.
To use them, either copy both files next to photocraft.exe (the installer's folder, by default
C:\Program Files\PhotoCraft), or add this folder to the profiler's symbol path:
Windows Performance Analyzer: Trace > Configure Symbol Paths, add this folder, then
Trace > Load Symbols.
Superluminal: Settings > Symbols, add this folder as a symbol location.
Visual Studio: Tools > Options > Debugging > Symbols, add this folder.
Any tool reading _NT_SYMBOL_PATH: set _NT_SYMBOL_PATH to this folder.
When you share a profile in a PhotoCraft issue, say which version and architecture you ran
(Help > System Info).