Skip to content

refactor: simplify buffer reader usage and enhance zip extraction logic #1791

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zelosleone
Copy link
Collaborator

@zelosleone zelosleone commented Jul 22, 2025

this will solve the zed stock problem @baszalmstra is facing the recipe i used with test is the same one https://github.com/baszalmstra/zed-feedstock/blob/be25438c26f8f44a70566f6ea992367c04c55580/recipe/recipe.yaml

the problem seems to be the zip crate's bug itself, which fails to extract certain zip files on windows and sometimes even fails to extract them correctly https://github.com/zip-rs/zip2/issues?q=is%3Aissue%20state%3Aopen%20windows (seems like a recent issue but no comments so far on any of the bugs, which i think pretty critical) so instead with the same logic we are extracting them manually and it works correctly now

@zelosleone zelosleone requested review from wolfv and baszalmstra July 22, 2025 15:59
let mut file = archive
.by_index(i)
.map_err(|e| SourceError::ZipExtractionError(e.to_string()))?;
let outpath = tmp_extraction_dir.path().join(file.mangled_name());
Copy link
Member

Choose a reason for hiding this comment

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

what is the mangled_name?

Copy link
Collaborator Author

@zelosleone zelosleone Jul 22, 2025

Choose a reason for hiding this comment

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

https://docs.rs/zip/latest/zip/read/struct.ZipFile.html#method.mangled_name basically what we are doing is using zip crate's mangled_name to manually extract correcly the paths into files + folders with sanitized file names

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants