[publish images] Fix CI, remove broken freebsd image step

This commit is contained in:
Jarred Sumner
2025-12-24 20:02:56 -08:00
parent 0dd4f025b6
commit 08e03814e5
4 changed files with 17 additions and 136 deletions

View File

@@ -31,7 +31,7 @@ import {
} from "../scripts/utils.mjs"; } from "../scripts/utils.mjs";
/** /**
* @typedef {"linux" | "darwin" | "windows" | "freebsd"} Os * @typedef {"linux" | "darwin" | "windows"} Os
* @typedef {"aarch64" | "x64"} Arch * @typedef {"aarch64" | "x64"} Arch
* @typedef {"musl"} Abi * @typedef {"musl"} Abi
* @typedef {"debian" | "ubuntu" | "alpine" | "amazonlinux"} Distro * @typedef {"debian" | "ubuntu" | "alpine" | "amazonlinux"} Distro
@@ -114,7 +114,6 @@ const buildPlatforms = [
{ os: "linux", arch: "x64", abi: "musl", baseline: true, distro: "alpine", release: "3.22" }, { os: "linux", arch: "x64", abi: "musl", baseline: true, distro: "alpine", release: "3.22" },
{ os: "windows", arch: "x64", release: "2019" }, { os: "windows", arch: "x64", release: "2019" },
{ os: "windows", arch: "x64", baseline: true, release: "2019" }, { os: "windows", arch: "x64", baseline: true, release: "2019" },
{ os: "freebsd", arch: "x64", release: "14.3" },
]; ];
/** /**
@@ -658,7 +657,7 @@ function getReleaseStep(buildPlatforms, options) {
agents: { agents: {
queue: "test-darwin", queue: "test-darwin",
}, },
depends_on: buildPlatforms.filter(p => p.os !== "freebsd").map(platform => `${getTargetKey(platform)}-build-bun`), depends_on: buildPlatforms.map(platform => `${getTargetKey(platform)}-build-bun`),
env: { env: {
CANARY: revision, CANARY: revision,
}, },
@@ -1109,9 +1108,6 @@ async function getPipeline(options = {}) {
? buildPlatforms ? buildPlatforms
: buildPlatforms.filter(({ profile }) => profile !== "asan"); : buildPlatforms.filter(({ profile }) => profile !== "asan");
// run build-image but no build-bun yet
relevantBuildPlatforms = relevantBuildPlatforms.filter(({ os }) => os !== "freebsd");
steps.push( steps.push(
...relevantBuildPlatforms.map(target => { ...relevantBuildPlatforms.map(target => {
const imageKey = getImageKey(target); const imageKey = getImageKey(target);

View File

@@ -281,9 +281,6 @@ check_operating_system() {
Darwin) Darwin)
os="darwin" os="darwin"
;; ;;
FreeBSD)
os="freebsd"
;;
*) *)
error "Unsupported operating system: $os" error "Unsupported operating system: $os"
;; ;;
@@ -346,11 +343,6 @@ check_operating_system() {
;; ;;
esac esac
;; ;;
freebsd)
. /etc/os-release
distro="$ID"
release="$VERSION_ID"
;;
esac esac
if [ -n "$distro" ]; then if [ -n "$distro" ]; then
@@ -434,9 +426,6 @@ check_package_manager() {
error "No package manager found. (apt, dnf, yum, apk)" error "No package manager found. (apt, dnf, yum, apk)"
fi fi
;; ;;
freebsd)
pm="pkg"
;;
esac esac
print "Package manager: $pm" print "Package manager: $pm"
@@ -449,13 +438,6 @@ check_package_manager() {
apk) apk)
package_manager update package_manager update
;; ;;
pkg)
# may need to switch betwen 'latest' and 'quarterly' depending on which repo www/chromium is in. check https://www.freshports.org/www/chromium/.
# mkdir -p /usr/local/etc/pkg/repos
# echo 'FreeBSD: { url: "pkg+http://pkg.FreeBSD.org/${ABI}/quarterly" }' > /usr/local/etc/pkg/repos/FreeBSD.conf
export ASSUME_ALWAYS_YES=yes
package_manager update -f
;;
esac esac
} }
@@ -816,9 +798,6 @@ install_nodejs() {
linux) linux)
nodejs_platform="linux" nodejs_platform="linux"
;; ;;
freebsd)
nodejs_platform="freebsd"
;;
*) *)
error "Unsupported OS for Node.js download: $os" error "Unsupported OS for Node.js download: $os"
;; ;;
@@ -837,12 +816,6 @@ install_nodejs() {
;; ;;
esac esac
if [ "$os" = "freebsd" ]; then
# TODO: use nodejs_version_exact
install_packages "www/node$(nodejs_version)" "www/npm-node$(nodejs_version)"
return
fi
case "$abi" in case "$abi" in
musl) musl)
nodejs_mirror="https://bun-nodejs-release.s3.us-west-1.amazonaws.com" nodejs_mirror="https://bun-nodejs-release.s3.us-west-1.amazonaws.com"
@@ -932,10 +905,6 @@ install_nodejs() {
} }
install_nodejs_headers() { install_nodejs_headers() {
if [ "$os" = "freebsd" ]; then
return
fi
nodejs_version="$(nodejs_version_exact)" nodejs_version="$(nodejs_version_exact)"
nodejs_headers_tar="$(download_file "https://nodejs.org/download/release/v$nodejs_version/node-v$nodejs_version-headers.tar.gz")" nodejs_headers_tar="$(download_file "https://nodejs.org/download/release/v$nodejs_version/node-v$nodejs_version-headers.tar.gz")"
nodejs_headers_dir="$(dirname "$nodejs_headers_tar")" nodejs_headers_dir="$(dirname "$nodejs_headers_tar")"
@@ -950,10 +919,6 @@ install_nodejs_headers() {
} }
setup_node_gyp_cache() { setup_node_gyp_cache() {
if [ "$os" = "freebsd" ]; then
return
fi
nodejs_version="$1" nodejs_version="$1"
headers_source="$2" headers_source="$2"
@@ -992,11 +957,6 @@ bun_version_exact() {
} }
install_bun() { install_bun() {
if [ "$os" = "freebsd" ]; then
# TODO: need to complete bun bootstrap for for this work
return
fi
install_packages unzip install_packages unzip
case "$pm" in case "$pm" in
@@ -1048,9 +1008,6 @@ install_cmake() {
--skip-license \ --skip-license \
--prefix=/usr --prefix=/usr
;; ;;
freebsd-pkg)
install_packages devel/cmake
;;
esac esac
} }
@@ -1122,17 +1079,6 @@ install_build_essentials() {
ruby \ ruby \
perl \ perl \
;; ;;
freebsd)
install_packages \
devel/ninja \
devel/pkgconf \
lang/go \
devel/gmake \
lang/python3 \
devel/libtool \
lang/ruby33 \
perl5 \
;;
esac esac
install_cmake install_cmake
@@ -1185,13 +1131,6 @@ install_llvm() {
"llvm$(llvm_version)-dev" # Ensures llvm-symbolizer is installed "llvm$(llvm_version)-dev" # Ensures llvm-symbolizer is installed
;; ;;
esac esac
case "$os" in
freebsd)
# TODO: use llvm_version_exact
install_packages "devel/llvm$(llvm_version)"
;;
esac
} }
install_gcc() { install_gcc() {
@@ -1268,17 +1207,9 @@ install_gcc() {
} }
install_sccache() { install_sccache() {
case "$os" in if [ "$os" != "linux" ]; then
linux) error "Unsupported platform: $os"
;; fi
freebsd)
cargo install sccache --locked --version 0.12.0
return
;;
*)
error "Unsupported platform: $os"
;;
esac
# Alright, look, this function is cobbled together but it's only as cobbled # Alright, look, this function is cobbled together but it's only as cobbled
# together as this whole script is. # together as this whole script is.
@@ -1307,27 +1238,18 @@ install_sccache() {
} }
install_rust() { install_rust() {
case "$distro" in rust_home="/opt/rust"
freebsd) create_directory "$rust_home"
install_packages lang/rust append_to_profile "export RUSTUP_HOME=$rust_home"
create_directory "$HOME/.cargo/bin" append_to_profile "export CARGO_HOME=$rust_home"
append_to_path "$HOME/.cargo/bin"
;;
*)
rust_home="/opt/rust"
create_directory "$rust_home"
append_to_profile "export RUSTUP_HOME=$rust_home"
append_to_profile "export CARGO_HOME=$rust_home"
sh="$(require sh)" sh="$(require sh)"
rustup_script=$(download_file "https://sh.rustup.rs") rustup_script=$(download_file "https://sh.rustup.rs")
execute "$sh" -lc "$rustup_script -y --no-modify-path" execute "$sh" -lc "$rustup_script -y --no-modify-path"
append_to_path "$rust_home/bin" append_to_path "$rust_home/bin"
# Ensure all rustup files are accessible (for CI builds where different users run builds) # Ensure all rustup files are accessible (for CI builds where different users run builds)
grant_to_user "$rust_home" grant_to_user "$rust_home"
;;
esac
case "$osxcross" in case "$osxcross" in
1) 1)
@@ -1444,9 +1366,6 @@ install_tailscale() {
execute_as_user go install tailscale.com/cmd/tailscale{,d}@latest execute_as_user go install tailscale.com/cmd/tailscale{,d}@latest
append_to_path "$home/go/bin" append_to_path "$home/go/bin"
;; ;;
freebsd)
install_packages security/tailscale
;;
esac esac
} }
@@ -1513,14 +1432,6 @@ create_buildkite_user() {
--home "$home" \ --home "$home" \
--disabled-password --disabled-password
;; ;;
freebsd)
execute_sudo pw group add -n "$group"
execute_sudo pw user add \
-n "$user" \
-g "$group" \
-s "$(require sh)" \
-d "$home" \
;;
*) *)
execute_sudo useradd "$user" \ execute_sudo useradd "$user" \
--system \ --system \
@@ -1703,17 +1614,6 @@ install_age() {
;; ;;
esac esac
;; ;;
freebsd)
case "$arch" in
x64)
age_arch="amd64"
age_hash="943a7510a9973a1e589b913a70228aa1361a63cde39e3ed581435a4d4802df29"
;;
*)
error "Unsupported platform: $os-$arch"
;;
esac
;;
*) *)
error "Unsupported platform: $os-$arch" error "Unsupported platform: $os-$arch"
;; ;;

View File

@@ -387,9 +387,6 @@ const aws = {
owner = "amazon"; owner = "amazon";
name = `Windows_Server-${release || "*"}-English-Full-Base-*`; name = `Windows_Server-${release || "*"}-English-Full-Base-*`;
} }
} else if (os === "freebsd") {
owner = "782442783595"; // upstream member of FreeBSD team, likely Colin Percival
name = `FreeBSD ${release}-STABLE-${{ "aarch64": "arm64", "x64": "amd64" }[arch] ?? "amd64"}-* UEFI-PREFERRED cloud-init UFS`;
} }
if (!name) { if (!name) {
@@ -676,10 +673,6 @@ function getCloudInit(cloudInit) {
case "windows": case "windows":
// handled above // handled above
break; break;
case "freebsd":
sftpPath = "/usr/libexec/openssh/sftp-server";
shell = "/bin/csh";
break;
default: default:
throw new Error(`Unsupported os: ${cloudInit["os"]}`); throw new Error(`Unsupported os: ${cloudInit["os"]}`);
} }
@@ -1071,7 +1064,7 @@ function getCloud(name) {
} }
/** /**
* @typedef {"linux" | "darwin" | "windows" | "freebsd"} Os * @typedef {"linux" | "darwin" | "windows"} Os
* @typedef {"aarch64" | "x64"} Arch * @typedef {"aarch64" | "x64"} Arch
* @typedef {"macos" | "windowsserver" | "debian" | "ubuntu" | "alpine" | "amazonlinux"} Distro * @typedef {"macos" | "windowsserver" | "debian" | "ubuntu" | "alpine" | "amazonlinux"} Distro
*/ */

