gpui: Add sendable foreground execution for web HTTP clients (#66165)

## Summary

This cleans up the gpui_platform code a bit, and in combination the way
we set up the http client for the web. This does introduce a
`ForegroundExecutor` variant that it itself is Send-able, allowing to
dispatch foreground futures from background workers (by requiring the
future to be Send, unlike `ForegroundExecutor`), which is a requirement
for web fetch.

a31c7b54c60738b82524e4e4c12aec2f6caf101d fixes a bunch of warnings with
our binary names

Release Notes:

- [gpui] N/A
This commit is contained in:
Lukas Wirth
2026-10-29 09:12:10 +00:00
committed by GitHub
parent f0210f1621
commit 2c2f737ab2
52 changed files with 359 additions and 195 deletions
+6 -6
View File
@@ -65,13 +65,13 @@ cargo build --release --target "${remote_server_triple}" --package remote_server
# Strip debug symbols and save them for upload to DigitalOcean
# objcopy --only-keep-debug "${target_dir}/${target_triple}/release/zed" "${target_dir}/${target_triple}/release/zed.dbg"
# objcopy --only-keep-debug "${target_dir}/${remote_server_triple}/release/remote_server" "${target_dir}/${remote_server_triple}/release/remote_server.dbg"
# objcopy --only-keep-debug "${target_dir}/${remote_server_triple}/release/remote-server" "${target_dir}/${remote_server_triple}/release/remote-server.dbg"
# objcopy --strip-debug "${target_dir}/${target_triple}/release/zed"
# objcopy --strip-debug "${target_dir}/${target_triple}/release/cli"
# objcopy --strip-debug "${target_dir}/${remote_server_triple}/release/remote_server"
# objcopy --strip-debug "${target_dir}/${remote_server_triple}/release/remote-server"
# gzip -f "${target_dir}/${target_triple}/release/zed.dbg"
# gzip -f "${target_dir}/${remote_server_triple}/release/remote_server.dbg"
# gzip -f "${target_dir}/${remote_server_triple}/release/remote-server.dbg"
# if [[ -n "${DIGITALOCEAN_SPACES_SECRET_KEY:-}" && -n "${DIGITALOCEAN_SPACES_ACCESS_KEY:-}" ]]; then
# upload_to_blob_store_public \
@@ -80,12 +80,12 @@ cargo build --release --target "${remote_server_triple}" --package remote_server
# "$channel/zed-$version-${target_triple}.dbg.gz"
# upload_to_blob_store_public \
# "zed-debug-symbols" \
# "${target_dir}/${remote_server_triple}/release/remote_server.dbg.gz" \
# "${target_dir}/${remote_server_triple}/release/remote-server.dbg.gz" \
# "$channel/remote_server-$version-${remote_server_triple}.dbg.gz"
# fi
# Ensure that remote_server does not depend on libssl nor libcrypto, as we got rid of these deps.
if ldd "${target_dir}/${remote_server_triple}/release/remote_server" | grep -q 'libcrypto\|libssl'; then
if ldd "${target_dir}/${remote_server_triple}/release/remote-server" | grep -q 'libcrypto\|libssl'; then
echo "Error: remote_server still depends on libssl or libcrypto" && exit 1
fi
@@ -157,5 +157,5 @@ arch=$(uname -m)
# ls "${target_dir}/release" | grep -E ${remove_match} | xargs -d "\n" -I {} rm -f "${target_dir}/release/{}" || true
# tar -czvf "${target_dir}/release/$archive" -C ${temp_dir} "zed$suffix.app"
gzip -f --stdout --best "${target_dir}/${remote_server_triple}/release/remote_server" \
gzip -f --stdout --best "${target_dir}/${remote_server_triple}/release/remote-server" \
> "${target_dir}/zed-remote-server-freebsd-x86_64.gz"
+4 -4
View File
@@ -144,7 +144,7 @@ if ! "$skip_sentry"; then
echo "Attempting sentry upload (attempt $attempt/3)..."
if sentry-cli debug-files upload --include-sources --wait -p zed -o zed-dev \
"${target_dir}/${target_triple}"/release/zed \
"${target_dir}/${remote_server_triple}"/release/remote_server; then
"${target_dir}/${remote_server_triple}"/release/remote-server; then
echo "Sentry upload successful on attempt $attempt"
break
fi
@@ -163,10 +163,10 @@ fi
# We use llvm-objcopy because GNU objcopy on older distros (e.g. Ubuntu 20.04)
# doesn't understand CREL sections produced by newer LLVM.
llvm-objcopy --only-keep-debug "${target_dir}/${target_triple}/release/zed" "${target_dir}/${target_triple}/release/zed.dbg"
llvm-objcopy --only-keep-debug "${target_dir}/${remote_server_triple}/release/remote_server" "${target_dir}/${remote_server_triple}/release/remote_server.dbg"
llvm-objcopy --only-keep-debug "${target_dir}/${remote_server_triple}/release/remote-server" "${target_dir}/${remote_server_triple}/release/remote-server.dbg"
# Ensure that remote_server does not depend on libssl nor libcrypto, as we got rid of these deps.
if ldd "${target_dir}/${remote_server_triple}/release/remote_server" | grep -q 'libcrypto\|libssl'; then
if ldd "${target_dir}/${remote_server_triple}/release/remote-server" | grep -q 'libcrypto\|libssl'; then
if [[ "$remote_server_triple" == *-musl ]]; then
echo "Error: remote_server still depends on libssl or libcrypto" && exit 1
else
@@ -190,7 +190,7 @@ zed_dir="${temp_dir}/zed$suffix.app"
mkdir -p "${zed_dir}/bin" "${zed_dir}/libexec"
llvm-objcopy --strip-unneeded "${target_dir}/${target_triple}/release/zed" "${zed_dir}/libexec/zed-editor"
llvm-objcopy --strip-debug --discard-all "${target_dir}/${target_triple}/release/cli" "${zed_dir}/bin/zed"
llvm-objcopy --strip-debug --discard-all "${target_dir}/${remote_server_triple}/release/remote_server" "${temp_dir}/remote_server"
llvm-objcopy --strip-debug --discard-all "${target_dir}/${remote_server_triple}/release/remote-server" "${temp_dir}/remote_server"
# Libs
# Bundle libstdc++ so older supported systems can run binaries built with our
+5 -5
View File
@@ -327,7 +327,7 @@ function extract_debug_symbols() {
cat target/dsymutil.log
exit 1
fi
if ! dsymutil --flat "target/${target_triple}/${target_dir}/remote_server" 2> target/dsymutil.log; then
if ! dsymutil --flat "target/${target_triple}/${target_dir}/remote-server" 2> target/dsymutil.log; then
echo "dsymutil failed"
cat target/dsymutil.log
exit 1
@@ -345,7 +345,7 @@ function upload_debug_symbols() {
echo "Sentry upload attempt $attempt..."
if sentry-cli debug-files upload --include-sources --wait -p zed -o zed-dev \
"target/${target_triple}/${target_dir}/zed.dwarf" \
"target/${target_triple}/${target_dir}/remote_server.dwarf"; then
"target/${target_triple}/${target_dir}/remote-server.dwarf"; then
break
else
echo "Sentry upload failed on attempt $attempt"
@@ -369,12 +369,12 @@ if [[ "$target_dir" == "release" && "$local_install" != true ]]; then
extract_debug_symbols
strip -x "target/${target_triple}/${target_dir}/zed"
strip -x "target/${target_triple}/${target_dir}/cli"
strip -x "target/${target_triple}/${target_dir}/remote_server"
strip -x "target/${target_triple}/${target_dir}/remote-server"
fi
cp target/${target_triple}/${target_dir}/zed "${app_path}/Contents/MacOS/zed"
cp target/${target_triple}/${target_dir}/cli "${app_path}/Contents/MacOS/cli"
sign_app_binaries
sign_binary "target/$target_triple/release/remote_server"
gzip -f --stdout --best target/$target_triple/release/remote_server > target/zed-remote-server-macos-$arch_suffix.gz
sign_binary "target/$target_triple/release/remote-server"
gzip -f --stdout --best target/$target_triple/release/remote-server > target/zed-remote-server-macos-$arch_suffix.gz
+6 -4
View File
@@ -115,11 +115,11 @@ function GenerateLicenses {
function BuildZedAndItsFriends {
Write-Output "Building Zed and its friends, for channel: $channel"
# Build zed.exe, cli.exe and auto_update_helper.exe
# Build zed.exe, cli.exe and auto-update-helper.exe
cargo --config .cargo/bundle-config.toml build --release --package zed --package cli --package auto_update_helper --target $target
Copy-Item -Path ".\$CargoOutDir\zed.exe" -Destination "$innoDir\Zed.exe" -Force
Copy-Item -Path ".\$CargoOutDir\cli.exe" -Destination "$innoDir\cli.exe" -Force
Copy-Item -Path ".\$CargoOutDir\auto_update_helper.exe" -Destination "$innoDir\auto_update_helper.exe" -Force
Copy-Item -Path ".\$CargoOutDir\auto-update-helper.exe" -Destination "$innoDir\auto_update_helper.exe" -Force
# Build explorer_command_injector.dll
switch ($channel) {
"stable" {
@@ -139,8 +139,9 @@ function BuildRemoteServer {
Write-Output "Building remote_server for $target"
cargo --config .cargo/bundle-config.toml build --release --package remote_server --target $target
# Create zipped remote server binary
$remoteServerSrc = (Resolve-Path ".\$CargoOutDir\remote_server.exe").Path
# SSH clients expect remote_server.exe inside the archive.
Copy-Item -Path ".\$CargoOutDir\remote-server.exe" -Destination "$innoDir\remote_server.exe" -Force
$remoteServerSrc = (Resolve-Path "$innoDir\remote_server.exe").Path
if ($canCodeSign) {
Write-Output "Code signing remote_server.exe"
@@ -150,6 +151,7 @@ function BuildRemoteServer {
$remoteServerDst = "$env:ZED_WORKSPACE\target\zed-remote-server-windows-$Architecture.zip"
Write-Output "Compressing remote_server to $remoteServerDst"
Compress-Archive -Path $remoteServerSrc -DestinationPath $remoteServerDst -Force
Remove-Item -Path $remoteServerSrc -Force
Write-Output "Remote server compressed successfully"
}
+1 -1
View File
@@ -11,7 +11,7 @@
# current default WSL distro) user namespaces are restricted by AppArmor by
# default, which is exactly why this step is needed.
# 3. Runs `cargo xtask wsl-sandbox-tests`, which builds and runs
# `wsl_sandbox_test_helper` against the real WSL/Bubblewrap sandbox.
# `wsl-sandbox-test-helper` against the real WSL/Bubblewrap sandbox.
#
# By default it requires the sandbox to actually be enforced (so a broken setup
# fails loudly instead of silently skipping). Pass -AllowSkip to keep the