Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

ci: Use BuildJet Ubuntu 20.04 runners for better glibc compatibility (#18442)

Peter Tripp432de00e894e
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index ca0d8bb9100..ef1570fbf21 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -254,7 +254,7 @@ jobs:
timeout-minutes: 60
name: Create a Linux bundle
runs-on:
- - buildjet-16vcpu-ubuntu-2204
+ - buildjet-16vcpu-ubuntu-2004
if: ${{ startsWith(github.ref, 'refs/tags/v') || contains(github.event.pull_request.labels.*.name, 'run-bundling') }}
needs: [linux_tests]
env:
@@ -267,7 +267,7 @@ jobs:
clean: false
- name: Install Linux dependencies
- run: ./script/linux
+ run: ./script/linux && ./script/install-mold 2.34.0
- name: Determine version and release channel
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
diff --git a/.github/workflows/release_nightly.yml b/.github/workflows/release_nightly.yml
index 4e8a257bdd1..349d14f990f 100644
--- a/.github/workflows/release_nightly.yml
+++ b/.github/workflows/release_nightly.yml
@@ -100,7 +100,7 @@ jobs:
name: Create a Linux *.tar.gz bundle for x86
if: github.repository_owner == 'zed-industries'
runs-on:
- - buildjet-16vcpu-ubuntu-2204
+ - buildjet-16vcpu-ubuntu-2004
needs: tests
env:
DIGITALOCEAN_SPACES_ACCESS_KEY: ${{ secrets.DIGITALOCEAN_SPACES_ACCESS_KEY }}
@@ -117,7 +117,7 @@ jobs:
run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Install Linux dependencies
- run: ./script/linux
+ run: ./script/linux && ./script/install-mold 2.34.0
- name: Limit target directory size
run: script/clear-target-dir-if-larger-than 100
diff --git a/docs/src/linux.md b/docs/src/linux.md
index 17334c325ca..3bba9c8f93a 100644
--- a/docs/src/linux.md
+++ b/docs/src/linux.md
@@ -16,7 +16,7 @@ The Zed installed by the script works best on systems that:
- have a Vulkan compatible GPU available (for example Linux on an M-series macBook)
- have a system-wide glibc (NixOS and Alpine do not by default)
- - x86_64 (Intel/AMD): glibc version >= 2.35 (Ubuntu 22 and newer)
+ - x86_64 (Intel/AMD): glibc version >= 2.29 (Ubuntu 20 and newer)
- aarch64 (ARM): glibc version >= 2.35 (Ubuntu 22 and newer)
Both Nix and Alpine have third-party Zed packages available (though they are currently a few weeks out of date). If you'd like to use our builds they do work if you install a glibc compatibility layer. On NixOS you can try [nix-ld](https://github.com/Mic92/nix-ld), and on Alpine [gcompat](https://wiki.alpinelinux.org/wiki/Running_glibc_programs).
@@ -24,8 +24,8 @@ Both Nix and Alpine have third-party Zed packages available (though they are cur
You will need to build from source for:
- architectures other than 64-bit Intel or 64-bit ARM (for example a 32-bit or RISC-V machine)
-- Amazon Linux
-- Rocky Linux 9.3
+- Redhat Enterprise Linux 8.x, Rocky Linux 8, AlmaLinux 8, Amazon Linux 2 on all architectures
+- Redhat Enterprise Linux 9.x, Rocky Linux 9.3, AlmaLinux 8, Amazon Linux 2023 on aarch64 (x86_x64 OK)
## Other ways to install Zed on Linux
diff --git a/script/install-mold b/script/install-mold
new file mode 100755
index 00000000000..1c451b72690
--- /dev/null
+++ b/script/install-mold
@@ -0,0 +1,37 @@
+#!/usr/bin/env bash
+
+# Install `mold` official binaries from GitHub Releases.
+#
+# Adapted from the official rui314/setup-mold@v1 action to:
+# * use environment variables instead of action inputs
+# * remove make-default support
+# * use curl instead of wget
+# * support doas for sudo
+# * support redhat systems
+# See: https://github.com/rui314/setup-mold/blob/main/action.yml
+
+set -euo pipefail
+
+MOLD_VERSION="${MOLD_VERSION:-${1:-}}"
+if [ "$(uname -s)" != "Linux" ]; then
+ echo "Error: This script is intended for Linux systems only."
+ exit 1
+elif [ -z "$MOLD_VERSION" ]; then
+ echo "Usage: $0 2.34.0"
+ exit 1
+elif [ -e /usr/local/bin/mold ]; then
+ echo "Warning: existing mold found at /usr/local/bin/mold. Skipping installation."
+ exit 0
+fi
+
+if [ "$(whoami)" = root ]; then SUDO=; else SUDO="$(command -v sudo || command -v doas || true)"; fi
+
+MOLD_REPO="${MOLD_REPO:-https://github.com/rui314/mold}"
+MOLD_URL="${MOLD_URL:-$MOLD_REPO}/releases/download/v$MOLD_VERSION/mold-$MOLD_VERSION-$(uname -m)-linux.tar.gz"
+
+echo "Downloading from $MOLD_URL"
+curl --location --show-error --output - --retry 3 --retry-delay 5 "$MOLD_URL" \
+ | $SUDO tar -C /usr/local --strip-components=1 --no-overwrite-dir -xzf -
+
+# Note this binary depends on the system libatomic.so.1 which is usually
+# provided as a dependency of gcc so it should be available on most systems.
diff --git a/script/linux b/script/linux
index eca3bf7f7d2..189407a5107 100755
--- a/script/linux
+++ b/script/linux
@@ -20,19 +20,29 @@ if [[ -n $apt ]]; then
libwayland-dev
libxkbcommon-x11-dev
libssl-dev
- libstdc++-12-dev
libzstd-dev
libvulkan1
libgit2-dev
make
cmake
clang
- mold
jq
gettext-base
elfutils
libsqlite3-dev
)
+ # Ubuntu 20.04 / Debian Bullseye (including CI for release)
+ if grep -q "bullseye" /etc/debian_version; then
+ deps+=(
+ libstdc++-10-dev
+ )
+ else
+ deps+=(
+ libstdc++-12-dev
+ mold
+ )
+ fi
+
$maysudo "$apt" update
$maysudo "$apt" install -y "${deps[@]}"
exit 0