mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
[publish images] Fix CI, remove broken freebsd image step
This commit is contained in:
@@ -31,7 +31,7 @@ import {
|
||||
} from "../scripts/utils.mjs";
|
||||
|
||||
/**
|
||||
* @typedef {"linux" | "darwin" | "windows" | "freebsd"} Os
|
||||
* @typedef {"linux" | "darwin" | "windows"} Os
|
||||
* @typedef {"aarch64" | "x64"} Arch
|
||||
* @typedef {"musl"} Abi
|
||||
* @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: "windows", arch: "x64", 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: {
|
||||
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: {
|
||||
CANARY: revision,
|
||||
},
|
||||
@@ -1109,9 +1108,6 @@ async function getPipeline(options = {}) {
|
||||
? buildPlatforms
|
||||
: buildPlatforms.filter(({ profile }) => profile !== "asan");
|
||||
|
||||
// run build-image but no build-bun yet
|
||||
relevantBuildPlatforms = relevantBuildPlatforms.filter(({ os }) => os !== "freebsd");
|
||||
|
||||
steps.push(
|
||||
...relevantBuildPlatforms.map(target => {
|
||||
const imageKey = getImageKey(target);
|
||||
|
||||
@@ -281,9 +281,6 @@ check_operating_system() {
|
||||
Darwin)
|
||||
os="darwin"
|
||||
;;
|
||||
FreeBSD)
|
||||
os="freebsd"
|
||||
;;
|
||||
*)
|
||||
error "Unsupported operating system: $os"
|
||||
;;
|
||||
@@ -346,11 +343,6 @@ check_operating_system() {
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
freebsd)
|
||||
. /etc/os-release
|
||||
distro="$ID"
|
||||
release="$VERSION_ID"
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -n "$distro" ]; then
|
||||
@@ -434,9 +426,6 @@ check_package_manager() {
|
||||
error "No package manager found. (apt, dnf, yum, apk)"
|
||||
fi
|
||||
;;
|
||||
freebsd)
|
||||
pm="pkg"
|
||||
;;
|
||||
esac
|
||||
print "Package manager: $pm"
|
||||
|
||||
@@ -449,13 +438,6 @@ check_package_manager() {
|
||||
apk)
|
||||
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
|
||||
}
|
||||
|
||||
@@ -816,9 +798,6 @@ install_nodejs() {
|
||||
linux)
|
||||
nodejs_platform="linux"
|
||||
;;
|
||||
freebsd)
|
||||
nodejs_platform="freebsd"
|
||||
;;
|
||||
*)
|
||||
error "Unsupported OS for Node.js download: $os"
|
||||
;;
|
||||
@@ -837,12 +816,6 @@ install_nodejs() {
|
||||
;;
|
||||
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
|
||||
musl)
|
||||
nodejs_mirror="https://bun-nodejs-release.s3.us-west-1.amazonaws.com"
|
||||
@@ -932,10 +905,6 @@ install_nodejs() {
|
||||
}
|
||||
|
||||
install_nodejs_headers() {
|
||||
if [ "$os" = "freebsd" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
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_dir="$(dirname "$nodejs_headers_tar")"
|
||||
@@ -950,10 +919,6 @@ install_nodejs_headers() {
|
||||
}
|
||||
|
||||
setup_node_gyp_cache() {
|
||||
if [ "$os" = "freebsd" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
nodejs_version="$1"
|
||||
headers_source="$2"
|
||||
|
||||
@@ -992,11 +957,6 @@ bun_version_exact() {
|
||||
}
|
||||
|
||||
install_bun() {
|
||||
if [ "$os" = "freebsd" ]; then
|
||||
# TODO: need to complete bun bootstrap for for this work
|
||||
return
|
||||
fi
|
||||
|
||||
install_packages unzip
|
||||
|
||||
case "$pm" in
|
||||
@@ -1048,9 +1008,6 @@ install_cmake() {
|
||||
--skip-license \
|
||||
--prefix=/usr
|
||||
;;
|
||||
freebsd-pkg)
|
||||
install_packages devel/cmake
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
@@ -1122,17 +1079,6 @@ install_build_essentials() {
|
||||
ruby \
|
||||
perl \
|
||||
;;
|
||||
freebsd)
|
||||
install_packages \
|
||||
devel/ninja \
|
||||
devel/pkgconf \
|
||||
lang/go \
|
||||
devel/gmake \
|
||||
lang/python3 \
|
||||
devel/libtool \
|
||||
lang/ruby33 \
|
||||
perl5 \
|
||||
;;
|
||||
esac
|
||||
|
||||
install_cmake
|
||||
@@ -1185,13 +1131,6 @@ install_llvm() {
|
||||
"llvm$(llvm_version)-dev" # Ensures llvm-symbolizer is installed
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$os" in
|
||||
freebsd)
|
||||
# TODO: use llvm_version_exact
|
||||
install_packages "devel/llvm$(llvm_version)"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
install_gcc() {
|
||||
@@ -1268,17 +1207,9 @@ install_gcc() {
|
||||
}
|
||||
|
||||
install_sccache() {
|
||||
case "$os" in
|
||||
linux)
|
||||
;;
|
||||
freebsd)
|
||||
cargo install sccache --locked --version 0.12.0
|
||||
return
|
||||
;;
|
||||
*)
|
||||
if [ "$os" != "linux" ]; then
|
||||
error "Unsupported platform: $os"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Alright, look, this function is cobbled together but it's only as cobbled
|
||||
# together as this whole script is.
|
||||
@@ -1307,13 +1238,6 @@ install_sccache() {
|
||||
}
|
||||
|
||||
install_rust() {
|
||||
case "$distro" in
|
||||
freebsd)
|
||||
install_packages lang/rust
|
||||
create_directory "$HOME/.cargo/bin"
|
||||
append_to_path "$HOME/.cargo/bin"
|
||||
;;
|
||||
*)
|
||||
rust_home="/opt/rust"
|
||||
create_directory "$rust_home"
|
||||
append_to_profile "export RUSTUP_HOME=$rust_home"
|
||||
@@ -1326,8 +1250,6 @@ install_rust() {
|
||||
|
||||
# Ensure all rustup files are accessible (for CI builds where different users run builds)
|
||||
grant_to_user "$rust_home"
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$osxcross" in
|
||||
1)
|
||||
@@ -1444,9 +1366,6 @@ install_tailscale() {
|
||||
execute_as_user go install tailscale.com/cmd/tailscale{,d}@latest
|
||||
append_to_path "$home/go/bin"
|
||||
;;
|
||||
freebsd)
|
||||
install_packages security/tailscale
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
@@ -1513,14 +1432,6 @@ create_buildkite_user() {
|
||||
--home "$home" \
|
||||
--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" \
|
||||
--system \
|
||||
@@ -1703,17 +1614,6 @@ install_age() {
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
freebsd)
|
||||
case "$arch" in
|
||||
x64)
|
||||
age_arch="amd64"
|
||||
age_hash="943a7510a9973a1e589b913a70228aa1361a63cde39e3ed581435a4d4802df29"
|
||||
;;
|
||||
*)
|
||||
error "Unsupported platform: $os-$arch"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
error "Unsupported platform: $os-$arch"
|
||||
;;
|
||||
|
||||
@@ -387,9 +387,6 @@ const aws = {
|
||||
owner = "amazon";
|
||||
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) {
|
||||
@@ -676,10 +673,6 @@ function getCloudInit(cloudInit) {
|
||||
case "windows":
|
||||
// handled above
|
||||
break;
|
||||
case "freebsd":
|
||||
sftpPath = "/usr/libexec/openssh/sftp-server";
|
||||
shell = "/bin/csh";
|
||||
break;
|
||||
default:
|
||||
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 {"macos" | "windowsserver" | "debian" | "ubuntu" | "alpine" | "amazonlinux"} Distro
|
||||
*/
|
||||
|
||||
@@ -1538,7 +1538,7 @@ export function parseNumber(value) {
|
||||
|
||||
/**
|
||||
* @param {string} string
|
||||
* @returns {"darwin" | "linux" | "windows" | "freebsd"}
|
||||
* @returns {"darwin" | "linux" | "windows"}
|
||||
*/
|
||||
export function parseOs(string) {
|
||||
if (/darwin|apple|mac/i.test(string)) {
|
||||
@@ -1550,9 +1550,6 @@ export function parseOs(string) {
|
||||
if (/win/i.test(string)) {
|
||||
return "windows";
|
||||
}
|
||||
if (/freebsd/i.test(string)) {
|
||||
return "freebsd";
|
||||
}
|
||||
throw new Error(`Unsupported operating system: ${string}`);
|
||||
}
|
||||
|
||||
@@ -1915,10 +1912,6 @@ export function getUsernameForDistro(distro) {
|
||||
if (/amazon|amzn|al\d+|rhel/i.test(distro)) {
|
||||
return "ec2-user";
|
||||
}
|
||||
if (/freebsd/i.test(distro)) {
|
||||
return "root";
|
||||
}
|
||||
|
||||
throw new Error(`Unsupported distro: ${distro}`);
|
||||
}
|
||||
|
||||
@@ -2986,7 +2979,6 @@ const emojiMap = {
|
||||
gear: ["⚙️", "gear"],
|
||||
clipboard: ["📋", "clipboard"],
|
||||
rocket: ["🚀", "rocket"],
|
||||
freebsd: ["😈", "freebsd"],
|
||||
openbsd: ["🐡", "openbsd"],
|
||||
netbsd: ["🚩", "netbsd"],
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user