Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Enable share-generics in release bundle builds (#63432)
Kirill Bulatov68b650450641
diff --git a/.cargo/bundle-config.toml b/.cargo/bundle-config.tomlnew file mode 100644index 00000000000..66c1f2ec086--- /dev/null+++ b/.cargo/bundle-config.toml@@ -0,0 +1,5 @@+[env]+RUSTC_BOOTSTRAP = "1"++[build]+rustflags = ["-Z", "share-generics=y"]diff --git a/script/bundle-linux b/script/bundle-linuxindex 79de85b2a81..1664fbf5dc4 100755--- a/script/bundle-linux+++ b/script/bundle-linux@@ -83,7 +83,7 @@ if [[ "$(uname -m)" == "aarch64" ]]; thenelseexport RUSTFLAGS="${RUSTFLAGS:-} -C link-args=-Wl,--disable-new-dtags,-rpath,\$ORIGIN/../lib"fi-cargo build --release --target "${target_triple}" --package zed --package cli+cargo --config .cargo/bundle-config.toml build --release --target "${target_triple}" --package zed --package cli# 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@@ -91,7 +91,7 @@ if [[ "$remote_server_triple" == "$musl_triple" ]]; thenmusl_cc_var="CC_$(echo "$remote_server_triple" | tr '-' '_')"export "$musl_cc_var"=musl-gccfi-cargo build --release --target "${remote_server_triple}" --package remote_server+cargo --config .cargo/bundle-config.toml build --release --target "${remote_server_triple}" --package remote_server# Upload debug info to sentry.ioif ! command -v sentry-cli >/dev/null 2>&1; thendiff --git a/script/bundle-mac b/script/bundle-macindex eae4f861bae..477efb5a4fd 100755--- a/script/bundle-mac+++ b/script/bundle-mac@@ -87,10 +87,10 @@ script/generate-licensesrustup target add $target_tripleecho "Compiling zed binaries"-cargo build ${build_flag} --package zed --package cli --target $target_triple+cargo --config .cargo/bundle-config.toml build ${build_flag} --package zed --package cli --target $target_triple# Build remote_server in separate invocation to prevent feature unification from other crates# from influencing dynamic libraries required by it.-cargo build ${build_flag} --package remote_server --target $target_triple+cargo --config .cargo/bundle-config.toml build ${build_flag} --package remote_server --target $target_tripleecho "Creating application bundle"pushd crates/zeddiff --git a/script/bundle-windows.ps1 b/script/bundle-windows.ps1index 99b2858f8e6..786f07922bf 100644--- a/script/bundle-windows.ps1+++ b/script/bundle-windows.ps1@@ -116,20 +116,20 @@ function GenerateLicenses {function BuildZedAndItsFriends {Write-Output "Building Zed and its friends, for channel: $channel"# Build zed.exe, cli.exe and auto_update_helper.exe- cargo build --release --package zed --package cli --package auto_update_helper --target $target+ cargo --config .cargo/bundle-config.toml build --release --package zed --package cli --package auto_update_helper --target $targetCopy-Item -Path ".\$CargoOutDir\zed.exe" -Destination "$innoDir\Zed.exe" -ForceCopy-Item -Path ".\$CargoOutDir\cli.exe" -Destination "$innoDir\cli.exe" -ForceCopy-Item -Path ".\$CargoOutDir\auto_update_helper.exe" -Destination "$innoDir\auto_update_helper.exe" -Force# Build explorer_command_injector.dllswitch ($channel) {"stable" {- cargo build --release --features stable --no-default-features --package explorer_command_injector --target $target+ cargo --config .cargo/bundle-config.toml build --release --features stable --no-default-features --package explorer_command_injector --target $target}"preview" {- cargo build --release --features preview --no-default-features --package explorer_command_injector --target $target+ cargo --config .cargo/bundle-config.toml build --release --features preview --no-default-features --package explorer_command_injector --target $target}default {- cargo build --release --package explorer_command_injector --target $target+ cargo --config .cargo/bundle-config.toml build --release --package explorer_command_injector --target $target}}Copy-Item -Path ".\$CargoOutDir\explorer_command_injector.dll" -Destination "$innoDir\zed_explorer_command_injector.dll" -Force@@ -137,7 +137,7 @@ function BuildZedAndItsFriends {function BuildRemoteServer {Write-Output "Building remote_server for $target"- cargo build --release --package remote_server --target $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