More fixes for zed nightly (#3370)

When running `script/bundle` with the new `-2` flag, we needed to adjust
the fat-binary creation step to look for the binary called `Zed2`.

We also fixed a source of intermittent build failures in `script/bundle`
due to running multiple `swift build` processes concurrently for the
`live_kit_client2` crate, building for the two architectures.

Release Notes:

NA
This commit is contained in:
Max Brunsfeld 2023-11-20 12:36:25 -08:00 committed by GitHub
commit 4f4ef4a357
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 23 additions and 12 deletions

6
Cargo.lock generated
View file

@ -1398,7 +1398,7 @@ dependencies = [
"smol", "smol",
"sum_tree", "sum_tree",
"tempfile", "tempfile",
"text", "text2",
"thiserror", "thiserror",
"time", "time",
"tiny_http", "tiny_http",
@ -1869,7 +1869,7 @@ dependencies = [
"editor2", "editor2",
"feature_flags2", "feature_flags2",
"futures 0.3.28", "futures 0.3.28",
"fuzzy", "fuzzy2",
"gpui2", "gpui2",
"language2", "language2",
"lazy_static", "lazy_static",
@ -6763,7 +6763,6 @@ dependencies = [
"anyhow", "anyhow",
"client2", "client2",
"collections", "collections",
"context_menu",
"db2", "db2",
"editor2", "editor2",
"futures 0.3.28", "futures 0.3.28",
@ -11634,7 +11633,6 @@ dependencies = [
"fs2", "fs2",
"fsevent", "fsevent",
"futures 0.3.28", "futures 0.3.28",
"fuzzy",
"go_to_line2", "go_to_line2",
"gpui2", "gpui2",
"ignore", "ignore",

View file

@ -18,7 +18,7 @@ db = { package = "db2", path = "../db2" }
gpui = { package = "gpui2", path = "../gpui2" } gpui = { package = "gpui2", path = "../gpui2" }
util = { path = "../util" } util = { path = "../util" }
rpc = { package = "rpc2", path = "../rpc2" } rpc = { package = "rpc2", path = "../rpc2" }
text = { path = "../text" } text = { package = "text2", path = "../text2" }
language = { package = "language2", path = "../language2" } language = { package = "language2", path = "../language2" }
settings = { package = "settings2", path = "../settings2" } settings = { package = "settings2", path = "../settings2" }
feature_flags = { package = "feature_flags2", path = "../feature_flags2" } feature_flags = { package = "feature_flags2", path = "../feature_flags2" }

View file

@ -33,7 +33,7 @@ collections = { path = "../collections" }
# drag_and_drop = { path = "../drag_and_drop" } # drag_and_drop = { path = "../drag_and_drop" }
editor = { package="editor2", path = "../editor2" } editor = { package="editor2", path = "../editor2" }
#feedback = { path = "../feedback" } #feedback = { path = "../feedback" }
fuzzy = { path = "../fuzzy" } fuzzy = { package = "fuzzy2", path = "../fuzzy2" }
gpui = { package = "gpui2", path = "../gpui2" } gpui = { package = "gpui2", path = "../gpui2" }
language = { package = "language2", path = "../language2" } language = { package = "language2", path = "../language2" }
menu = { package = "menu2", path = "../menu2" } menu = { package = "menu2", path = "../menu2" }

View file

@ -61,12 +61,14 @@ fn build_bridge(swift_target: &SwiftTarget) {
let swift_package_root = swift_package_root(); let swift_package_root = swift_package_root();
let swift_target_folder = swift_target_folder(); let swift_target_folder = swift_target_folder();
let swift_cache_folder = swift_cache_folder();
if !Command::new("swift") if !Command::new("swift")
.arg("build") .arg("build")
.arg("--disable-automatic-resolution") .arg("--disable-automatic-resolution")
.args(["--configuration", &env::var("PROFILE").unwrap()]) .args(["--configuration", &env::var("PROFILE").unwrap()])
.args(["--triple", &swift_target.target.triple]) .args(["--triple", &swift_target.target.triple])
.args(["--build-path".into(), swift_target_folder]) .args(["--build-path".into(), swift_target_folder])
.args(["--cache-path".into(), swift_cache_folder])
.current_dir(&swift_package_root) .current_dir(&swift_package_root)
.status() .status()
.unwrap() .unwrap()
@ -133,9 +135,17 @@ fn swift_package_root() -> PathBuf {
} }
fn swift_target_folder() -> PathBuf { fn swift_target_folder() -> PathBuf {
let target = env::var("TARGET").unwrap();
env::current_dir() env::current_dir()
.unwrap() .unwrap()
.join(format!("../../target/{SWIFT_PACKAGE_NAME}")) .join(format!("../../target/{target}/{SWIFT_PACKAGE_NAME}_target"))
}
fn swift_cache_folder() -> PathBuf {
let target = env::var("TARGET").unwrap();
env::current_dir()
.unwrap()
.join(format!("../../target/{target}/{SWIFT_PACKAGE_NAME}_cache"))
} }
fn copy_dir(source: &Path, destination: &Path) { fn copy_dir(source: &Path, destination: &Path) {

View file

@ -9,7 +9,6 @@ path = "src/project_panel.rs"
doctest = false doctest = false
[dependencies] [dependencies]
context_menu = { path = "../context_menu" }
collections = { path = "../collections" } collections = { path = "../collections" }
db = { path = "../db2", package = "db2" } db = { path = "../db2", package = "db2" }
editor = { path = "../editor2", package = "editor2" } editor = { path = "../editor2", package = "editor2" }

View file

@ -39,7 +39,6 @@ file_finder = { package="file_finder2", path = "../file_finder2" }
# search = { path = "../search" } # search = { path = "../search" }
fs = { package = "fs2", path = "../fs2" } fs = { package = "fs2", path = "../fs2" }
fsevent = { path = "../fsevent" } fsevent = { path = "../fsevent" }
fuzzy = { path = "../fuzzy" }
go_to_line = { package = "go_to_line2", path = "../go_to_line2" } go_to_line = { package = "go_to_line2", path = "../go_to_line2" }
gpui = { package = "gpui2", path = "../gpui2" } gpui = { package = "gpui2", path = "../gpui2" }
install_cli = { package = "install_cli2", path = "../install_cli2" } install_cli = { package = "install_cli2", path = "../install_cli2" }

View file

@ -1,5 +1,7 @@
#!/bin/bash #!/bin/bash
set -e
branch=$(git rev-parse --abbrev-ref HEAD) branch=$(git rev-parse --abbrev-ref HEAD)
if [ "$branch" != "main" ]; then if [ "$branch" != "main" ]; then
echo "You must be on main to run this script" echo "You must be on main to run this script"

View file

@ -10,6 +10,7 @@ local_only=false
overwrite_local_app=false overwrite_local_app=false
bundle_name="" bundle_name=""
zed_crate="zed" zed_crate="zed"
binary_name="Zed"
# This must match the team in the provsiioning profile. # This must match the team in the provsiioning profile.
APPLE_NOTORIZATION_TEAM="MQ55VZLNZQ" APPLE_NOTORIZATION_TEAM="MQ55VZLNZQ"
@ -38,7 +39,6 @@ do
export CARGO_INCREMENTAL=true export CARGO_INCREMENTAL=true
export CARGO_BUNDLE_SKIP_BUILD=true export CARGO_BUNDLE_SKIP_BUILD=true
build_flag=""; build_flag="";
local_arch=true
target_dir="debug" target_dir="debug"
;; ;;
l) l)
@ -50,7 +50,10 @@ do
target_dir="debug" target_dir="debug"
;; ;;
f) overwrite_local_app=true;; f) overwrite_local_app=true;;
2) zed_crate="zed2";; 2)
zed_crate="zed2"
binary_name="Zed2"
;;
h) h)
help_info help_info
exit 0 exit 0
@ -116,7 +119,7 @@ if [ "$local_arch" = false ]; then
echo "Creating fat binaries" echo "Creating fat binaries"
lipo \ lipo \
-create \ -create \
target/{x86_64-apple-darwin,aarch64-apple-darwin}/${target_dir}/Zed \ target/{x86_64-apple-darwin,aarch64-apple-darwin}/${target_dir}/${binary_name} \
-output \ -output \
"${app_path}/Contents/MacOS/${zed_crate}" "${app_path}/Contents/MacOS/${zed_crate}"
lipo \ lipo \