-
Notifications
You must be signed in to change notification settings - Fork 5k
[publish images] bootstrap: rebake CI images to refresh prefetched deps #30095
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,5 +1,5 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| #!/bin/sh | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Version: 34 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Version: 35 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # A script that installs the dependencies needed to build and test Bun. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # This should work on macOS and Linux with a POSIX shell. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -1191,23 +1191,18 @@ install_gcc() { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Taken from WebKit's Dockerfile. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # https://github.com/oven-sh/WebKit/blob/816a3c02e0f8b53f8eec06b5ed911192589b51e2/Dockerfile | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| execute_sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| execute_sudo apt update -y | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| execute_sudo apt install -y \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "gcc-$gcc_version" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "g++-$gcc_version" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "libgcc-$gcc_version-dev" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "libstdc++-$gcc_version-dev" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| libasan6 \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| libubsan1 \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| libatomic1 \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| libtsan0 \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| liblsan0 \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| libgfortran5 \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| libc6-dev | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # gcc-13 on focal: Launchpad ppa:ubuntu-toolchain-r/test times out / 503s | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # often enough to break image builds, so install from a mirrored snapshot | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # of the PPA's .debs instead. See oven-sh/WebKit release gcc-13-focal-debs. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| case "$arch" in | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| x64) gcc_deb_arch="amd64" ;; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| aarch64) gcc_deb_arch="arm64" ;; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| esac | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| gcc_deb_url="https://github.com/oven-sh/WebKit/releases/download/gcc-13-focal-debs/gcc-13-focal-$gcc_deb_arch.tar.gz" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| gcc_deb_dir="$(create_tmp_directory)" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fetch "$gcc_deb_url" | execute tar -xz -C "$gcc_deb_dir" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| execute_sudo apt-get install -y --no-install-recommends "$gcc_deb_dir"/*.deb libc6-dev | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| execute rm -rf "$gcc_deb_dir" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+1194
to
+1205
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
# List release assets to source per-arch checksums you can pin in bootstrap.sh
curl -fsSL "https://api.github.com/repos/oven-sh/WebKit/releases/tags/gcc-13-focal-debs" \
| jq -r '.assets[].name'Repository: oven-sh/bun Length of output: 107 🏁 Script executed: rg "download_and_verify_file" scripts/bootstrap.shRepository: oven-sh/bun Length of output: 291 🏁 Script executed: sed -n '1194,1205p' scripts/bootstrap.shRepository: oven-sh/bun Length of output: 704 🏁 Script executed: # Check if there are SHA256 checksums documented for these assets
rg "gcc-13-focal" scripts/bootstrap.sh -A 5 -B 5Repository: oven-sh/bun Length of output: 719 Use External Implementation approach case "$arch" in
x64) gcc_deb_arch="amd64" ;;
aarch64) gcc_deb_arch="arm64" ;;
esac
gcc_deb_url="https://github.com/oven-sh/WebKit/releases/download/gcc-13-focal-debs/gcc-13-focal-$gcc_deb_arch.tar.gz"
+ case "$gcc_deb_arch" in
+ amd64) gcc_deb_sha256="<fill-from-release>" ;;
+ arm64) gcc_deb_sha256="<fill-from-release>" ;;
+ esac
gcc_deb_dir="$(create_tmp_directory)"
- fetch "$gcc_deb_url" | execute tar -xz -C "$gcc_deb_dir"
+ gcc_deb_tar="$(download_and_verify_file "$gcc_deb_url" "$gcc_deb_sha256")"
+ execute tar -xzf "$gcc_deb_tar" -C "$gcc_deb_dir"
execute_sudo apt-get install -y --no-install-recommends "$gcc_deb_dir"/*.deb libc6-devObtain the SHA256 checksums from the gcc-13-focal-debs release assets (confirmed: gcc-13-focal-amd64.tar.gz and gcc-13-focal-arm64.tar.gz exist). 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| execute_sudo update-alternatives \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| --install /usr/bin/gcc gcc "/usr/bin/gcc-$gcc_version" 130 \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: oven-sh/bun
Length of output: 107
🏁 Script executed:
Repository: oven-sh/bun
Length of output: 1192
🏁 Script executed:
Repository: oven-sh/bun
Length of output: 469
🏁 Script executed:
Repository: oven-sh/bun
Length of output: 774
Verify GCC tarball integrity before installing
.debpackages.Lines 35-37 install externally downloaded packages without checksum verification. Add SHA-256 verification before extraction/install to reduce supply-chain risk.
The release notes for
gcc-13-focal-debsalready expose checksums that can be pinned:a2b3b6e10b175bbaaefeb3e9e703ca26a97ed6c1f19ca842d3e0b0c8f941e65bbe19db90d94c52c6061280bbadcaad9b09db1e9f2e77a12f8c18c5425d2eb056Proposed hardening diff
🤖 Prompt for AI Agents