Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

windows: Fix rust-analyzer download #20408

Merged
merged 4 commits into from
Nov 12, 2024

Conversation

ArthurBrussee
Copy link
Contributor

@ArthurBrussee ArthurBrussee commented Nov 8, 2024

After rust-lang/rust-analyzer#18412, there is no longer a .gz file for windows rust-analyzer targets, and the rust analyzer LSP fails to download. This fixes it by using the .zip version on windows.

The .zip also extracts to a folder containing rust-analyzer.exe rather than just a file. I've handled it in this code, but am not 100% sure if other parts of the code need too be aware of it.

Release Notes:

  • N/A

Copy link

cla-bot bot commented Nov 8, 2024

We require contributors to sign our Contributor License Agreement, and we don't have @ArthurBrussee on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@ArthurBrussee
Copy link
Contributor Author

@cla-bot check

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Nov 8, 2024
Copy link

cla-bot bot commented Nov 8, 2024

The cla-bot has been summoned, and re-checked this pull request!

@maxdeviant maxdeviant changed the title [Windows] Fix RA LSP download windows: Fix rust-analyzer download Nov 8, 2024
Copy link
Contributor

@SomeoneToIgnore SomeoneToIgnore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for spotting.
Let's make it closer to fetch_server_binary in typescript.rs, so no manual fiddling with OS name, extensions and zip files is done.

crates/languages/src/rust.rs Outdated Show resolved Hide resolved
@SomeoneToIgnore SomeoneToIgnore self-assigned this Nov 11, 2024
Copy link
Contributor

@SomeoneToIgnore SomeoneToIgnore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much better, no manual string concatenations and zip extractions, thank you.

@SomeoneToIgnore SomeoneToIgnore merged commit 181c372 into zed-industries:main Nov 12, 2024
12 checks passed
match Self::GITHUB_ASSET_KIND {
AssetKind::TarGz => {
let decompressed_bytes = GzipDecoder::new(BufReader::new(response.body_mut()));
let archive = async_tar::Archive::new(decompressed_bytes);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idk how I've missed this, but TarGz != Gz (our case as noted just above).

#20718

SomeoneToIgnore added a commit that referenced this pull request Nov 15, 2024
Follow-up of #20408

Release Notes:

- (Preview) Fixed broken rust-analyzer downloads
SomeoneToIgnore added a commit that referenced this pull request Nov 15, 2024
Follow-up of #20408

Release Notes:

- (Preview) Fixed broken rust-analyzer downloads
@zmb3 zmb3 mentioned this pull request Nov 19, 2024
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants