languages: Fix digest check on downloaded artifact for clangd (#35870)
Closes 35864 Release Notes: - N/A
This commit is contained in:
parent
2526dcb5a5
commit
d5c4e4b7b2
1 changed files with 6 additions and 1 deletions
|
@ -75,6 +75,9 @@ impl super::LspAdapter for CLspAdapter {
|
||||||
&*version.downcast::<GitHubLspBinaryVersion>().unwrap();
|
&*version.downcast::<GitHubLspBinaryVersion>().unwrap();
|
||||||
let version_dir = container_dir.join(format!("clangd_{name}"));
|
let version_dir = container_dir.join(format!("clangd_{name}"));
|
||||||
let binary_path = version_dir.join("bin/clangd");
|
let binary_path = version_dir.join("bin/clangd");
|
||||||
|
let expected_digest = digest
|
||||||
|
.as_ref()
|
||||||
|
.and_then(|digest| digest.strip_prefix("sha256:"));
|
||||||
|
|
||||||
let binary = LanguageServerBinary {
|
let binary = LanguageServerBinary {
|
||||||
path: binary_path.clone(),
|
path: binary_path.clone(),
|
||||||
|
@ -99,7 +102,9 @@ impl super::LspAdapter for CLspAdapter {
|
||||||
log::warn!("Unable to run {binary_path:?} asset, redownloading: {err}",)
|
log::warn!("Unable to run {binary_path:?} asset, redownloading: {err}",)
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
if let (Some(actual_digest), Some(expected_digest)) = (&metadata.digest, digest) {
|
if let (Some(actual_digest), Some(expected_digest)) =
|
||||||
|
(&metadata.digest, expected_digest)
|
||||||
|
{
|
||||||
if actual_digest == expected_digest {
|
if actual_digest == expected_digest {
|
||||||
if validity_check().await.is_ok() {
|
if validity_check().await.is_ok() {
|
||||||
return Ok(binary);
|
return Ok(binary);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue