-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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 build error “Invalid or incomplete multibyte or wide character” #16065
Comments
funny enough, I got exactly the same error if I run a docker build:
No remote cache is set, skipping setup remote cache.
ENVOY_SRCDIR=/source
ENVOY_BUILD_TARGET=//source/exe:envoy-static
ENVOY_BUILD_ARCH=x86_64
$TEST_TMPDIR defined: output root default is '/build/tmp' and max_idle_secs default is '15'.
Starting local Bazel server and connecting to it...
$TEST_TMPDIR defined: output root default is '/build/tmp' and max_idle_secs default is '15'.
HEAD is now at d135632 fix test timeout (#146)
$TEST_TMPDIR defined: output root default is '/build/tmp' and max_idle_secs default is '15'.
building using 8 CPUs
building for x86_64
clang toolchain with libc++ configured
bazel fastbuild build with tests...
Building...
Building...
$TEST_TMPDIR defined: output root default is '/build/tmp' and max_idle_secs default is '15'.
WARNING: The following configs were expanded more than once: [clang]. For repeatable flags, repeats are counted twice and may lead to unexpected behavior.
INFO: SHA256 (https://golang.org/dl/?mode=json&include=all) = 4bb9f5f7d71d826c10b10c65bcaf53847a038f646101c25de10e52d8ffae7a7e
INFO: Repository go_sdk instantiated at:
/source/WORKSPACE:21:25: in <toplevel>
/source/bazel/dependency_imports.bzl:19:27: in envoy_dependency_imports
/build/tmp/_bazel_envoybuild/b570b5ccd0454dc9af9f65ab1833764d/external/io_bazel_rules_go/go/private/sdk.bzl:417:28: in go_register_toolchains
/build/tmp/_bazel_envoybuild/b570b5ccd0454dc9af9f65ab1833764d/external/io_bazel_rules_go/go/private/sdk.bzl:129:21: in go_download_sdk
Repository rule _go_download_sdk defined at:
/build/tmp/_bazel_envoybuild/b570b5ccd0454dc9af9f65ab1833764d/external/io_bazel_rules_go/go/private/sdk.bzl:116:35: in <toplevel>
INFO: Repository 'go_sdk' used the following cache hits instead of downloading the corresponding file.
* Hash '9a58494e8da722c3aef248c9227b0e9c528c7318309827780f16220998180a0d' for https://dl.google.com/go/go1.15.5.linux-amd64.tar.gz
If the definition of 'go_sdk' was updated, verify that the hashes were also updated.
ERROR: An error occurred during the fetch of repository 'go_sdk':
Traceback (most recent call last):
File "/build/tmp/_bazel_envoybuild/b570b5ccd0454dc9af9f65ab1833764d/external/io_bazel_rules_go/go/private/sdk.bzl", line 100, column 16, in _go_download_sdk_impl
_remote_sdk(ctx, [url.format(filename) for url in ctx.attr.urls], ctx.attr.strip_prefix, sha256)
File "/build/tmp/_bazel_envoybuild/b570b5ccd0454dc9af9f65ab1833764d/external/io_bazel_rules_go/go/private/sdk.bzl", line 180, column 29, in _remote_sdk
ctx.download_and_extract(
Error in download_and_extract: java.io.IOException: Error extracting /build/tmp/_bazel_envoybuild/b570b5ccd0454dc9af9f65ab1833764d/external/go_sdk/temp17390252849696083198/go1.15.5.linux-amd64.tar.gz to /build/tmp/_bazel_envoybuild/b570b5ccd0454dc9af9f65ab1833764d/external/go_sdk/temp17390252849696083198: /build/tmp/_bazel_envoybuild/b570b5ccd0454dc9af9f65ab1833764d/external/go_sdk/test/fixedbugs/issue27836.dir/�foo.go (Invalid or incomplete multibyte or wide character)
Internal error thrown during build. Printing stack trace: java.lang.IllegalStateException: Unexpected analysis error: ConfiguredTargetKey{label=//source/exe:envoy-static, config=BuildConfigurationValue.Key[f08be14ff07ffec9774f8551b3b64a6a219b46534825436b5e722feba526aef6]} -> ErrorInfo{exception=Traceback (most recent call last):
File "/build/tmp/_bazel_envoybuild/b570b5ccd0454dc9af9f65ab1833764d/external/io_bazel_rules_go/go/private/sdk.bzl", line 100, column 16, in _go_download_sdk_impl
_remote_sdk(ctx, [url.format(filename) for url in ctx.attr.urls], ctx.attr.strip_prefix, sha256)
File "/build/tmp/_bazel_envoybuild/b570b5ccd0454dc9af9f65ab1833764d/external/io_bazel_rules_go/go/private/sdk.bzl", line 180, column 29, in _remote_sdk
ctx.download_and_extract(
Error in download_and_extract: java.io.IOException: Error extracting /build/tmp/_bazel_envoybuild/b570b5ccd0454dc9af9f65ab1833764d/external/go_sdk/temp17390252849696083198/go1.15.5.linux-amd64.tar.gz to /build/tmp/_bazel_envoybuild/b570b5ccd0454dc9af9f65ab1833764d/external/go_sdk/temp17390252849696083198: /build/tmp/_bazel_envoybuild/b570b5ccd0454dc9af9f65ab1833764d/external/go_sdk/test/fixedbugs/issue27836.dir/�foo.go (Invalid or incomplete multibyte or wide character), rootCauses=[REPOSITORY_DIRECTORY:@go_sdk], cycles=[], isCatastrophic=false, rootCauseOfException=REPOSITORY_DIRECTORY:@go_sdk, isDirectlyTransient=false, isTransitivelyTransient=true}, ([ConfiguredTargetKey{label=//source/exe:envoy-static, config=BuildConfigurationValue.Key[f08be14ff07ffec9774f8551b3b64a6a219b46534825436b5e722feba526aef6]}])
at com.google.devtools.build.lib.skyframe.SkyframeBuildView.assertValidAnalysisException(SkyframeBuildView.java:875)
at com.google.devtools.build.lib.skyframe.SkyframeBuildView.processErrors(SkyframeBuildView.java:651)
at com.google.devtools.build.lib.skyframe.SkyframeBuildView.configureTargets(SkyframeBuildView.java:471)
at com.google.devtools.build.lib.analysis.BuildView.update(BuildView.java:418)
at com.google.devtools.build.lib.buildtool.AnalysisPhaseRunner.runAnalysisPhase(AnalysisPhaseRunner.java:213)
at com.google.devtools.build.lib.buildtool.AnalysisPhaseRunner.execute(AnalysisPhaseRunner.java:128)
at com.google.devtools.build.lib.buildtool.BuildTool.buildTargets(BuildTool.java:168)
at com.google.devtools.build.lib.buildtool.BuildTool.processRequest(BuildTool.java:405)
at com.google.devtools.build.lib.runtime.commands.BuildCommand.exec(BuildCommand.java:97)
at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.execExclusively(BlazeCommandDispatcher.java:589)
at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.exec(BlazeCommandDispatcher.java:235)
at com.google.devtools.build.lib.server.GrpcServerImpl.executeCommand(GrpcServerImpl.java:546)
at com.google.devtools.build.lib.server.GrpcServerImpl.lambda$run$1(GrpcServerImpl.java:611)
at io.grpc.Context$1.run(Context.java:605)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
INFO: Elapsed time: 12.511s
INFO: 0 processes.
Internal error thrown during build. Printing stack trace: java.lang.IllegalStateException: Unexpected analysis error: ConfiguredTargetKey{label=//source/exe:envoy-static, config=BuildConfigurationValue.Key[f08be14ff07ffec9774f8551b3b64a6a219b46534825436b5e722feba526aef6]} -> ErrorInfo{exception=Traceback (most recent call last):
File "/build/tmp/_bazel_envoybuild/b570b5ccd0454dc9af9f65ab1833764d/external/io_bazel_rules_go/go/private/sdk.bzl", line 100, column 16, in _go_download_sdk_impl
_remote_sdk(ctx, [url.format(filename) for url in ctx.attr.urls], ctx.attr.strip_prefix, sha256)
File "/build/tmp/_bazel_envoybuild/b570b5ccd0454dc9af9f65ab1833764d/external/io_bazel_rules_go/go/private/sdk.bzl", line 180, column 29, in _remote_sdk
ctx.download_and_extract(
Error in download_and_extract: java.io.IOException: Error extracting /build/tmp/_bazel_envoybuild/b570b5ccd0454dc9af9f65ab1833764d/external/go_sdk/temp17390252849696083198/go1.15.5.linux-amd64.tar.gz to /build/tmp/_bazel_envoybuild/b570b5ccd0454dc9af9f65ab1833764d/external/go_sdk/temp17390252849696083198: /build/tmp/_bazel_envoybuild/b570b5ccd0454dc9af9f65ab1833764d/external/go_sdk/test/fixedbugs/issue27836.dir/�foo.go (Invalid or incomplete multibyte or wide character), rootCauses=[REPOSITORY_DIRECTORY:@go_sdk], cycles=[], isCatastrophic=false, rootCauseOfException=REPOSITORY_DIRECTORY:@go_sdk, isDirectlyTransient=false, isTransitivelyTransient=true}, ([ConfiguredTargetKey{label=//source/exe:envoy-static, config=BuildConfigurationValue.Key[f08be14ff07ffec9774f8551b3b64a6a219b46534825436b5e722feba526aef6]}])
at com.google.devtools.build.lib.skyframe.SkyframeBuildView.assertValidAnalysisException(SkyframeBuildView.java:875)
at com.google.devtools.build.lib.skyframe.SkyframeBuildView.processErrors(SkyframeBuildView.java:651)
at com.google.devtools.build.lib.skyframe.SkyframeBuildView.configureTargets(SkyframeBuildView.java:471)
at com.google.devtools.build.lib.analysis.BuildView.update(BuildView.java:418)
at com.google.devtools.build.lib.buildtool.AnalysisPhaseRunner.runAnalysisPhase(AnalysisPhaseRunner.java:213)
at com.google.devtools.build.lib.buildtool.AnalysisPhaseRunner.execute(AnalysisPhaseRunner.java:128)
at com.google.devtools.build.lib.buildtool.BuildTool.buildTargets(BuildTool.java:168)
at com.google.devtools.build.lib.buildtool.BuildTool.processRequest(BuildTool.java:405)
at com.google.devtools.build.lib.runtime.commands.BuildCommand.exec(BuildCommand.java:97)
at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.execExclusively(BlazeCommandDispatcher.java:589)
at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.exec(BlazeCommandDispatcher.java:235)
at com.google.devtools.build.lib.server.GrpcServerImpl.executeCommand(GrpcServerImpl.java:546)
at com.google.devtools.build.lib.server.GrpcServerImpl.lambda$run$1(GrpcServerImpl.java:611)
at io.grpc.Context$1.run(Context.java:605)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
java.lang.IllegalStateException: Unexpected analysis error: ConfiguredTargetKey{label=//source/exe:envoy-static, config=BuildConfigurationValue.Key[f08be14ff07ffec9774f8551b3b64a6a219b46534825436b5e722feba526aef6]} -> ErrorInfo{exception=Traceback (most recent call last):
File "/build/tmp/_bazel_envoybuild/b570b5ccd0454dc9af9f65ab1833764d/external/io_bazel_rules_go/go/private/sdk.bzl", line 100, column 16, in _go_download_sdk_impl
_remote_sdk(ctx, [url.format(filename) for url in ctx.attr.urls], ctx.attr.strip_prefix, sha256)
File "/build/tmp/_bazel_envoybuild/b570b5ccd0454dc9af9f65ab1833764d/external/io_bazel_rules_go/go/private/sdk.bzl", line 180, column 29, in _remote_sdk
ctx.download_and_extract(
Error in download_and_extract: java.io.IOException: Error extracting /build/tmp/_bazel_envoybuild/b570b5ccd0454dc9af9f65ab1833764d/external/go_sdk/temp17390252849696083198/go1.15.5.linux-amd64.tar.gz to /build/tmp/_bazel_envoybuild/b570b5ccd0454dc9af9f65ab1833764d/external/go_sdk/temp17390252849696083198: /build/tmp/_bazel_envoybuild/b570b5ccd0454dc9af9f65ab1833764d/external/go_sdk/test/fixedbugs/issue27836.dir/�foo.go (Invalid or incomplete multibyte or wide character), rootCauses=[REPOSITORY_DIRECTORY:@go_sdk], cycles=[], isCatastrophic=false, rootCauseOfException=REPOSITORY_DIRECTORY:@go_sdk, isDirectlyTransient=false, isTransitivelyTransient=true}, ([ConfiguredTargetKey{label=//source/exe:envoy-static, config=BuildConfigurationValue.Key[f08be14ff07ffec9774f8551b3b64a6a219b46534825436b5e722feba526aef6]}])
at com.google.devtools.build.lib.skyframe.SkyframeBuildView.assertValidAnalysisException(SkyframeBuildView.java:875)
at com.google.devtools.build.lib.skyframe.SkyframeBuildView.processErrors(SkyframeBuildView.java:651)
at com.google.devtools.build.lib.skyframe.SkyframeBuildView.configureTargets(SkyframeBuildView.java:471)
at com.google.devtools.build.lib.analysis.BuildView.update(BuildView.java:418)
at com.google.devtools.build.lib.buildtool.AnalysisPhaseRunner.runAnalysisPhase(AnalysisPhaseRunner.java:213)
at com.google.devtools.build.lib.buildtool.AnalysisPhaseRunner.execute(AnalysisPhaseRunner.java:128)
at com.google.devtools.build.lib.buildtool.BuildTool.buildTargets(BuildTool.java:168)
at com.google.devtools.build.lib.buildtool.BuildTool.processRequest(BuildTool.java:405)
at com.google.devtools.build.lib.runtime.commands.BuildCommand.exec(BuildCommand.java:97)
at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.execExclusively(BlazeCommandDispatcher.java:589)
at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.exec(BlazeCommandDispatcher.java:235)
at com.google.devtools.build.lib.server.GrpcServerImpl.executeCommand(GrpcServerImpl.java:546)
at com.google.devtools.build.lib.server.GrpcServerImpl.lambda$run$1(GrpcServerImpl.java:611)
at io.grpc.Context$1.run(Context.java:605)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Server terminated abruptly (error code: 14, error message: 'Socket closed', log file: '/build/tmp/_bazel_envoybuild/b570b5ccd0454dc9af9f65ab1833764d/server/jvm.out') please note |
Maybe try clearing the entire cache? |
no... I did that, and with docker, it should be a clear state "our the box" anyway, right? |
Can you read up and see if any of this helps? bazelbuild/bazel#12986 |
oh, my God, thank you, I'll take a look right away. |
@asraa Thanks once again, I thought I'm alone with such a problem.
but could you help me, please, with a workaround for this problem for the current Bazel version? |
Add a patch to rules_go bazel-contrib/rules_go#2771 like this one There are examples of patching deps in this repo. look for .patch files. |
I believe |
nice, feel free to try updating, and send a PR! |
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 <[email protected]>
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 <[email protected]>
I think we can close it. At least, it works for me after my PR merge. |
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 <[email protected]> Signed-off-by: Gokul Nair <[email protected]>
Title: Bazel build error “Invalid or incomplete multibyte or wide character”
Description:
I followed your instruction to set up my build environment. I use Linux Ubuntu 20.04
I installed Bazelisk as bazel and downloaded clang+llvm-11.1.0-x86_64-linux-gnu-ubuntu-16.04 as required. But at the build step I got an exception:
bazel build --config=libc++ //source/exe:envoy-static
the output is
I understand it's somehow related to encodings but I'm out of options what can I do here.
[optional Relevant Links:]
I've found a similar problem
https://www.gitmemory.com/issue/bazelbuild/rules_go/2771/755621824
I also made a question on stackoverflow https://stackoverflow.com/questions/67165482/bazel-error-during-envoyproxy-envoy-build-invalid-or-incomplete-multibyte-or-wi
thank you in advance.
The text was updated successfully, but these errors were encountered: