Skip to content

Updating dependencies - #363

Merged
Nikola Metulev (nmetulev) merged 9 commits into
mainfrom
nm/update-deps
Mar 30, 2026
Merged

Nikola Metulev (nmetulev) merged 9 commits into
mainfrom
nm/update-deps

Conversation

@nmetulev

Copy link
Copy Markdown
Member

Updating dependencies

@github-actions

github-actions Bot commented Mar 27, 2026 •

Copy link
Copy Markdown
Contributor

Build Metrics Report

Binary Sizes

Artifact Baseline Current Delta
CLI (ARM64) 25.92 MB 25.92 MB 📈 +4.0 KB (+0.02%)
CLI (x64) 26.54 MB 26.54 MB 📈 +4.0 KB (+0.01%)
MSIX (ARM64) 11.08 MB 11.08 MB 📈 +1.0 KB (+0.01%)
MSIX (x64) 11.79 MB 11.79 MB 📈 +1.6 KB (+0.01%)
NPM Package 23.01 MB 23.01 MB 📈 +0.3 KB (+0.00%)

Test Results

✅ 414 passed out of 414 tests in 348.4s (+9.9s vs. baseline)

Test Coverage

❌ 42.3% line coverage, 46.1% branch coverage · ✅ no change vs. baseline

CLI Startup Time

35ms median (x64, winapp --version) · 📉 -11ms vs. baseline


Updated 2026-03-27 21:28:12 UTC · commit 3e0dda2 · workflow run

@nmetulev
Nikola Metulev (nmetulev) merged commit 4045245 into main Mar 30, 2026
11 checks passed
@nmetulev
Nikola Metulev (nmetulev) deleted the nm/update-deps branch March 30, 2026 17:02
Nikola Metulev (nmetulev) pushed a commit that referenced this pull request Sep 17, 2026
## Description

SkiaSharp 2.88.9 bundles libexpat 2.6.4, affected by
[CVE-2025-59375](https://nvd.nist.gov/vuln/detail/CVE-2025-59375)
(memory-exhaustion DoS). `libSkiaSharp.dll` already ships in the CLI,
and #799 makes SkiaSharp a public dependency of the Recording package,
so the exposure reaches package consumers too.

Worth saying up front: **the 2.88.9 pin was never a deliberate choice.**
#326 added `Svg.Skia 3.4.1` and SkiaSharp came in transitively. #363
bumped to Svg.Skia 3.7.0, which was the newest stable at the time (4.0.0
shipped ten days later). #799 wrote the first explicit `SkiaSharp
2.88.9` line into `Directory.Packages.props` only because Central
Package Management demands a `PackageVersion` once Recording referenced
it directly, so it recorded what already resolved. No comment, doc, or
issue ever justified the version.

**The two must move together.** Svg.Skia is compiled against a specific
SkiaSharp major but depends on it only by *minimum* version, so lifting
SkiaSharp alone resolves, restores, and compiles cleanly, then fails the
first time an SVG is rasterized. This goes to the latest stable of both:
SkiaSharp 4.152.0 and Svg.Skia 5.2.3.

SkiaSharp 4.x promoted the legacy members to errors, so six call sites
move to the modern API. Both were migrated to the overloads that are
non-obsolete in 3.x *and* 4.x, so the next major is not blocked on this
again:

- `UiScreenshotCommand` composite labels use `SKTypeface`/`SKFont` and
the `SKTextAlign` `DrawText` overload, and `DrawImage` instead of
`DrawBitmap`.
- `UiRecordingService.ProcessFrame` passes `SKSamplingOptions(Linear,
Mipmap.Linear)`, which is SkiaSharp's own mapping for the
`SKFilterQuality.Medium` it replaces, so resample quality is unchanged
by construction rather than by eyeball.

### One regression found and fixed

Svg.Skia 5.x clamps a sizeless SVG to a 1x1 picture instead of reporting
0x0. That silently disabled the "invalid dimensions" guard, because the
rasterized bounds can no longer tell "declares no size" from "is
genuinely one pixel":

```
winapp manifest update-assets empty.svg
  before: error, "SVG image has invalid dimensions (0x0) ... valid viewBox or width/height"
  after (unfixed): exit 0, and 44 blank icons written
```

The guard now reads the declared `viewBox`/`width`/`height` off the
document rather than the rasterizer's clamped bounds, which is both
correct and no longer coupled to a rendering implementation detail. A
`viewBox` alone is sufficient; failing that, width and height must be
positive and absolute, since a percentage has no meaning when generating
a fixed-size icon.

## Usage Example

No CLI surface change; `docs/cli-schema.json` regenerates
byte-identical. Behavior at the boundary is preserved, verified against
the published NativeAOT binary:

```bash
# viewBox-only SVG (no width/height) still works
winapp manifest update-assets .\viewboxonly.svg   # exit 0

# sizeless SVG still fails loudly instead of writing blank assets
winapp manifest update-assets .\empty.svg
# Error updating assets: SVG image has no usable dimensions: ...\empty.svg.
# Ensure the SVG has a valid viewBox or width/height attributes.   # exit 1
```

## Related Issue

Fixes: #805

## Type of Change

- 🐛 Bug fix
- 🔧 Config/build

## Checklist

- [x] New tests added for new functionality (if applicable)
- [x] Tested locally on Windows

## Screenshots / Demo

The acceptance bar for a graphics-library major bump is "output visually
unchanged", so this compares the three rendering paths this PR touches
against a 2.88.9 build. The difference column is amplified 8x to make
anything at all visible.

![Before/after/difference comparison of SVG icon, recording frame and
screenshot label bar
rendering](https://github.com/user-attachments/assets/4ecf861f-8b79-4651-917b-55286cacfecd)

| Path | Identical pixels | Worst block drift |
|---|---|---|
| Screenshot label bar | **100%** (byte-identical) | 0.000 / 255 |
| SVG icon 256px | 99.21% | 0.046 / 255 |
| Recording frame (1024x768 to 320x240) | 3.66% | 0.319 / 255 |

The recording frame is a deliberately adversarial case: a 7px
checkerboard, which is the worst possible input for a resampler. Almost
every pixel moves, but no channel moves more than 21/255 and the 30x30
block-average drift is 0.13%, so it is the resampler's kernel differing
in the low bits, not a structural change.

## Additional Notes

Two things reviewers should know:

**`libHarfBuzzSharp.dll` now ships (~2 MB per architecture).** Svg.Skia
5.x takes a new dependency on HarfBuzzSharp for text shaping. Every
packaging path copies by wildcard, so no script changes were needed, and
it does **not** leak into either published NuGet package (Svg.Skia is
CLI-only; Recording's nuspec was checked and declares only `SkiaSharp
4.152.0`). It will most likely need a new binskim entry in
`.config/guardian/.gdnbaselines` alongside the existing
`libSkiaSharp.dll` ones, and those signatures can only be produced by
the Official pipeline, so expect one baseline follow-up after the first
run. `libSkiaSharp.dll` itself grows from ~9 MB to ~13 MB; the two docs
that quote that number are updated.

**Dependabot is not currently offering these bumps at all.** The `skia`
group added here is review hygiene, not a safety net: it keeps a Skia
major out of a 20-package batch PR, since it needs hand migration. It
would not have caught this. Open PR #855 bumps only
`Microsoft.Windows.CsWin32` even though Svg.Skia 5.2.3 shipped Aug 27,
well past the 7-day cooldown, and NuGet coverage only landed 2026-08-11
in #728, which is why 3.7.0 sat untouched since March. The thing that
actually protects against a mismatched pair is `ImageAssetServiceTests`
rasterizing a real SVG, which is why the new test covers the
viewBox-only case the fixed guard could plausibly have broken.

**Test results.** Release build is 0 warnings / 0 errors, which is the
real proof the obsolete-API migration is complete since
`TreatWarningsAsErrors` is Release-only. 6,455 CLI + 402 UI Automation +
63 analyzer + 62 NuGet Pester tests. The 14 failures are all
environmental and none are in a Skia path: 11 `NugetServiceTests` need
`api.nuget.org` (all 28 pass against the internal mirror), 1 tries to
launch the arm64 `winapp.exe` on x64, and 2 are foreground-dependent.
One of those,
`RecordAsync_FirstScreenFrame_AcceptsAModalDialogTheTargetOwns`, was
reproduced on unmodified `origin/main` and is pre-existing.

## AI Description

<!-- ai-description-start -->
_This section is auto-generated by AI when the PR is opened or updated.
To opt out, delete this entire section including the marker comments._
<!-- ai-description-end -->

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9ab36938-7aa7-42c8-8173-ab0cf51ac113
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants