WIP: avoid code-signing rust-analyzer to prevent proc macro errors

If this works, I think we should set the permissions asynchronously,
maybe as part of starting the language server, so that we avoid doing
synchronous I/O.
This commit is contained in:
Antonio Scandurra 2022-02-20 12:14:43 +01:00
parent 794fcba842
commit fc3bccc1a1
2 changed files with 10 additions and 3 deletions

View file

@ -260,8 +260,15 @@ impl Language {
const ZED_BUNDLE: Option<&'static str> = option_env!("ZED_BUNDLE");
let binary_path = if ZED_BUNDLE.map_or(Ok(false), |b| b.parse())? {
cx.platform()
.path_for_resource(Some(&config.binary), None)?
let bundled_path = cx
.platform()
.path_for_resource(Some(&config.binary), None)?;
std::fs::set_permissions(
&bundled_path,
<std::fs::Permissions as std::os::unix::fs::PermissionsExt>::from_mode(0o755),
)
.unwrap();
bundled_path
} else {
Path::new(&config.binary).to_path_buf()
};