diff --git a/docs/releasing.md b/docs/releasing.md index 406154179f0..c4fdb7e0927 100644 --- a/docs/releasing.md +++ b/docs/releasing.md @@ -66,8 +66,8 @@ in the dialog. | Platform | Artifacts | Built on | |---|---|---| | macOS 11+ (universal: Apple silicon + Intel) | `photocraft--macos-universal.dmg`, `photocraft-cli--macos-universal.zip` | `macos-15` | -| Windows 10+ x64 | `photocraft--windows-x64.msi`, `photocraft--windows-x64-portable.zip` | `windows-latest` | -| Windows 10+ x86 (32-bit) | `photocraft--windows-x86.msi`, `photocraft--windows-x86-portable.zip` | `windows-latest` | +| Windows 10+ x64 | `photocraft--windows-x64.msi`, `photocraft--windows-x64-portable.zip`, `photocraft--windows-x64-symbols.zip` | `windows-latest` | +| Windows 10+ x86 (32-bit) | `photocraft--windows-x86.msi`, `photocraft--windows-x86-portable.zip`, `photocraft--windows-x86-symbols.zip` | `windows-latest` | | Linux x86_64 | `photocraft--linux-x86_64.{AppImage,AppImage.zsync,deb,rpm,tar.gz,flatpak}` | `ubuntu-22.04` (Flatpak: `ubuntu-24.04`) | | Linux aarch64 | `photocraft--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--linux-riscv64.tar.gz` | cross-compiled on `ubuntu-24.04` (ports.ubuntu.com riscv64 libs); CLI smoke-tested under QEMU | @@ -192,6 +192,11 @@ goes in `CARGO_TARGET__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 diff --git a/packaging/windows/package.ps1 b/packaging/windows/package.ps1 index e78eb8905e4..d24d0f48162 100644 --- a/packaging/windows/package.ps1 +++ b/packaging/windows/package.ps1 @@ -6,6 +6,7 @@ Produces, in $env:DIST (default: dist/release): photocraft--windows-.msi installer (WiX v5, per-user by default, per-machine optional) photocraft--windows--portable.zip photocraft.exe + photocraft-cli.exe + portable.txt + photocraft--windows--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 @@ -189,6 +190,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() @@ -197,4 +217,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 diff --git a/packaging/windows/symbols.txt b/packaging/windows/symbols.txt new file mode 100644 index 00000000000..4e28d8e0310 --- /dev/null +++ b/packaging/windows/symbols.txt @@ -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).