Skip to content

[4.155.x] Backport pinned Alpine CDN bootstrap fix - #5458

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

mattleibow merged 1 commit into
release/4.155.xfrom
mattleibow-alpine-bootstrap-4-155-backport

Conversation

@mattleibow

Copy link
Copy Markdown
Contributor

Description

Backport #5414 to release/4.155.x with an unmodified git cherry-pick -x 48e2083869ab2b154b2058c32682391d1c77e403.

The same GitLab apk.static bootstrap endpoint caused all ten Alpine Docker jobs in internal build 3118571 to time out before native compilation. That observed run was for release/4.150.6; release/4.155.x retains the affected Dockerfile as well.

Use the official Alpine CDN's pinned apk-tools-static-2.14.6-r3.apk, verify its SHA-256 before extracting sbin/apk.static, and bound curl connection/transfer times. Signed target-sysroot installs remain unchanged. Includes only the Dockerfile and its bootstrap documentation: 27 insertions, 8 deletions across two files. No submodule, milestone, dependency-feed, pipeline, or public API changes.

Related issues

Backport of #5414; context: #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 - bootstrap-only change; no public API or application behavior changes.

Testing

Local macOS host validation:

  • git diff --check origin/release/4.155.x...HEAD - passed.
  • git diff origin/release/4.155.x...HEAD | git patch-id --stable and git show 48e2083869ab2b154b2058c32682391d1c77e403 --format= | git patch-id --stable - passed; identical patch ID 5954abdb8182c7fe0330da82e0488dc2a13dbbe4.
  • Ran the following bootstrap checks with APK_STATIC_VERSION, APK_STATIC_SHA256, and ALPINE_VERSION read directly from the Dockerfile and APK_DIR set to a temporary directory:
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/v${ALPINE_VERSION}/main/x86_64/apk-tools-static-${APK_STATIC_VERSION}.apk"
printf '%s  %s\n' "$APK_STATIC_SHA256" "$APK_DIR/apk-tools-static.apk" | shasum -a 256 -c -
tar -xzf "$APK_DIR/apk-tools-static.apk" -C "$APK_DIR" sbin/apk.static
chmod +x "$APK_DIR/sbin/apk.static"
test -x "$APK_DIR/sbin/apk.static"
file "$APK_DIR/sbin/apk.static"

Passed: CDN download succeeded, the pinned SHA-256 matched, extraction succeeded, and file identified a statically linked x86-64 ELF executable. Used macOS shasum -a 256 for the host-only check; the Dockerfile's Linux sha256sum remains unchanged.

printf '%064d %s\n' 0 "$APK_DIR/apk-tools-static.apk" | shasum -a 256 -c - - correctly failed; the negative check confirmed a wrong checksum is rejected.

docker --version succeeded, but docker info --format '{{.OSType}}/{{.Architecture}}' failed because the configured Docker daemon was unavailable. Docker image builds, Linux execution of apk.static, signed sysroot installs, full native builds, and managed tests were not run locally. The original #5414 records ten successful Alpine native jobs in public build 1645300; that is upstream evidence, not a validation run of this servicing branch.

No new test infrastructure or managed regression test: this is an exact bootstrap-only backport, exercised by the existing Alpine image/native CI jobs.

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? Added or updated accurate source /// documentation and regenerated bindings when applicable
  • 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 -- 5458

PowerShell / Windows:

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

Step 2 — Add the local NuGet source

dotnet nuget add source ~/.skiasharp/hives/pr-5458/packages --name skiasharp-pr-5458
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-5458

@github-actions

Copy link
Copy Markdown
Contributor

📊 SkiaSharp benchmarks — PR #5458

⭐ 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 — 🔴 62 slower · 🟢 16 faster

  • 🔴 ColorMathBenchmark.ToColor(Colors: 4096) · Linux · 5.32 µs → 15.87 µs (+198%)
  • 🔴 MatrixMapPointsBenchmark.MapPoint(Points: 4096) · Windows · 18.58 µs → 53.78 µs (+190%)
  • 🔴 MatrixMapPointsBenchmark.MapPoint(Points: 256) · Windows · 1.20 µs → 3.27 µs (+173%)
  • 🔴 ColorMathBenchmark.PreMultiply(Colors: 4096) · Linux · 7.73 µs → 14.49 µs (+87%)
  • 🔴 ColorMathBenchmark.UnPreMultiply(Colors: 4096) · Linux · 7.22 µs → 12.85 µs (+78%)
  • …and 73 more (see details below)
Full per-OS benchmark deltas

Linux

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

