Skip to content

[release/4.153.x] Backport pinned Alpine CDN bootstrap (#5414) - #5461

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

mattleibow merged 1 commit into
release/4.153.xfrom
mattleibow-alpine-bootstrap-4-153-backport

Conversation

@mattleibow

@mattleibow mattleibow commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Description

Backport #5414 to release/4.153.x via a clean git cherry-pick -x 48e2083869ab2b154b2058c32682391d1c77e403.

The same GitLab bootstrap endpoint that failed on main remains on this servicing branch. Internal build 3118571 on the separate release/4.150.6 line failed all ten Alpine Docker jobs with curl 28 connection timeouts to gitlab.alpinelinux.org:443; missing-output artifact failures were secondary.

Use the official Alpine CDN's exact apk-tools-static-2.14.6-r3.apk, verify its pinned SHA-256 before extraction, and bound curl connection/transfer times. Keep signed sysroot installs and all target architecture mappings unchanged.

Exact scope: scripts/infra/native/linux/docker/alpine/Dockerfile and its bootstrap guidance in documentation/dev/building-linux.md only (27 insertions, 8 deletions). No submodule, milestone, native source, pipeline, or new test infrastructure changes.

Related issues

Backport of #5414; related to #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 — build bootstrap only; no public API or application behavior changes.

Testing

On macOS:

  • git diff --check origin/release/4.153.x...HEAD — passed.
  • python3 /Users/matthew/.copilot/session-state/b72014c8-beae-4de0-8d11-8c3724b15fb6/files/validate-alpine-bootstrap.py — passed. Session-only validator (not added to the repository) checked all four Dockerfile RUN instructions with bash -n; downloaded the exact pinned CDN archive using the Dockerfile's curl flags; confirmed SHA-256 f0e0d34d6a8f1f9d8704bae6612b4627b96f13cd20db759e9b43085135cd234f with both hashlib and shasum -a 256 -c -; confirmed a wrong checksum fails; extracted sbin/apk.static with tar -xzf and confirmed an ELF64 x86_64 executable. Also checked verification precedes extraction and signed package installation is retained.
  • docker info --format '{{.OSType}}/{{.Architecture}}' — failed: Docker daemon unavailable at the configured Colima socket. Container execution, signed sysroot installation, full native builds, and managed tests were not run in this backport session. This narrow Docker/bootstrap-only backport requires the servicing branch's Alpine CI jobs for end-to-end coverage; 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 -- 5461

PowerShell / Windows:

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

Step 2 — Add the local NuGet source

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

@github-actions

Copy link
Copy Markdown
Contributor

📊 SkiaSharp benchmarks — PR #5461

⭐ 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 — 🔴 39 slower · 🟢 15 faster

  • 🔴 MatrixMapPointsBenchmark.MapPoint(Points: 4096) · Windows · 18.32 µs → 78.69 µs (+330%)
  • 🔴 MatrixMapPointsBenchmark.MapPoint(Points: 256) · Windows · 1.18 µs → 4.93 µs (+319%)
  • 🔴 ColorMathBenchmark.ToColor(Colors: 4096) · Windows · 5.92 µs → 15.74 µs (+166%)
  • 🔴 PathBoundsBenchmark.TightBounds(Points: 1024) · Windows · 9.29 µs → 20.36 µs (+119%)
  • 🔴 PathBoundsBenchmark.TightBounds(Points: 64) · Windows · 922.8 ns → 1.88 µs (+104%)
  • …and 49 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) 48.68 µs 14.30 µs 🟢 -71%
PathBoundsBenchmark.TightBounds(Points: 1024) 10.96 µs 13.60 µs 🔴 +24%
MatrixMapPointsBenchmark.MapPoints(Points: 4096) 2.61 µs 2.90 µs 🔴 +11%
RasterImageLifecycleBenchmark.CreateRasterImage(Count: 256) 260.73 µs 280.60 µs 🔴 +8%
MatrixMapPointsBenchmark.MapPoints(Points: 256) 219.5 ns 233.7 ns 🔴 +6%
RasterImageLifecycleBenchmark.CreateDataWithReleaseProc(Count: 256) 102.36 µs 107.96 µs 🔴 +5%

Windows

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

