Fix unzipping clangd and codelldb on Windows (#31080)
Closes https://github.com/zed-industries/zed/pull/30454 Release Notes: - N/A
This commit is contained in:
parent
c8f56e38b1
commit
6e5996a815
19 changed files with 93 additions and 70 deletions
|
@ -30,6 +30,7 @@ language.workspace = true
|
|||
paths.workspace = true
|
||||
serde.workspace = true
|
||||
serde_json.workspace = true
|
||||
smol.workspace = true
|
||||
task.workspace = true
|
||||
util.workspace = true
|
||||
workspace-hack.workspace = true
|
||||
|
|
|
@ -136,6 +136,34 @@ impl DebugAdapter for CodeLldbDebugAdapter {
|
|||
};
|
||||
let adapter_dir = version_path.join("extension").join("adapter");
|
||||
let path = adapter_dir.join("codelldb").to_string_lossy().to_string();
|
||||
// todo("windows")
|
||||
#[cfg(not(windows))]
|
||||
{
|
||||
use smol::fs;
|
||||
|
||||
fs::set_permissions(
|
||||
&path,
|
||||
<fs::Permissions as fs::unix::PermissionsExt>::from_mode(0o755),
|
||||
)
|
||||
.await
|
||||
.with_context(|| format!("Settings executable permissions to {path:?}"))?;
|
||||
|
||||
let lldb_binaries_dir = version_path.join("extension").join("lldb").join("bin");
|
||||
let mut lldb_binaries =
|
||||
fs::read_dir(&lldb_binaries_dir).await.with_context(|| {
|
||||
format!("reading lldb binaries dir contents {lldb_binaries_dir:?}")
|
||||
})?;
|
||||
while let Some(binary) = lldb_binaries.next().await {
|
||||
let binary_entry = binary?;
|
||||
let path = binary_entry.path();
|
||||
fs::set_permissions(
|
||||
&path,
|
||||
<fs::Permissions as fs::unix::PermissionsExt>::from_mode(0o755),
|
||||
)
|
||||
.await
|
||||
.with_context(|| format!("Settings executable permissions to {path:?}"))?;
|
||||
}
|
||||
}
|
||||
self.path_to_codelldb.set(path.clone()).ok();
|
||||
command = Some(path);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue