Repository navigation
[release/4.154.x] Backport Alpine CDN bootstrap fix - #5459
Conversation
[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)
📦 Try the packages from this PRWarning 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 -- 5459PowerShell / Windows: iex "& { $(irm https://raw.githubusercontent.com/mono/SkiaSharp/main/scripts/get-skiasharp-pr.ps1) } 5459"Step 2 — Add the local NuGet source dotnet nuget add source ~/.skiasharp/hives/pr-5459/packages --name skiasharp-pr-5459More options
Or download manually from Azure Pipelines — look for the Remove the source when you're done: dotnet nuget remove source skiasharp-pr-5459 |
📊 SkiaSharp benchmarks — PR #5459⭐ this PR (full source build) vs 🌙 nightly · Linux · Windows · macOS
Highlights⏱️ Time — 🔴 66 slower · 🟢 20 faster
Full per-OS benchmark deltasLinux⏱️ Time (vs 🌙 nightly
Windows⏱️ Time (vs 🌙 nightly
macOS⏱️ Time (vs 🌙 nightly
|
Description
Clean
git cherry-pick -xof 48e2083 (#5414) ontorelease/4.154.x, with no adaptation. The same obsolete GitLab bootstrap endpoint remains on this servicing branch. All ten Alpine Docker jobs in the reported 4.150.6 package build 3118571 timed out connecting to that endpoint before compilation; subsequent missing-output publication errors were secondary.Use the official Alpine CDN's exact
apk-tools-static-2.14.6-r3.apk, verify SHA-256 before extractingsbin/apk.static, and bound curl connection/transfer timeouts. Preserve signed target-sysroot installs and the existing CA path. Include only the original directly related bootstrap documentation.Scope:
scripts/infra/native/linux/docker/alpine/Dockerfileanddocumentation/dev/building-linux.md; 27 insertions, 8 deletions. No native source, submodule, dependency-feed, milestone, pipeline redesign, or test-infrastructure changes.Related issues
Related to #5414 (main fix).
Required skia PR
None.
Areas affected
binding/)externals/skia/src/c,include/c)Changes
None — bootstrap/build-only; no public API or application behavior changes.
Testing
Local validation on macOS:
git diff --check origin/release/4.154.x...HEAD— passed.git diff 48e2083869ab2b154b2058c32682391d1c77e403 HEAD -- scripts/infra/native/linux/docker/alpine/Dockerfile documentation/dev/building-linux.md— passed, empty output; both files exactly match the main fix.python3 -(inline bootstrap validation harness) — passed: joins Dockerfile continuation lines and runsbash -n -con all four RUN instructions; reads pins from the Dockerfile; downloads the pinned archive with the Dockerfile's curl flags; verifies viasha256sum -c -; extracts viatar -xzf ... -C ... sbin/apk.static; confirms the extracted file is a statically linked x86-64 ELF; rejects an all-zero checksum and a nonexistent package (HTTP 404, nonzero curl status); asserts verification precedes extraction/execution and no unsigned-install option was introduced. Temporary files were removed. The harness initially had a continuation-parsing error and assumed curl's HTTP-error exit code was always 22; these harness assumptions were corrected before the successful run (local curl returns 56 for HTTP 404).docker info --format '{{.OSType}}/{{.Architecture}}'— failed: Docker daemon unavailable at the configured Colima socket. No Alpine Docker image build, Linux execution of apk.static, signed sysroot-install execution, or full native build was run locally. Those remain CI validation.No new tests were added: this is an exact two-file servicing backport of the already-reviewed bootstrap fix, with direct download/failure-path checks rather than new test infrastructure. The managed test solution was not run because no managed/native-library code changed and it does not exercise Docker bootstrap. No native downloads or source builds were invoked.
Checklist
Changesabove lists all public API and behavioral changes (or "None.")///documentation and regenerated bindings when applicablemono/skiaPR linked above and bindings regenerated