-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Bazel fails to unzip archives containing files with non-latin characters in their name #11670
Comments
Do you have a small github repo which contains a self contained repro? There could be any of several things going on. The mac difference might have to do with Macos's strange choice of how they encode file names. (Nice summary here: https://superuser.com/questions/999232/unicode-filenames-in-windows-vs-mac-os-x). |
Not a particularly small repro, but we just ran into this issue extracting a recent golang release: If the definition of 'golang_sdk_osx-x86_64' was updated, verify that the hashes were also updated.
ERROR: An error occurred during the fetch of repository 'golang_sdk_osx-x86_64':
Traceback (most recent call last):
File "/private/var/tmp/_bazel_snagaraj/bf4a8035aa09cf910ceaead73516862a/external/bazel_tools/tools/build_defs/repo/http.bzl", line 111, column 45, in _http_archive_impl
download_info = ctx.download_and_extract(
Error in download_and_extract: java.io.IOException: Error extracting /private/var/tmp/_bazel_snagaraj/bf4a8035aa09cf910ceaead73516862a/external/golang_sdk_osx-x86_64/temp17079543164555012796/go1.16.12.darwin-amd64.tar.gz to /private/var/tmp/_bazel_snagaraj/bf4a8035aa09cf910ceaead73516862a/external/golang_sdk_osx-x86_64/temp17079543164555012796: /private/var/tmp/_bazel_snagaraj/bf4a8035aa09cf910ceaead73516862a/external/golang_sdk_osx-x86_64/test/fixedbugs/issue27836.dir/?foo.go (Illegal byte sequence)
ERROR: Error fetching repository: Traceback (most recent call last):
File "/private/var/tmp/_bazel_snagaraj/bf4a8035aa09cf910ceaead73516862a/external/bazel_tools/tools/build_defs/repo/http.bzl", line 111, column 45, in _http_archive_impl
download_info = ctx.download_and_extract(
Error in download_and_extract: java.io.IOException: Error extracting /private/var/tmp/_bazel_snagaraj/bf4a8035aa09cf910ceaead73516862a/external/golang_sdk_osx-x86_64/temp17079543164555012796/go1.16.12.darwin-amd64.tar.gz to /private/var/tmp/_bazel_snagaraj/bf4a8035aa09cf910ceaead73516862a/external/golang_sdk_osx-x86_64/temp17079543164555012796: /private/var/tmp/_bazel_snagaraj/bf4a8035aa09cf910ceaead73516862a/external/golang_sdk_osx-x86_64/test/fixedbugs/issue27836.dir/?foo.go (Illegal byte sequence)
ERROR: /Users/snagaraj/dev/goslackgo/BUILD.bazel:8:7: //:go depends on @golang_sdk_osx-x86_64//:toolchain_info in repository @golang_sdk_osx-x86_64 which failed to fetch. no such package '@golang_sdk_osx-x86_64//': java.io.IOException: Error extracting /private/var/tmp/_bazel_snagaraj/bf4a8035aa09cf910ceaead73516862a/external/golang_sdk_osx-x86_64/temp17079543164555012796/go1.16.12.darwin-amd64.tar.gz to /private/var/tmp/_bazel_snagaraj/bf4a8035aa09cf910ceaead73516862a/external/golang_sdk_osx-x86_64/temp17079543164555012796: /private/var/tmp/_bazel_snagaraj/bf4a8035aa09cf910ceaead73516862a/external/golang_sdk_osx-x86_64/test/fixedbugs/issue27836.dir/?foo.go (Illegal byte sequence)``` |
Seems like this may be dupe of #12986 ? |
Indeed it is a dup. Closing |
Hello,
I'm porting our build over to Bazel and am running into a problem that only reproduces on mac. Namely, I created an http_archive repo rule points to a zip file that contains an é in a filename. This results in the following error:
The offending filename contains an e with an accent-aigu.
I did a little more investigation and found I can repro this problem by simply zipping an archive containing the one offending file and writing a repository_rule that simple tries to call extract on that file:
rules.bzl:
WORKSPACE:
I'm using bazel 3.3.0 and this doesn't repro on Windows or Linux, only mac.
As a workaround, I created a repoitory rule that downloads the zip file and calls the build-in unzip program to extract, then only specify filegroups that don't contain the offending files (I don't actually need them, but they're stopping the archive extraction).
The text was updated successfully, but these errors were encountered: