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

Extracting file permission in zip fails in 0.1.1 #518

Closed
abergmeier opened this issue Oct 16, 2015 · 6 comments
Closed

Extracting file permission in zip fails in 0.1.1 #518

abergmeier opened this issue Oct 16, 2015 · 6 comments
Assignees

Comments

@abergmeier
Copy link
Contributor

In 0.1.1, when I try add zip files like:

new_http_archive(
  name = "glm",
  url = "https://github.com/g-truc/glm/releases/download/0.9.4.6/glm-0.9.4.6.zip",
)

I get errors for all tried zip files (all from github):

Unrecognized file mode for glm: 0x10

This worked fine in 0.1.

@kchodorow
Copy link
Contributor

Working on this, but even when the permissions issue is fixed, there are illegal (to Bazel) filenames in the zip (like ~$glm.docx). So, the permissions issue is fixable, but you'll still need #374.

@abergmeier
Copy link
Contributor Author

Ah interesting. Thanks for pointing that out. Will have to repackage at least glm then.

@kchodorow
Copy link
Contributor

So... I might have a hacky solution. It looks like ~$glm.docx is a backup file and thus has a different file permission than the other files in the .zip. I'd guess this is Windows letting you mark backup files as such. Anyway, it seems reasonable for Bazel to skip writing backup files when it's unzipping the zip (at least for now). And all of the legit files in the archive have Bazel-allowed names.

@abergmeier
Copy link
Contributor Author

Sounds great but would love to have to explicitly set a ignore_extract_error.

@kchodorow
Copy link
Contributor

#374 isn't a problem with extracting a file (it's a problem Bazel hits later on when it's trying to gather up a rule's inputs) and I don't think "ignore all possible errors during extraction" is a good option to add, since the error you ran into (for example) is a bug.

@kchodorow
Copy link
Contributor

As long as you don't depend on the weird-named file (e.g., glob("**/*")), this should work with glm.

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