Repository navigation
[release/4.151.x] Use pinned Alpine CDN package for native bootstrap - #5460
Merged
mattleibow merged 1 commit intoOct 28, 2026
Merged
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)
Contributor
📦 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 -- 5460PowerShell / Windows: iex "& { $(irm https://raw.githubusercontent.com/mono/SkiaSharp/main/scripts/get-skiasharp-pr.ps1) } 5460"Step 2 — Add the local NuGet source dotnet nuget add source ~/.skiasharp/hives/pr-5460/packages --name skiasharp-pr-5460More options
Or download manually from Azure Pipelines — look for the Remove the source when you're done: dotnet nuget remove source skiasharp-pr-5460 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Change
Clean backport of #5414 using
git cherry-pick -x 48e2083869ab2b154b2058c32682391d1c77e403. Identical patch ID to main's fix; only two files change (+27/-8):scripts/infra/native/linux/docker/alpine/Dockerfiledocumentation/dev/building-linux.mdUse the official Alpine CDN's pinned
apk-tools-static-2.14.6-r3.apkinstead of the unavailable GitLab endpoint, verify SHA-256 before extractingsbin/apk.static, and bound curl timeouts. Preserve signed target-sysroot installs. No native source, submodule, milestone, pipeline, or API changes. Targets the servicing line, not main or an existing cut release branch.Validation:
git diff origin/release/4.151.x...HEAD --check— passed.curl -fSL --retry 5 --retry-delay 10 --retry-all-errors --connect-timeout 20 --max-time 120 https://dl-cdn.alpinelinux.org/alpine/v3.21/main/x86_64/apk-tools-static-2.14.6-r3.apk— passed; Python SHA-256 of the downloaded archive matchedf0e0d34d6a8f1f9d8704bae6612b4627b96f13cd20db759e9b43085135cd234f.sbin/apk.staticextracts as executable x86_64 ELF; deliberately corrupted archive fails the pinned hash comparison; static assertions confirm checksum-before-extraction/execution, bounded timeouts, target-architecture flags and absence of--allow-untrusted.bash -nwith each DockerfileRUNinstruction on stdin — all passed.git show 48e2083869ab2b154b2058c32682391d1c77e403 --format= | git patch-id --stableandgit show HEAD --format= | git patch-id --stable— both yielded5954abdb8182c7fe0330da82e0488dc2a13dbbe4.docker info --format '{{.OSType}}/{{.Architecture}}'— failed: local Docker daemon unavailable. Docker image builds, Linux executable/sysroot installation, full native builds and managed tests were not run locally. Linux CI must verify image/build execution. No new test infrastructure is added for this bootstrap-only backport.Bugs Fixed
gitlab.alpinelinux.org:443, then artifact publication fails because output does not exist.API Changes
None.
Behavioral Changes
None outside the build bootstrap fix above.
Required skia PR
None.
PR Checklist