bazelbuild / bazel

a fast, scalable, multi-language and extensible build system
https://bazel.build
Apache License 2.0
23.05k stars 4.03k forks source link

How can i solve this probelm #18375

Closed xiaobai0102 closed 1 year ago

xiaobai0102 commented 1 year ago

Description of the bug:

Traceback (most recent call last): File "/home/whoami/.cache/bazel/_bazel_whoami/085bcd6af4a7f7f89d6a65e75a71d38f/sandbox/linux-sandbox/1609/execroot/org_onosproject_onos/bazel-out/k8-opt-exec-2B5CBBC6/bin/tools/build/bazel/onos_app_tools.runfiles/org_onosproject_onos/tools/build/bazel/onos_app_tools.py", line 241, in **values)) File "/home/whoami/.cache/bazel/_bazel_whoami/085bcd6af4a7f7f89d6a65e75a71d38f/sandbox/linux-sandbox/1609/execroot/org_onosproject_onos/bazel-out/k8-opt-exec-2B5CBBC6/bin/tools/build/bazel/onos_app_tools.runfiles/org_onosproject_onos/tools/build/bazel/onos_app_tools.py", line 154, in write file.write(msg) UnicodeEncodeError: 'ascii' codec can't encode characters in position 141-142: ordinal not in range(128)

Note: The failure of target //tools/build/bazel:onos_app_tools (with exit code 1) may have been caused by the fact that it is running under Python 3 instead of Python 2. Examine the error to determine if that appears to be the problem. Since this target is built in the host configuration, the only way to change its version is to set --host_force_python=PY2, which affects the entire build.

If this error started occurring in Bazel 0.27 and later, it may be because the Python toolchain now enforces that targets analyzed as PY2 and PY3 run under a Python 2 and Python 3 interpreter, respectively. See https://github.com/bazelbuild/bazel/issues/7899 for more information.

1683809064.817413779: src/main/tools/linux-sandbox-pid1.cc:498: wait returned pid=2, status=0x100 1683809064.817441501: src/main/tools/linux-sandbox-pid1.cc:516: child exited normally with code 1 1683809064.862657778: src/main/tools/linux-sandbox.cc:233: child exited normally with code 1 Target //:onos failed to build Use --verbose_failures to see the command lines of failed build steps. INFO: Elapsed time: 162.346s, Critical Path: 66.77s INFO: 219 processes: 3 internal, 213 linux-sandbox, 3 worker.

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

No response

Which operating system are you running Bazel on?

No response

What is the output of bazel info release?

No response

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?

No response

Wyverald commented 1 year ago

image