Merge remote-tracking branch 'origin/main'
# Conflicts: # Cargo.lock # crates/settings_content/src/settings_content.rs # crates/zed/Cargo.toml # script/bundle-linux
This commit is contained in:
commit
94818d891b
775 files changed
+86177
-17521
No files matched your search
+14
-14
@@ -43,6 +43,11 @@ while [[ $# -gt 0 ]]; do
|
||||
esac
|
||||
done
|
||||
|
||||
if [[ -n "${RUSTFLAGS+x}" || -n "${CARGO_ENCODED_RUSTFLAGS+x}" ]]; then
|
||||
echo "Unset RUSTFLAGS and CARGO_ENCODED_RUSTFLAGS; put extra flags in target rustflags in .cargo/config.toml so bundle flags are preserved." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
export ZED_BUNDLE=true
|
||||
|
||||
channel=$(<crates/zed/RELEASE_CHANNEL)
|
||||
@@ -74,20 +79,10 @@ fi
|
||||
export CC=${CC:-$(which clang)}
|
||||
|
||||
# Build binary in release mode
|
||||
# We need lld to link libwebrtc.a successfully on aarch64-linux.
|
||||
# NOTE: Since RUSTFLAGS env var overrides all .cargo/config.toml rustflags
|
||||
# (see https://github.com/rust-lang/cargo/issues/5376), the
|
||||
# [target.aarch64-unknown-linux-gnu] section in config.toml has no effect here.
|
||||
if [[ "$(uname -m)" == "aarch64" ]]; then
|
||||
export RUSTFLAGS="${RUSTFLAGS:-} -C link-arg=-fuse-ld=lld -C link-args=-Wl,--disable-new-dtags,-rpath,\$ORIGIN/../lib"
|
||||
else
|
||||
export RUSTFLAGS="${RUSTFLAGS:-} -C link-args=-Wl,--disable-new-dtags,-rpath,\$ORIGIN/../lib"
|
||||
fi
|
||||
cargo --config .cargo/bundle-config.toml build --release --target "${target_triple}" --package zed --package cli --features remote/build-remote-server-binary
|
||||
# Build remote_server in separate invocation to prevent feature unification from other crates
|
||||
# from influencing dynamic libraries required by it.
|
||||
if [[ "$remote_server_triple" == "$musl_triple" ]]; then
|
||||
export RUSTFLAGS="${RUSTFLAGS:-} -C target-feature=+crt-static"
|
||||
musl_cc_var="CC_$(echo "$remote_server_triple" | tr '-' '_')"
|
||||
export "$musl_cc_var"=musl-gcc
|
||||
fi
|
||||
@@ -121,12 +116,17 @@ else
|
||||
fi
|
||||
fi
|
||||
|
||||
# Strip debug symbols and save them for upload to DigitalOcean.
|
||||
# Split debug symbols into local .dbg files, then strip debug info and local
|
||||
# symbols from the shipped binaries. Sentry receives the full unstripped
|
||||
# binaries above; the .dbg files keep symbols recoverable when that upload
|
||||
# is skipped.
|
||||
# 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 --strip-debug "${target_dir}/${target_triple}/release/zed"
|
||||
llvm-objcopy --strip-debug "${target_dir}/${target_triple}/release/cli"
|
||||
llvm-objcopy --strip-debug "${target_dir}/${remote_server_triple}/release/remote_server"
|
||||
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 --strip-debug --discard-all "${target_dir}/${target_triple}/release/zed"
|
||||
llvm-objcopy --strip-debug --discard-all "${target_dir}/${target_triple}/release/cli"
|
||||
llvm-objcopy --strip-debug --discard-all "${target_dir}/${remote_server_triple}/release/remote_server"
|
||||
|
||||
# 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
|
||||
|
||||
Reference in new issue
Block a user