Skip to content

[4.150.6] Backport pinned Alpine CDN bootstrap fix - #5465

Merged
mattleibow merged 1 commit into
release/4.150.6from
mattleibow-backport-alpine-bootstrap-4-150-6
Oct 28, 2026
Merged

mattleibow merged 1 commit into
release/4.150.6from
mattleibow-backport-alpine-bootstrap-4-150-6

Conversation

@mattleibow

Copy link
Copy Markdown
Contributor

Description of Change

Backport #5414 directly to the prepared release/4.150.6 branch with git cherry-pick -x 48e2083869ab2b154b2058c32682391d1c77e403. The patch applies cleanly and has the exact same stable patch ID as the source fix (5954abdb8182c7fe0330da82e0488dc2a13dbbe4).

The prepared branch remains at fe57c0da488011c376ccca3b2c767ef652163f9a; its internal package build 3118571 failed when all ten Alpine jobs timed out downloading apk.static from GitLab, followed by secondary missing-output artifact errors. #5457 already backported this fix to release/4.150.x, but merging that PR did not update this prepared branch.

Use the official Alpine CDN's pinned apk-tools-static-2.14.6-r3.apk, verify its SHA-256 before extraction, and bound connection and transfer timeouts. Preserve signed sysroot installs and all release SDK/version settings. Exactly two files change: scripts/infra/native/linux/docker/alpine/Dockerfile (+11/-7) and documentation/dev/building-linux.md (+16/-1), totaling +27/-8. No maintenance-branch merge, release-version change, submodule change, or native-source change.

Areas affected

Build/CI and developer documentation only.

Validation

  • git diff --check origin/release/4.150.6...HEAD — passed.
  • git show 48e2083869ab2b154b2058c32682391d1c77e403 --pretty=format: | git patch-id --stable and git diff origin/release/4.150.6...HEAD | git patch-id --stable — passed; identical patch IDs.
  • python3 <session-artifacts>/validate-alpine-backport.py — passed. Session-local harness, not new repository test infrastructure: runs bash -n -c on every joined Dockerfile RUN instruction; downloads the exact pinned CDN archive with the Dockerfile's curl retries/timeouts; verifies SHA-256 f0e0d34d6a8f1f9d8704bae6612b4627b96f13cd20db759e9b43085135cd234f; extracts sbin/apk.static and verifies ELF format; confirms a nonexistent package fails with HTTP 404. In a disposable docker run --rm --platform linux/amd64 alpine:3.21 container, the extracted host executable runs successfully, sha256sum -c - rejects a deliberately wrong checksum, and signed fontconfig-dev installs pass for x86_64, armv7, aarch64, riscv64 and loongarch64. These are fresh test sysroots (--initdb) using Alpine's bundled cross-architecture public keys plus the two explicit Dockerfile keys, not the production Azure Linux cross images.
  • docker build --check --platform linux/amd64 --build-arg BUILD_ARCH=x64 scripts/infra/native/linux/docker/alpine — exited 1 with five InvalidBaseImagePlatform warnings on this ARM64 Docker host. git show origin/release/4.150.6:scripts/infra/native/linux/docker/alpine/Dockerfile | docker build --check --platform linux/amd64 --build-arg BUILD_ARCH=x64 -f - scripts/infra/native/linux/docker/alpine — reproduced the same five warnings on the unchanged release baseline. No unrelated platform changes included.
  • Full Azure Linux Docker image/native builds and managed/runtime suites were not run for this build-bootstrap-only backport. The container checks above are not claimed as full native compilation. Prior evidence: public build 1651433 for maintenance-backport commit b3048d8fd4a120ac859bfb30c6dc6436bb10525b passed all ten Alpine native jobs; this was verified through GitHub check results and is not presented as a fresh build of this PR.

No permanent script tests added: real archive/checksum/failure-path and container execution checks cover this exact backport. No rendering changes; screenshots are not applicable.

Bugs Fixed

API Changes

None.

Behavioral Changes

None beyond the bootstrap bug fix; no application-visible changes.

Changes

None — no public API or application behavior changes.

Required skia PR

None.

PR Checklist

  • Has tests (if omitted, state reason in description)
  • Rebased on top of main at time of PR
  • Merged related skia PRs
  • Changes adhere to coding standard
  • Updated documentation

This servicing backport is intentionally based on release/4.150.6, not main. No related skia PR is required.

[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 -- 5465

PowerShell / Windows:

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

Step 2 — Add the local NuGet source

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

@mattleibow

Copy link
Copy Markdown
Contributor Author

@dalexsoto review

@dalexsoto dalexsoto left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed all 2 changed bootstrap and developer-documentation files, including download and failure handling, checksum-before-extraction, host/target routing and downstream native artifact/package consumers, with a separate final blocker search. The prepared-release backport preserves fail-closed checksum-before-extraction, signed sysroot installation and architecture routing. The narrow servicing backport to release/4.150.6 is intentional; no main-branch merge, unrelated baseline repair or local product execution is required. No independent high-confidence blocker remains in this bounded static review; no executed runtime or whole-pipeline certification is claimed.

@mattleibow
mattleibow merged commit bf5053d into release/4.150.6 Oct 28, 2026
86 checks passed
@mattleibow
mattleibow deleted the mattleibow-backport-alpine-bootstrap-4-150-6 branch October 28, 2026 15:30
@github-project-automation github-project-automation Bot moved this from Approved to Done in SkiaSharp Backlog Oct 28, 2026
@github-actions github-actions Bot added this to the 4.150.6 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.

2 participants