Benchmark baseline this PR Δ
MatrixMapPointsBenchmark.MapPoint(Points: 4096) 18.32 µs 78.69 µs 🔴 +330%
MatrixMapPointsBenchmark.MapPoint(Points: 256) 1.18 µs 4.93 µs 🔴 +319%
ColorMathBenchmark.ToColor(Colors: 4096) 5.92 µs 15.74 µs 🔴 +166%
PathBoundsBenchmark.TightBounds(Points: 1024) 9.29 µs 20.36 µs 🔴 +119%
PathBoundsBenchmark.TightBounds(Points: 64) 922.8 ns 1.88 µs 🔴 +104%
CanvasDrawBenchmark.Draw(Shapes: 512) 11.53 ms 23.04 ms 🔴 +100%
ColorMathBenchmark.PreMultiply(Colors: 4096) 7.35 µs 14.21 µs 🔴 +94%
CanvasDrawBenchmark.Draw(Shapes: 64) 1.48 ms 2.86 ms 🔴 +93%
ColorParseBenchmark.Parse(Iterations: 1000) 42.99 µs 83.07 µs 🔴 +93%
RasterImageLifecycleBenchmark.CreateDataWithReleaseProc(Count: 256) 66.88 µs 128.83 µs 🔴 +93%
RasterImageLifecycleBenchmark.CreateRasterImage(Count: 256) 160.53 µs 296.83 µs 🔴 +85%
BitmapDrawBenchmark.DrawScaledTiles(Tiles: 64) 186.77 µs 343.16 µs 🔴 +84%
RuntimeEffectShaderBenchmark.DrawFrame 623.58 µs 1.14 ms 🔴 +82%
BitmapDrawBenchmark.DrawScaledTiles(Tiles: 256) 701.70 µs 1.27 ms 🔴 +81%
ColorMathBenchmark.UnPreMultiply(Colors: 4096) 6.85 µs 12.25 µs 🔴 +79%
BitmapDrawBenchmark.DrawUnscaledTiles(Tiles: 256) 528.16 µs 935.96 µs 🔴 +77%
MatrixMapPointsBenchmark.MapRadius(Points: 4096) 94.48 µs 167.24 µs 🔴 +77%
BitmapDrawBenchmark.DrawUnscaledTiles(Tiles: 64) 143.07 µs 247.90 µs 🔴 +73%
MatrixMapPointsBenchmark.MapRadius(Points: 256) 6.10 µs 10.42 µs 🔴 +71%
MatrixOpsBenchmark.Concat(Count: 4096) 146.96 µs 246.29 µs 🔴 +68%
ColorMathBenchmark.ToColorF(Colors: 4096) 7.98 µs 13.33 µs 🔴 +67%
MatrixMapPointsBenchmark.MapVector(Points: 4096) 85.21 µs 139.31 µs 🔴 +63%
MatrixMapPointsBenchmark.MapVector(Points: 256) 5.41 µs 8.70 µs 🔴 +61%
MatrixMapPointsBenchmark.MapPoints(Points: 256) 118.7 ns 189.0 ns 🔴 +59%
SceneRenderBenchmark.RenderFrame(Complexity: 1) 1.36 ms 2.16 ms 🔴 +59%
…and 7 more

macOS

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

Benchmark baseline this PR Δ
LargeImageScaleBenchmark.UpscaleOpaque(Size: 2048) 3.13 ms 1.98 ms 🟢 -37%
LargeImageScaleBenchmark.UpscaleOpaque(Size: 1024) 691.69 µs 508.36 µs 🟢 -27%
LargeImageScaleBenchmark.UpscaleCrossfade(Size: 2048) 6.62 ms 5.01 ms 🟢 -24%
MatrixOpsBenchmark.Invert(Count: 4096) 68.61 µs 54.40 µs 🟢 -21%
ColorMathBenchmark.ToColor(Colors: 4096) 20.38 µs 16.43 µs 🟢 -19%
LargeImageScaleBenchmark.UpscaleCrossfade(Size: 1024) 1.49 ms 1.25 ms 🟢 -16%
CanvasDrawBenchmark.Draw(Shapes: 512) 11.99 ms 10.72 ms 🟢 -11%
ColorParseBenchmark.Parse(Iterations: 1000) 69.13 µs 62.29 µs 🟢 -10%
MatrixMapPointsBenchmark.MapVector(Points: 4096) 43.23 µs 39.53 µs 🟢 -9%
ColorMathBenchmark.ToColorF(Colors: 4096) 5.11 µs 5.52 µs 🔴 +8%
BitmapDrawBenchmark.DrawScaledTiles(Tiles: 256) 770.86 µs 717.40 µs 🟢 -7%
MatrixMapPointsBenchmark.MapRadius(Points: 4096) 104.19 µs 97.58 µs 🟢 -6%
MatrixMapPointsBenchmark.MapRect(Points: 4096) 50.40 µs 47.37 µs 🟢 -6%
BitmapDrawBenchmark.DrawUnscaledTiles(Tiles: 256) 613.25 µs 580.74 µs 🟢 -5%
SceneRenderBenchmark.RenderFrame(Complexity: 1) 1.20 ms 1.14 ms 🟢 -5%
MatrixMapPointsBenchmark.MapPoints(Points: 256) 138.4 ns 145.5 ns 🔴 +5%

📈 Full interactive perf-dashboard & run details →

@mattleibow
mattleibow merged commit 24a5963 into release/4.153.x Oct 28, 2026
112 checks passed
@mattleibow
mattleibow deleted the mattleibow-alpine-bootstrap-4-153-backport branch October 28, 2026 01:49
@github-actions github-actions Bot added this to the 4.153.3 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