-
-
Notifications
You must be signed in to change notification settings - Fork 664
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
Cannot successfully extract go_sdk because of unicode filename #2771
Comments
Appears due to #2729 -- trying a custom patch to see if that fixes it. |
Applying a partial revert to 0.25.0 using the following patch gets me past this error (I skipped adding the 'if tar.gz' stuff because I only ever use tar.gz).
|
Interestingly, this doesn't replicate on macos for me, somehow. |
Thanks for reporting. That code was meant to work around bazelbuild/bazel#7055, which has been fixed for a long time (in all supported versions of Bazel), so I didn't think it was necessary anymore. Perhaps it's a new regression in Bazel or something new in the Go archive. I'm not at all familiar with dazel. Can you reproduce this with Bazel on its own, either on macOS or within a Docker container? |
I cannot on macOS, retrying on my own in docker (I'll also try on a real machine). |
This replicates using the following Dockerfile in dazel only, not manually:
|
Any hints on stuff to look at to see what might be causing this in dazel? I assume maybe a locale flag or something? |
Sorry for slow response, still catching up after the holidays. So if this doesn't reproduce with standalone Bazel or Bazel in Docker, it sounds like it's either a bug in Dazel or perhaps the bug in Bazel was not completely fixed. Maybe report the issue upstream in one of those projects? I'm not at all familiar with Dazel, but if I had to guess, I'd look for something related to proxying the macOS file system, which is case-insensitive and does unicode normalization. |
I can replicate without docker (ubuntu20.04 with zfs) with bazel 3.7.2. The filesystem has the Upgrading to 0.25.1 yields:
tar xvf has no problem extracting the file though |
I'm also experiencing this issue with Bazel 4.0.0 and Docker using a zfs bind mount with |
Yep, I also have this issue with Bazel 4.0.0 and zfs with |
I created bazelbuild/bazel#12986 explaining the root cause. This may break rules_go on macOS at some point as well if it's not fixed upstream. |
@jayconrod would you consider restoring the previous workaround until bazelbuild/bazel#12986 is resolved? Looks like that's slated for maybe Q2 of this year but until then I'm not aware of a workaround on affected machines without changes to |
Mirroring above request, we're having some engineers hit this issue as well |
Agreed it makes sense to restore this workaround. This should be backported to release-0.24 and release-0.25. |
Use 'tar' installed on the system to extract .tar.gz archives instead of Bazel's download_and_extract. Go has at least one test with an invalid unicode file name, and on some configurations (macOS + Docker + some particular file system binding?), this causes an error. Fixes bazel-contrib#2771
Use 'tar' installed on the system to extract .tar.gz archives instead of Bazel's download_and_extract. Go has at least one test with an invalid unicode file name, and on some configurations (macOS + Docker + some particular file system binding?), this causes an error. Fixes bazel-contrib#2771
Use 'tar' installed on the system to extract .tar.gz archives instead of Bazel's download_and_extract. Go has at least one test with an invalid unicode file name, and on some configurations (macOS + Docker + some particular file system binding?), this causes an error. Fixes #2771
in the resent version of rules_go, the issue bazel-contrib/rules_go#2771 was fixed. It should address the bazel build issue on some Linux or MacOS (bazelbuild/bazel#12986) Signed-off-by: Ivan Zemlyanskiy <qtivan@gmail.com>
in the resent version of rules_go, the issue bazel-contrib/rules_go#2771 was fixed. It should address the bazel build issue on some Linux or MacOS (bazelbuild/bazel#12986) Signed-off-by: izemlyanskiy <izemlyanskiy@pulsepoint.com>
in the resent version of rules_go, the issue bazel-contrib/rules_go#2771 was fixed. It should address the bazel build issue on some Linux or MacOS (bazelbuild/bazel#12986) Signed-off-by: izemlyanskiy <izemlyanskiy@pulsepoint.com> Signed-off-by: Gokul Nair <gnair@twitter.com>
As we learned when attempting to use `rules_rust` in an airgapped environment (see lowRISC/rules_rust@3ea1eda), the `ctx.download` action does not seem to cache downloads in the repository cache. As such, files will not be available on airgapped system simply by prefetching/populating the repository cache. This patches `rules_go` to only download go toolchains with the `ctx.download_and_extract` action until Issue bazel-contrib#2771 (bazel-contrib#2771) is properly resolved. Signed-off-by: Timothy Trippel <ttrippel@google.com>
The Go distribution contains at least one test file with an invalid unicode name. Bazel cannot extract the distribution archive on some operating systems and file systems; Darwin with AFS at least is affected. For .tar.gz files, we workaround the failure in ctx.download_and_extract by using the native system tar. This PR applies a similar workaround for .zip files on non-Windows OSs. Windows itself is not affected (ctx.download_and_extract works), so the workaround is not applied there. This is only really needed when you have a Darwin host and a Windows executor (don't ask). For bazel-contrib#2771
The Go distribution contains at least one test file with an invalid unicode name. Bazel cannot extract the distribution archive on some operating systems and file systems; Darwin with AFS at least is affected. For .tar.gz files, we workaround the failure in ctx.download_and_extract by using the native system tar. This PR applies a similar workaround for .zip files on non-Windows OSs. Windows itself is not affected (ctx.download_and_extract works), so the workaround is not applied there. This is only really needed when you have a Darwin host and a Windows executor (don't ask). For bazel-contrib#2771
…Ss (#3563) * go_download_sdk: apply extraction workaround to zips on non-windows OSs The Go distribution contains at least one test file with an invalid unicode name. Bazel cannot extract the distribution archive on some operating systems and file systems; Darwin with AFS at least is affected. For .tar.gz files, we workaround the failure in ctx.download_and_extract by using the native system tar. This PR applies a similar workaround for .zip files on non-Windows OSs. Windows itself is not affected (ctx.download_and_extract works), so the workaround is not applied there. This is only really needed when you have a Darwin host and a Windows executor (don't ask). For #2771 * use rename_files; rewrite comment * version check
…Ss (bazel-contrib#3563) * go_download_sdk: apply extraction workaround to zips on non-windows OSs The Go distribution contains at least one test file with an invalid unicode name. Bazel cannot extract the distribution archive on some operating systems and file systems; Darwin with AFS at least is affected. For .tar.gz files, we workaround the failure in ctx.download_and_extract by using the native system tar. This PR applies a similar workaround for .zip files on non-Windows OSs. Windows itself is not affected (ctx.download_and_extract works), so the workaround is not applied there. This is only really needed when you have a Darwin host and a Windows executor (don't ask). For bazel-contrib#2771 * use rename_files; rewrite comment * version check
When creating a `PathFragment` from a ZIP or TAR entry file name, the raw bytes of the name are now wrapped into a Latin-1 encoded String, which is how Bazel internally represents file paths. Previously, ZIP entries as well as TAR entries with PAX headers would result in ordinary decoded Java strings, resulting in corrupted file names when passed to Bazel's file system operations. Fixes #12986 Fixes bazel-contrib/rules_go#2771 Closes #18448. PiperOrigin-RevId: 571857847 Change-Id: Ie578724e75ddbefbe05255601b0afab706835f89
When creating a `PathFragment` from a ZIP or TAR entry file name, the raw bytes of the name are now wrapped into a Latin-1 encoded String, which is how Bazel internally represents file paths. Previously, ZIP entries as well as TAR entries with PAX headers would result in ordinary decoded Java strings, resulting in corrupted file names when passed to Bazel's file system operations. Fixes bazelbuild#12986 Fixes bazel-contrib/rules_go#2771 Closes bazelbuild#18448. PiperOrigin-RevId: 571857847 Change-Id: Ie578724e75ddbefbe05255601b0afab706835f89
…mes (#19765) When creating a `PathFragment` from a ZIP or TAR entry file name, the raw bytes of the name are now wrapped into a Latin-1 encoded String, which is how Bazel internally represents file paths. Previously, ZIP entries as well as TAR entries with PAX headers would result in ordinary decoded Java strings, resulting in corrupted file names when passed to Bazel's file system operations. Fixes #12986 Fixes bazel-contrib/rules_go#2771 Closes #18448. PiperOrigin-RevId: 571857847 Change-Id: Ie578724e75ddbefbe05255601b0afab706835f89 Fixes #19671
What version of rules_go are you using?
0.25.0
What version of gazelle are you using?
0.22.2
What version of Bazel are you using?
3.7.1
Does this issue reproduce with the latest releases of all the above?
Yes
What operating system and processor architecture are you using?
docker container (via
dazel
) on macOS Big Sur (uname -a
==Linux 45ddc4b6c7ee 4.19.121-linuxkit #1 SMP Tue Dec 1 17:50:32 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
)Any other potentially useful information about your toolchain?
We use a custom c++ toolchain to build against musl, but that doesn't seem relevant to this issue. We're using go 1.15.6, using this
go_download_sdk
invocation:What did you do?
Ran
dazel test
on a go target in the repoWhat did you expect to see?
Some test output
What did you see instead?
The text was updated successfully, but these errors were encountered: