Skip to content

[release/4.152.x] Backport pinned Alpine CDN bootstrap - #5456

Merged
mattleibow merged 1 commit into
release/4.152.xfrom
mattleibow-alpine-bootstrap-4-152-backport
Oct 28, 2026
Merged

mattleibow merged 1 commit into
release/4.152.xfrom
mattleibow-alpine-bootstrap-4-152-backport

Conversation

@mattleibow

Copy link
Copy Markdown
Contributor

Description

Backport #5414 to release/4.152.x using an unchanged cherry-pick -x of 48e2083.

The servicing Dockerfile still downloads standalone apk.static from gitlab.alpinelinux.org. Internal package build 3118571, on release/4.150.6, failed all ten Alpine Docker jobs with curl connection timeouts to that endpoint; subsequent artifact-publishing failures were secondary. This branch contains the same vulnerable bootstrap path.

Use the official Alpine CDN's exact apk-tools-static-2.14.6-r3.apk, verify its pinned SHA-256 before extraction, execute sbin/apk.static, and bound curl connection/transfer timeouts. Preserve signed sysroot package installation. Scope is exactly two files: the Alpine Dockerfile and its directly related developer documentation (27 insertions, 8 deletions). No native source, submodule, dependency-feed, milestone, or pipeline changes.

Related issues

Related to #5414 and #4013.

Required skia PR

None.

Areas affected

  • Managed API (binding/)
  • Native / C API (externals/skia/src/c, include/c)
  • Generated P/Invoke bindings
  • Native dependency or Skia update (libpng, HarfBuzz, FreeType, zlib, milestone bump, …)
  • Views & integrations (MAUI, Uno, WPF, WinUI, Blazor, …)
  • Rendering output / visual behavior
  • Performance
  • Tests
  • Build, packaging, or CI
  • Documentation or samples

Changes

None — no public API, ABI, or application behavior changes.

Testing

Validated on macOS:

  • git diff --check origin/release/4.152.x...HEAD — passed.
  • git diff 48e2083869ab2b154b2058c32682391d1c77e403^ 48e2083869ab2b154b2058c32682391d1c77e403 | git patch-id --stable and git diff HEAD^ HEAD | git patch-id --stable — both produced 5954abdb8182c7fe0330da82e0488dc2a13dbbe4, confirming an unchanged patch.
  • The following download/checksum/extraction commands passed. file identified a statically linked x86-64 ELF executable. The intentionally wrong checksum returned failure and the negative-test guard passed.
set -eu
APK_DIR="$(mktemp -d)"
trap 'rm -f "$APK_DIR/apk-tools-static.apk" "$APK_DIR/sbin/apk.static"; rmdir "$APK_DIR/sbin" "$APK_DIR"' EXIT
curl -fSL --retry 5 --retry-delay 10 --retry-all-errors --connect-timeout 20 --max-time 120 -o "$APK_DIR/apk-tools-static.apk" https://dl-cdn.alpinelinux.org/alpine/v3.21/main/x86_64/apk-tools-static-2.14.6-r3.apk
printf '%s  %s\n' f0e0d34d6a8f1f9d8704bae6612b4627b96f13cd20db759e9b43085135cd234f "$APK_DIR/apk-tools-static.apk" | shasum -a 256 -c -
tar -xzf "$APK_DIR/apk-tools-static.apk" -C "$APK_DIR" sbin/apk.static
file "$APK_DIR/sbin/apk.static"
if printf '%064d  %s\n' 0 "$APK_DIR/apk-tools-static.apk" | shasum -a 256 -c -; then
  echo 'FAIL: invalid checksum accepted'; exit 1
else
  echo 'PASS: invalid checksum rejected'
fi

An additional ad hoc Python check passed shell syntax (bash -n), checksum-before-extraction ordering, bounded bootstrap timeouts, removal of the GitLab endpoint, and absence of --allow-untrusted.

docker info --format '{{.OSType}}/{{.Architecture}}' — failed because the local Docker daemon is unavailable (Cannot connect to the Docker daemon). Full Docker image builds, Linux execution/sysroot installs, and native builds were therefore not run locally; CI validation remains required. Managed tests were not run because this is an unchanged Docker/bootstrap-only backport with no managed/native source changes. No new test infrastructure was added.

Checklist

  • Tests added or updated (if omitted, explain why above)
  • Changes above lists all public API and behavioral changes (or "None.")
  • New/changed public API? Filed a docs issue in mono/SkiaSharp-API-docs so reference docs can be written later
  • Native change? Companion mono/skia PR linked above and bindings regenerated

[Native/Alpine] Bootstrap from a pinned Alpine CDN package (#5414)

Context: #4013
Context: https://dev.azure.com/dnceng/internal/_build/results?buildId=3112792
Context: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1645006
Context: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1645300

Remove the GitLab generic-package endpoint from Alpine cross-image
bootstrap. October 22 public and internal builds failed before native
compilation while connecting to gitlab.alpinelinux.org:443. One internal
x64 download spent approximately 852 seconds exhausting six attempts.
The same main commit had downloaded and checksum-verified the artifact
successfully on October 20. DNS resolved during investigation, but HTTPS
connections also timed out from the developer machine, including forced
IPv4; this was not confined to 1ES. The exact server or routing fault
remains unconfirmed.

The earlier retry fix in #4013 handled transient GitLab HTTP 500 responses,
but retries cannot repair sustained endpoint unavailability. Use Alpine's
reachable package-distribution CDN instead of its GitLab package registry.
Replace the standalone apk.static 2.12.14 download with the exact
apk-tools-static-2.14.6-r3.apk archive from the existing v3.21/main/x86_64
repository, and pin its SHA-256 before extracting sbin/apk.static.
The x86_64 executable runs on the cross-build host; APK_ARCH continues to
select the target sysroot rather than the bootstrap tool architecture.

Retain curl's HTTP failure detection and five retries, adding a 20-second
connection timeout and 120-second transfer limit per attempt. Preserve
signed fontconfig-dev installation and the explicit Azure Linux CA-bundle
path. Missing artifacts and checksum mismatches stop the build; do not
probe alternate tools or bypass verification. Document updating the exact
package version and archive checksum together. These pins constrain the
bootstrap artifact, not the versions resolved from Alpine's package feeds.

Validation independently verified the embedded executable's Alpine
RSA-SHA256 signature, exercised signed fontconfig-dev installation for
x64, arm, arm64, riscv64 and loongarch64, and rejected both a wrong checksum
and an unavailable package. Public build 1645300 tested head d96d97a
through its PR merge ref and passed the ten Alpine native jobs, covering
those five architectures with and without nodeps. Its x64 image log shows
an actual archive download and successful checksum verification, not a
cached bootstrap layer. The overall run failed in the non-Alpine Linux
x86 job; the Alpine results do not imply a green pipeline.

Co-authored-by: Matthew Leibowitz <[email protected]>
Co-authored-by: Copilot App <[email protected]>
(cherry picked from commit 48e2083)
@github-actions

Copy link
Copy Markdown
Contributor

📦 Try the packages from this PR

Warning

Do not run these scripts without first reviewing the code in this PR.

Step 1 — Download the packages

bash / macOS / Linux:

curl -fsSL https://raw.githubusercontent.com/mono/SkiaSharp/main/scripts/get-skiasharp-pr.sh | bash -s -- 5456

PowerShell / Windows:

iex "& { $(irm https://raw.githubusercontent.com/mono/SkiaSharp/main/scripts/get-skiasharp-pr.ps1) } 5456"

Step 2 — Add the local NuGet source

dotnet nuget add source ~/.skiasharp/hives/pr-5456/packages --name skiasharp-pr-5456
More options
Option Description
--successful-only / -SuccessfulOnly Only use successful builds
--force / -Force Overwrite previously downloaded packages
--list / -List List available artifacts without downloading
--build-id ID / -BuildId ID Download from a specific build

Or download manually from Azure Pipelines — look for the nuget artifact on the build for this PR.

Remove the source when you're done:

dotnet nuget remove source skiasharp-pr-5456

@github-actions

Copy link
Copy Markdown
Contributor

📊 SkiaSharp benchmarks — PR #5456

⭐ this PR (full source build) vs 🌙 nightly · Linux · Windows · macOS

Informational only — this never blocks the PR. 🟢 faster / less allocation · 🔴 slower / more allocation; moves under 5% are hidden as noise.

⏱️ Times are raw BenchmarkDotNet means, and the ⭐ PR and baseline legs run on separate CI runners, so microbenchmarks can swing run-to-run — treat small time deltas as noise. Allocations are deterministic and the reliable signal. The interactive perf-dashboard (linked below) applies smoothing for the trend view.

Highlights

⏱️ Time — 🔴 46 slower · 🟢 25 faster

  • 🔴 MatrixMapPointsBenchmark.MapPoint(Points: 4096) · Windows · 40.79 µs → 76.95 µs (+89%)
  • 🔴 MatrixMapPointsBenchmark.MapPoint(Points: 256) · Windows · 2.54 µs → 4.71 µs (+85%)
  • 🔴 PathBoundsBenchmark.TightBounds(Points: 1024) · Linux · 8.71 µs → 12.00 µs (+38%)
  • 🔴 ColorMathBenchmark.ToColor(Colors: 4096) · Linux · 8.84 µs → 11.69 µs (+32%)
  • 🔴 RasterImageLifecycleBenchmark.CreateDataWithReleaseProc(Count: 256) · Linux · 80.63 µs → 105.00 µs (+30%)
  • …and 66 more (see details below)
Full per-OS benchmark deltas

Linux

⏱️ Time (vs 🌙 nightly 4.156.0-nightly.26526.4)

Benchmark baseline this PR Δ
PathBoundsBenchmark.TightBounds(Points: 1024) 8.71 µs 12.00 µs 🔴 +38%
ColorMathBenchmark.ToColor(Colors: 4096) 8.84 µs 11.69 µs 🔴 +32%
RasterImageLifecycleBenchmark.CreateDataWithReleaseProc(Count: 256) 80.63 µs 105.00 µs 🔴 +30%
MatrixOpsBenchmark.Invert(Count: 4096) 115.60 µs 150.48 µs 🔴 +30%
MatrixMapPointsBenchmark.MapRadius(Points: 4096) 188.99 µs 245.82 µs 🔴 +30%
MatrixMapPointsBenchmark.MapRect(Points: 4096) 157.54 µs 204.52 µs 🔴 +30%
MatrixOpsBenchmark.Concat(Count: 4096) 189.34 µs 245.02 µs 🔴 +29%
SceneRenderBenchmark.RenderFrame(Complexity: 1) 3.20 ms 4.13 ms 🔴 +29%
MatrixMapPointsBenchmark.MapPoint(Points: 4096) 63.60 µs 81.88 µs 🔴 +29%
MatrixMapPointsBenchmark.MapPoint(Points: 256) 4.01 µs 5.14 µs 🔴 +28%
LargeImageScaleBenchmark.UpscaleCrossfade(Size: 2048) 6.33 ms 8.10 ms 🔴 +28%
ColorMathBenchmark.UnPreMultiply(Colors: 4096) 10.05 µs 12.86 µs 🔴 +28%
MatrixMapPointsBenchmark.MapVector(Points: 4096) 146.92 µs 187.80 µs 🔴 +28%
RuntimeEffectShaderBenchmark.DrawFrame 2.37 ms 3.02 ms 🔴 +28%
PathBoundsBenchmark.TightBounds(Points: 64) 785.9 ns 1.00 µs 🔴 +27%
MatrixMapPointsBenchmark.MapRect(Points: 256) 10.13 µs 12.78 µs 🔴 +26%
SceneRenderBenchmark.RenderFrame(Complexity: 4) 15.11 ms 19.04 ms 🔴 +26%
ColorParseBenchmark.Parse(Iterations: 1000) 61.11 µs 76.75 µs 🔴 +26%
ColorMathBenchmark.PreMultiply(Colors: 4096) 11.57 µs 14.52 µs 🔴 +25%
MatrixMapPointsBenchmark.MapRadius(Points: 256) 12.28 µs 15.39 µs 🔴 +25%
BitmapDrawBenchmark.DrawScaledTiles(Tiles: 256) 1.13 ms 1.42 ms 🔴 +25%
CanvasDrawBenchmark.Draw(Shapes: 512) 28.09 ms 35.19 ms 🔴 +25%
CanvasDrawBenchmark.Draw(Shapes: 64) 3.52 ms 4.41 ms 🔴 +25%
MatrixMapPointsBenchmark.MapVector(Points: 256) 9.43 µs 11.76 µs 🔴 +25%
LargeImageScaleBenchmark.UpscaleCrossfade(Size: 1024) 1.66 ms 2.06 ms 🔴 +24%
…and 9 more

Windows

⏱️ Time (vs 🌙 nightly 4.156.0-nightly.26526.4)

Benchmark baseline this PR Δ
MatrixMapPointsBenchmark.MapPoint(Points: 4096) 40.79 µs 76.95 µs 🔴 +89%
MatrixMapPointsBenchmark.MapPoint(Points: 256) 2.54 µs 4.71 µs 🔴 +85%
MatrixMapPointsBenchmark.MapRect(Points: 256) 10.55 µs 7.45 µs 🟢 -29%
MatrixMapPointsBenchmark.MapRect(Points: 4096) 167.61 µs 121.14 µs 🟢 -28%
RasterImageLifecycleBenchmark.CreateDataWithReleaseProc(Count: 256) 96.64 µs 121.17 µs 🔴 +25%
MatrixMapPointsBenchmark.MapPoints(Points: 4096) 2.69 µs 2.06 µs 🟢 -23%
MatrixMapPointsBenchmark.MapRadius(Points: 4096) 136.34 µs 158.65 µs 🔴 +16%
SceneRenderBenchmark.RenderFrame(Complexity: 1) 2.29 ms 1.93 ms 🟢 -16%
RasterImageLifecycleBenchmark.CreateRasterImage(Count: 256) 251.84 µs 284.40 µs 🔴 +13%
SceneRenderBenchmark.RenderFrame(Complexity: 4) 10.50 ms 9.24 ms 🟢 -12%
MatrixOpsBenchmark.Concat(Count: 4096) 218.62 µs 242.78 µs 🔴 +11%
PathBoundsBenchmark.TightBounds(Points: 64) 1.57 µs 1.71 µs 🔴 +9%
MatrixOpsBenchmark.Invert(Count: 4096) 127.75 µs 137.78 µs 🔴 +8%
ColorMathBenchmark.ToColorF(Colors: 4096) 13.29 µs 12.41 µs 🟢 -7%
ColorMathBenchmark.ToColor(Colors: 4096) 15.57 µs 14.59 µs 🟢 -6%
MatrixMapPointsBenchmark.MapVector(Points: 256) 8.21 µs 7.73 µs 🟢 -6%
LargeImageScaleBenchmark.UpscaleCrossfade(Size: 1024) 2.62 ms 2.49 ms 🟢 -5%

macOS

⏱️ Time (vs 🌙 nightly 4.156.0-nightly.26526.4)

Benchmark baseline this PR Δ
LargeImageScaleBenchmark.UpscaleOpaque(Size: 1024) 846.22 µs 595.15 µs 🟢 -30%
BitmapDrawBenchmark.DrawUnscaledTiles(Tiles: 256) 893.38 µs 677.57 µs 🟢 -24%
ColorMathBenchmark.ToColor(Colors: 4096) 24.24 µs 18.43 µs 🟢 -24%
CanvasDrawBenchmark.Draw(Shapes: 64) 2.03 ms 1.59 ms 🟢 -22%
BitmapDrawBenchmark.DrawUnscaledTiles(Tiles: 64) 207.39 µs 250.01 µs 🔴 +21%
MatrixOpsBenchmark.Invert(Count: 4096) 78.12 µs 62.43 µs 🟢 -20%
PathBoundsBenchmark.TightBounds(Points: 64) 1.20 µs 968.3 ns 🟢 -19%
LargeImageScaleBenchmark.UpscaleCrossfade(Size: 2048) 6.74 ms 5.44 ms 🟢 -19%
LargeImageScaleBenchmark.UpscaleOpaque(Size: 2048) 3.16 ms 2.55 ms 🟢 -19%
BitmapDrawBenchmark.DrawScaledTiles(Tiles: 256) 1.04 ms 875.26 µs 🟢 -16%
LargeImageScaleBenchmark.UpscaleCrossfade(Size: 1024) 1.66 ms 1.46 ms 🟢 -12%
CanvasDrawBenchmark.Draw(Shapes: 512) 14.32 ms 12.68 ms 🟢 -11%
MatrixMapPointsBenchmark.MapPoints(Points: 256) 178.5 ns 161.2 ns 🟢 -10%
MatrixMapPointsBenchmark.MapPoints(Points: 4096) 1.74 µs 1.90 µs 🔴 +9%
ColorMathBenchmark.PreMultiply(Colors: 4096) 9.87 µs 8.99 µs 🟢 -9%
ColorParseBenchmark.Parse(Iterations: 1000) 81.00 µs 74.13 µs 🟢 -8%
MatrixMapPointsBenchmark.MapRect(Points: 256) 3.64 µs 3.34 µs 🟢 -8%
PathBoundsBenchmark.TightBounds(Points: 1024) 10.42 µs 9.57 µs 🟢 -8%
RuntimeEffectShaderBenchmark.DrawFrame 602.56 µs 649.90 µs 🔴 +8%
MatrixMapPointsBenchmark.MapRadius(Points: 256) 6.82 µs 7.28 µs 🔴 +7%

📈 Full interactive perf-dashboard & run details →

@mattleibow
mattleibow merged commit afe3ea0 into release/4.152.x Oct 28, 2026
112 checks passed
@mattleibow
mattleibow deleted the mattleibow-alpine-bootstrap-4-152-backport branch October 28, 2026 01:50
@github-actions github-actions Bot added this to the 4.152.5 milestone Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant