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

Some zip files can't be extracted #42

Closed
JCWasmx86 opened this issue Apr 2, 2023 · 2 comments
Closed

Some zip files can't be extracted #42

JCWasmx86 opened this issue Apr 2, 2023 · 2 comments

Comments

@JCWasmx86
Copy link

I tested it with the develop branch and the tag 4.8.5

> wget https://github.com/richgel999/miniz/releases/download/3.0.1/miniz-3.0.1.zip
> ./swcomp zip -e foo miniz-3.0.1.zip -v
d = directory, f = file, l = symbolic link
f: miniz.c
f: miniz.h
f: examples/example1.c
Error: The operation could not be completed. The file doesn’t exist.
> ls foo
miniz.c  miniz.h (There should be a directory examples)
> wget https://www.sqlite.org/2023/sqlite-amalgamation-3410200.zip
> ./swcomp zip -e foo sqlite-amalgamation-3410200.zip
... Successful ....
JCWasmx86 added a commit to JCWasmx86/mesonlsp that referenced this issue Apr 2, 2023
@tsolomko
Copy link
Owner

tsolomko commented Apr 5, 2023

Hi,

The cause of this issue is that the ZIP archive in your first example does not contain an entry for the "examples" directory, so it is not created when extracting an archive, and thus creating a file inside a non-existent directory fails.

This is not an issue with SWCompression itself, as it is not its goal to evaluate the contents of the archives it is processing apart from the general format correctness (and there is no provision in ZIP format specifications that requires the existence of directory entries).

It can be argued that swcomp should check for this situation and I am still deliberating if/how/when this issue should be fixed, but as a general reminder, swcomp is not intended for general use.

@JCWasmx86
Copy link
Author

Ah ok. I apologize for the disturbance. I will close the issue

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

No branches or pull requests

2 participants