Benchmark baseline this PR Δ
ColorMathBenchmark.ToColor(Colors: 4096) 5.32 µs 15.87 µs 🔴 +198%
ColorMathBenchmark.PreMultiply(Colors: 4096) 7.73 µs 14.49 µs 🔴 +87%
ColorMathBenchmark.UnPreMultiply(Colors: 4096) 7.22 µs 12.85 µs 🔴 +78%
MatrixMapPointsBenchmark.MapPoints(Points: 4096) 1.50 µs 2.63 µs 🔴 +75%
ColorParseBenchmark.Parse(Iterations: 1000) 43.84 µs 76.50 µs 🔴 +74%
MatrixMapPointsBenchmark.MapPoint(Points: 256) 2.97 µs 5.11 µs 🔴 +72%
PathBoundsBenchmark.TightBounds(Points: 1024) 6.65 µs 11.42 µs 🔴 +72%
MatrixOpsBenchmark.Concat(Count: 4096) 148.09 µs 253.99 µs 🔴 +72%
ColorMathBenchmark.ToColorF(Colors: 4096) 8.39 µs 14.03 µs 🔴 +67%
MatrixMapPointsBenchmark.MapPoints(Points: 256) 133.7 ns 222.5 ns 🔴 +66%
RasterImageLifecycleBenchmark.CreateRasterImage(Count: 256) 158.65 µs 259.86 µs 🔴 +64%
PathBoundsBenchmark.TightBounds(Points: 64) 627.6 ns 1.03 µs 🔴 +64%
MatrixMapPointsBenchmark.MapPoint(Points: 4096) 50.25 µs 81.97 µs 🔴 +63%
BitmapDrawBenchmark.DrawUnscaledTiles(Tiles: 64) 165.71 µs 265.59 µs 🔴 +60%
MatrixOpsBenchmark.Invert(Count: 4096) 94.72 µs 150.30 µs 🔴 +59%
RasterImageLifecycleBenchmark.CreateDataWithReleaseProc(Count: 256) 65.96 µs 104.56 µs 🔴 +59%
LargeImageScaleBenchmark.UpscaleCrossfade(Size: 2048) 5.10 ms 8.08 ms 🔴 +58%
BitmapDrawBenchmark.DrawScaledTiles(Tiles: 256) 911.05 µs 1.43 ms 🔴 +57%
LargeImageScaleBenchmark.UpscaleOpaque(Size: 2048) 1.83 ms 2.87 ms 🔴 +57%
LargeImageScaleBenchmark.UpscaleCrossfade(Size: 1024) 1.34 ms 2.07 ms 🔴 +55%
LargeImageScaleBenchmark.UpscaleOpaque(Size: 1024) 477.87 µs 737.24 µs 🔴 +54%
BitmapDrawBenchmark.DrawScaledTiles(Tiles: 64) 244.22 µs 375.83 µs 🔴 +54%
MatrixMapPointsBenchmark.MapRadius(Points: 256) 9.99 µs 15.25 µs 🔴 +53%
MatrixMapPointsBenchmark.MapVector(Points: 4096) 123.71 µs 187.63 µs 🔴 +52%
MatrixMapPointsBenchmark.MapVector(Points: 256) 7.76 µs 11.75 µs 🔴 +51%
…and 8 more

Windows

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

Benchmark baseline this PR Δ
MatrixMapPointsBenchmark.MapPoint(Points: 4096) 18.58 µs 53.78 µs 🔴 +190%
MatrixMapPointsBenchmark.MapPoint(Points: 256) 1.20 µs 3.27 µs 🔴 +173%
MatrixMapPointsBenchmark.MapRect(Points: 4096) 134.78 µs 93.76 µs 🟢 -30%
MatrixMapPointsBenchmark.MapRect(Points: 256) 8.25 µs 5.84 µs 🟢 -29%
ColorMathBenchmark.ToColor(Colors: 4096) 6.24 µs 7.98 µs 🔴 +28%
RasterImageLifecycleBenchmark.CreateDataWithReleaseProc(Count: 256) 72.94 µs 91.48 µs 🔴 +25%
MatrixMapPointsBenchmark.MapRadius(Points: 256) 6.12 µs 7.22 µs 🔴 +18%
MatrixMapPointsBenchmark.MapRadius(Points: 4096) 99.23 µs 114.34 µs 🔴 +15%
MatrixOpsBenchmark.Concat(Count: 4096) 154.59 µs 171.56 µs 🔴 +11%
MatrixMapPointsBenchmark.MapPoints(Points: 256) 120.7 ns 133.0 ns 🔴 +10%
RasterImageLifecycleBenchmark.CreateRasterImage(Count: 256) 180.12 µs 198.28 µs 🔴 +10%
PathBoundsBenchmark.TightBounds(Points: 1024) 9.98 µs 10.90 µs 🔴 +9%
CanvasDrawBenchmark.Draw(Shapes: 64) 1.52 ms 1.65 ms 🔴 +9%
MatrixMapPointsBenchmark.MapPoints(Points: 4096) 1.51 µs 1.62 µs 🔴 +8%
PathBoundsBenchmark.TightBounds(Points: 64) 988.6 ns 1.06 µs 🔴 +7%
BitmapDrawBenchmark.DrawScaledTiles(Tiles: 256) 720.93 µs 773.24 µs 🔴 +7%
BitmapDrawBenchmark.DrawScaledTiles(Tiles: 64) 183.36 µs 195.34 µs 🔴 +7%
MatrixMapPointsBenchmark.MapVector(Points: 256) 5.50 µs 5.83 µs 🔴 +6%
ColorParseBenchmark.Parse(Iterations: 1000) 45.64 µs 48.02 µs 🔴 +5%

macOS

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

Benchmark baseline this PR Δ
LargeImageScaleBenchmark.UpscaleOpaque(Size: 1024) 801.21 µs 523.74 µs 🟢 -35%
MatrixMapPointsBenchmark.MapPoints(Points: 256) 154.9 ns 191.7 ns 🔴 +24%
LargeImageScaleBenchmark.UpscaleOpaque(Size: 2048) 2.90 ms 2.24 ms 🟢 -23%
BitmapDrawBenchmark.DrawUnscaledTiles(Tiles: 64) 205.69 µs 252.56 µs 🔴 +23%
LargeImageScaleBenchmark.UpscaleCrossfade(Size: 1024) 1.63 ms 1.29 ms 🟢 -21%
MatrixOpsBenchmark.Invert(Count: 4096) 81.40 µs 68.05 µs 🟢 -16%
PathBoundsBenchmark.TightBounds(Points: 64) 1.10 µs 948.2 ns 🟢 -14%
MatrixMapPointsBenchmark.MapRadius(Points: 4096) 114.15 µs 129.36 µs 🔴 +13%
ColorParseBenchmark.Parse(Iterations: 1000) 72.40 µs 62.84 µs 🟢 -13%
BitmapDrawBenchmark.DrawScaledTiles(Tiles: 256) 1.00 ms 869.91 µs 🟢 -13%
CanvasDrawBenchmark.Draw(Shapes: 64) 1.93 ms 1.68 ms 🟢 -13%
ColorMathBenchmark.PreMultiply(Colors: 4096) 10.47 µs 9.21 µs 🟢 -12%
MatrixOpsBenchmark.Concat(Count: 4096) 131.57 µs 147.35 µs 🔴 +12%
ColorMathBenchmark.ToColor(Colors: 4096) 22.07 µs 19.48 µs 🟢 -12%
ColorMathBenchmark.ToColorF(Colors: 4096) 5.44 µs 6.08 µs 🔴 +12%
MatrixMapPointsBenchmark.MapVector(Points: 4096) 50.43 µs 45.14 µs 🟢 -10%
LargeImageScaleBenchmark.UpscaleCrossfade(Size: 2048) 6.94 ms 6.23 ms 🟢 -10%
ColorMathBenchmark.UnPreMultiply(Colors: 4096) 9.41 µs 8.55 µs 🟢 -9%
MatrixMapPointsBenchmark.MapRect(Points: 4096) 58.99 µs 54.19 µs 🟢 -8%
BitmapDrawBenchmark.DrawScaledTiles(Tiles: 64) 267.86 µs 288.79 µs 🔴 +8%
MatrixMapPointsBenchmark.MapPoints(Points: 4096) 1.99 µs 2.15 µs 🔴 +8%
CanvasDrawBenchmark.Draw(Shapes: 512) 12.45 ms 13.37 ms 🔴 +7%
MatrixMapPointsBenchmark.MapRadius(Points: 256) 7.25 µs 7.77 µs 🔴 +7%
SceneRenderBenchmark.RenderFrame(Complexity: 1) 1.31 ms 1.40 ms 🔴 +7%
MatrixMapPointsBenchmark.MapVector(Points: 256) 2.77 µs 2.94 µs 🔴 +6%
…and 1 more

📈 Full interactive perf-dashboard & run details →

@mattleibow
mattleibow merged commit b71a1eb into release/4.155.x Oct 28, 2026
112 checks passed
@mattleibow
mattleibow deleted the mattleibow-alpine-bootstrap-4-155-backport branch October 28, 2026 01:50
@github-actions github-actions Bot added this to the 4.155.0 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