View File

@@ -1538,7 +1538,7 @@ export function parseNumber(value) {
/** /**
* @param {string} string * @param {string} string
* @returns {"darwin" | "linux" | "windows" | "freebsd"} * @returns {"darwin" | "linux" | "windows"}
*/ */
export function parseOs(string) { export function parseOs(string) {
if (/darwin|apple|mac/i.test(string)) { if (/darwin|apple|mac/i.test(string)) {
@@ -1550,9 +1550,6 @@ export function parseOs(string) {
if (/win/i.test(string)) { if (/win/i.test(string)) {
return "windows"; return "windows";
} }
if (/freebsd/i.test(string)) {
return "freebsd";
}
throw new Error(`Unsupported operating system: ${string}`); throw new Error(`Unsupported operating system: ${string}`);
} }
@@ -1915,10 +1912,6 @@ export function getUsernameForDistro(distro) {
if (/amazon|amzn|al\d+|rhel/i.test(distro)) { if (/amazon|amzn|al\d+|rhel/i.test(distro)) {
return "ec2-user"; return "ec2-user";
} }
if (/freebsd/i.test(distro)) {
return "root";
}
throw new Error(`Unsupported distro: ${distro}`); throw new Error(`Unsupported distro: ${distro}`);
} }
@@ -2986,7 +2979,6 @@ const emojiMap = {
gear: ["⚙️", "gear"], gear: ["⚙️", "gear"],
clipboard: ["📋", "clipboard"], clipboard: ["📋", "clipboard"],
rocket: ["🚀", "rocket"], rocket: ["🚀", "rocket"],
freebsd: ["😈", "freebsd"],
openbsd: ["🐡", "openbsd"], openbsd: ["🐡", "openbsd"],
netbsd: ["🚩", "netbsd"], netbsd: ["🚩", "netbsd"],
}; };