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

http_archive, unrecognized file mode for [Content_Types].xml: 0x80 #9236

Closed
tomaszstrejczek opened this issue Aug 23, 2019 · 6 comments
Closed
Labels
area-Windows Windows-specific issues and feature requests P3 We're not considering working on this, but happy to review a PR. (No assignee) team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. type: bug

Comments

@tomaszstrejczek
Copy link
Contributor

Description of the problem / feature request:

http_archive fails with the exception: java.io.IOException: Error extracting '2.2.0.zip': Unrecognized file mode for [Content_Types].xml: 0x80.
The same file is handled without any problems by common zip programs (winrar on Windows, unzip on Ubuntu).

Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

WORKSPACE:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "failed",
urls = ["https://www.nuget.org/api/v2/package/Remotion.Linq/2.2.0"],
type = "zip",
)
BUILD:
genrule(
name = "foo",
srcs = ["@failed//:failed"],
outs = ["foo.h"],
cmd = "echo dummy",
)

What operating system are you running Bazel on?

Windows 10, Ubuntu

What's the output of bazel info release?

release 0.28.0 (Windows), release 0.28.1 (ubuntu)

Have you found anything relevant by searching the web?

The problem is specific to a single file. However the file is a popular nuget package (Remotion.Linq)

Any other information, logs, or outputs that you want to share?

INFO: SHA256 (https://www.nuget.org/api/v2/package/Remotion.Linq/2.2.0) = ae93e9db1c878f626c4f2ea4dc5021963be5f393cd6b747d8eb572dd41b486f8
INFO: Call stack for the definition of repository 'failed' which is a http_archive (rule definition at /home/tomek/.cache/bazel/_bazel_tomek/c1626520042faac25914faf60d5e12fe/external/bazel_tools/tools/build_defs/repo/http.bzl:237:16):

  • /mnt/c/temp/repro/WORKSPACE:3:1
    ERROR: An error occurred during the fetch of repository 'failed':
    java.io.IOException: Error extracting /home/tomek/.cache/bazel/_bazel_tomek/c1626520042faac25914faf60d5e12fe/external/failed/2.2.0.zip to /home/tomek/.cache/bazel/_bazel_tomek/c1626520042faac25914faf60d5e12fe/external/failed: Unrecognized file mode for [Content_Types].xml: 0x80
@RNabel
Copy link
Contributor

RNabel commented Sep 11, 2019

Just ran into this, too. Windows 10, Bazel 0.23.1.

@pradeep1024
Copy link

I'm facing the same issue in Bazel 2.0.0.
Can one of you please confirm if this is fixed already ?
It would be great if anyone can suggest some workaround.

@plule-ansys
Copy link

Hello, this issue is still in Bazel 3.2.0. A possible workaround is to use https://github.com/zaucy/rules_7zip instead of the native methods.

@tomaszstrejczek let me know if you would be interested in a PR in rules_dotnet doing that, it's a bit intrusive as it includes a new third party, but gets the job done. Also it will not work for OSX.

@philwo philwo added the team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website label Jun 15, 2020
@philwo philwo added area-Windows Windows-specific issues and feature requests P3 We're not considering working on this, but happy to review a PR. (No assignee) type: bug and removed untriaged labels Feb 8, 2021
@philwo philwo removed the team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website label Nov 29, 2021
Juh-Roch pushed a commit to Juh-Roch/bazel that referenced this issue Jul 18, 2022
Fixes bazelbuild#9236. On a rare occasion a zip file contains files with the 0x80 attribute.

From https://docs.microsoft.com/en-us/windows/win32/fileio/file-attribute-constants
A file that does not have other attributes set. This attribute is valid only when used alone.

Closes bazelbuild#15260.

PiperOrigin-RevId: 442825326
(cherry picked from commit aa2a1f3)
@limdor
Copy link
Contributor

limdor commented Jul 19, 2022

@bazel-io flag

@bazel-io bazel-io added the potential release blocker Flagged by community members using "@bazel-io flag". Should be added to a release blocker milestone label Jul 19, 2022
ckolli5 added a commit that referenced this issue Jul 19, 2022
Fixes #9236. On a rare occasion a zip file contains files with the 0x80 attribute.

From https://docs.microsoft.com/en-us/windows/win32/fileio/file-attribute-constants
A file that does not have other attributes set. This attribute is valid only when used alone.

Closes #15260.

PiperOrigin-RevId: 442825326
(cherry picked from commit aa2a1f3)

Co-authored-by: Tom de Goede <[email protected]>
Co-authored-by: Chenchu K <[email protected]>
@ShreeM01
Copy link
Contributor

@bazel-io fork 5.3.0

1 similar comment
@ckolli5
Copy link

ckolli5 commented Jul 20, 2022

@bazel-io fork 5.3.0

@bazel-io bazel-io removed the potential release blocker Flagged by community members using "@bazel-io flag". Should be added to a release blocker milestone label Jul 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Windows Windows-specific issues and feature requests P3 We're not considering working on this, but happy to review a PR. (No assignee) team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants