mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-07-13 19:29:53 +03:00
96 lines
3.6 KiB
Diff
96 lines
3.6 KiB
Diff
Patch-Source: https://github.com/zed-industries/zed/commit/27beb9e6974d544131a16f2cf38e9e1790dd6c6b (subset)
|
|
--
|
|
From 27beb9e6974d544131a16f2cf38e9e1790dd6c6b Mon Sep 17 00:00:00 2001
|
|
From: Conrad Irwin <conrad.irwin@gmail.com>
|
|
Date: Tue, 4 Jun 2024 16:31:01 -0600
|
|
Subject: [PATCH] Update linux binary expectations (#12622)
|
|
|
|
Fixes #12585
|
|
|
|
This changes the expectations for installed binaries on linux based on
|
|
work
|
|
that @jirutka has done for Alpine.
|
|
|
|
In particular, we now put the cli in place as `bin/zed` and the zed
|
|
binary as
|
|
`libexec/zed-editor`, and assume that packagers do the same.
|
|
|
|
cc @someone13574
|
|
|
|
Release notes:
|
|
|
|
- N/A
|
|
|
|
---------
|
|
|
|
Co-authored-by: Mikayla <mikayla@zed.dev>
|
|
|
|
diff --git a/crates/cli/src/main.rs b/crates/cli/src/main.rs
|
|
index ea61c135216..5ab9b2029b8 100644
|
|
--- a/crates/cli/src/main.rs
|
|
+++ b/crates/cli/src/main.rs
|
|
@@ -191,14 +191,15 @@ mod linux {
|
|
let cli = env::current_exe()?;
|
|
let dir = cli
|
|
.parent()
|
|
+ .and_then(Path::parent)
|
|
.ok_or_else(|| anyhow!("no parent path for cli"))?;
|
|
|
|
- match dir.join("zed").canonicalize() {
|
|
+ match dir.join("libexec").join("zed-editor").canonicalize() {
|
|
Ok(path) => Ok(path),
|
|
- // development builds have Zed capitalized
|
|
- Err(e) => match dir.join("Zed").canonicalize() {
|
|
- Ok(path) => Ok(path),
|
|
- Err(_) => Err(e),
|
|
+ // In development cli and zed are in the ./target/ directory together
|
|
+ Err(e) => match cli.parent().unwrap().join("zed").canonicalize() {
|
|
+ Ok(path) if path != cli => Ok(path),
|
|
+ _ => Err(e),
|
|
},
|
|
}
|
|
}?;
|
|
@@ -254,10 +255,8 @@ mod linux {
|
|
eprintln!("failed to setsid: {}", std::io::Error::last_os_error());
|
|
process::exit(1);
|
|
}
|
|
- if std::env::var("ZED_KEEP_FD").is_err() {
|
|
- if let Err(_) = fork::close_fd() {
|
|
- eprintln!("failed to close_fd: {}", std::io::Error::last_os_error());
|
|
- }
|
|
+ if let Err(_) = fork::close_fd() {
|
|
+ eprintln!("failed to close_fd: {}", std::io::Error::last_os_error());
|
|
}
|
|
let error =
|
|
exec::execvp(path.clone(), &[path.as_os_str(), &OsString::from(ipc_url)]);
|
|
@@ -333,7 +332,7 @@ mod flatpak {
|
|
|
|
if !is_app_location_set {
|
|
args.push("--zed".into());
|
|
- args.push(flatpak_dir.join("bin").join("zed-app").into());
|
|
+ args.push(flatpak_dir.join("libexec").join("zed-editor").into());
|
|
}
|
|
|
|
let error = exec::execvp("/usr/bin/flatpak-spawn", args);
|
|
@@ -347,7 +346,7 @@ mod flatpak {
|
|
&& env::var("FLATPAK_ID").map_or(false, |id| id.starts_with("dev.zed.Zed"))
|
|
{
|
|
if args.zed.is_none() {
|
|
- args.zed = Some("/app/bin/zed-app".into());
|
|
+ args.zed = Some("/app/libexec/zed-editor".into());
|
|
env::set_var("ZED_IS_FLATPAK_INSTALL", "1");
|
|
}
|
|
}
|
|
diff --git a/crates/zed/Cargo.toml b/crates/zed/Cargo.toml
|
|
index 2292f18eb0b..58892ca7573 100644
|
|
--- a/crates/zed/Cargo.toml
|
|
+++ b/crates/zed/Cargo.toml
|
|
@@ -11,7 +11,7 @@ authors = ["Zed Team <hi@zed.dev>"]
|
|
workspace = true
|
|
|
|
[[bin]]
|
|
-name = "Zed"
|
|
+name = "zed"
|
|
path = "src/main.rs"
|
|
|
|
[dependencies]
|