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 download_and_extract do not allow with non-ASCII characters in file names #18254

Closed
mikhail-g opened this issue Apr 28, 2023 · 2 comments
Labels
help wanted Someone outside the Bazel team could own this P2 We'll consider working on this in future. (Assignee optional) team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. type: bug

Comments

@mikhail-g
Copy link

Description of the bug:

Function download_and_extract from rule http_archive Failed to extract an archive with a file containing a non-ASCII character in its name Āfoo.go

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

Example BUILD.bazel:

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

http_archive(
    name = "go_1_16",
    urls = ["https://dl.google.com/go/go1.16.7.linux-amd64.tar.gz"]
    sha256 = "7fe7a73f55ba3e2285da36f8b085e5c0159e9564ef5f63ee0ed6b818ade8ef04",
    build_file = "//build_tools/go:BUILD.go-dist",
)

Which operating system are you running Bazel on?

MacOS Monterey

What is the output of bazel info release?

release 4.2.2

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

No response

What's the output of git remote get-url origin; git rev-parse master; git rev-parse HEAD ?

No response

Have you found anything relevant by searching the web?

No response

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

Stacktrace:

Repository rule http_archive defined at:
repo/http.bzl:336:31: in <toplevel>
ERROR: An error occurred during the fetch of repository 'go_1_16':
   Traceback (most recent call last):
	File ".../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 .../go_1_16/temp3086185247349608877/go1.16.7.linux-amd64.tar.gz to .../go_1_16/temp3086185247349608877: .../go_1_16/go/test/fixedbugs/issue27836.dir/?foo.go (Illegal byte sequence)
@Pavank1992 Pavank1992 added the team-Rules-API API for writing rules/aspects: providers, runfiles, actions, artifacts label Apr 28, 2023
@Wyverald Wyverald added team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. and removed team-Rules-API API for writing rules/aspects: providers, runfiles, actions, artifacts labels May 2, 2023
@meteorcloudy meteorcloudy added P2 We'll consider working on this in future. (Assignee optional) help wanted Someone outside the Bazel team could own this and removed untriaged labels May 2, 2023
@meteorcloudy
Copy link
Member

Thanks for reporting! Is this still an issue in the latest release of Bazel? A PR for fixing this is welcome!

@fmeum
Copy link
Collaborator

fmeum commented Oct 28, 2024

This has been fixed by 10169bb, which made it into Bazel 7 and 6.4.0.

@fmeum fmeum closed this as completed Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Someone outside the Bazel team could own this P2 We'll consider working on this in future. (Assignee optional) team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants