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

Error: file '@bazel_tools//tools/cpp:toolchain_utils.bzl' does not contain symbol 'use_cpp_toolchain' (did you mean 'find_cpp_toolchain'? #620

Closed
KaramBelmoujoud opened this issue Jun 22, 2022 · 4 comments · Fixed by #623
Assignees
Labels
host:windows Issue that occurs when host OS is Windows type:build/install Cannot build/install the plugin

Comments

@KaramBelmoujoud
Copy link

Plugin Version or Commit ID

v0.10.0

Unity Version

2021.2.0b9

Your Host OS

Windows 10 pro

Target Platform

UnityEditor, Windows Standalone

[Windows Only] Visual Studio C++ and Windows SDK Version

No response

[Linux Only] GCC/G++ and GLIBC Version

No response

[Android Only] Android Build Tools and NDK Version

No response

[iOS Only] XCode Version

No response

Command Sequences

python build.py build --desktop cpu --opencv=cmake -v

Log

python build.py build --desktop cpu --opencv=cmake -v
INFO (build.py): Building protobuf sources...
DEBUG (build.py): Running bazel --output_user_root C:/_bzl build -c opt --action_env PYTHON_BIN_PATH="C://Users//StyrO//AppData//Local//Programs//Python//Python39//python.exe" --action_env ProgramData --action_env PROCESSOR_ARCHITECTURE --action_env PROCESSOR_IDENTIFIER --action_env PROCESSOR_LEVEL --action_env PROCESSOR_REVISION //mediapipe_api:mediapipe_proto_srcs
Starting local Bazel server and connecting to it...
DEBUG: C:/_bzl/bvu2os57/external/org_tensorflow/third_party/repo.bzl:124:14:
Warning: skipping import of repository 'com_google_absl' because it already exists.
DEBUG: C:/_bzl/bvu2os57/external/org_tensorflow/third_party/repo.bzl:124:14:
Warning: skipping import of repository 'com_google_benchmark' because it already exists.
DEBUG: C:/_bzl/bvu2os57/external/org_tensorflow/third_party/repo.bzl:124:14:
Warning: skipping import of repository 'pybind11_bazel' because it already exists.
DEBUG: C:/_bzl/bvu2os57/external/org_tensorflow/third_party/repo.bzl:124:14:
Warning: skipping import of repository 'com_google_protobuf' because it already exists.
DEBUG: C:/_bzl/bvu2os57/external/org_tensorflow/third_party/repo.bzl:124:14:
Warning: skipping import of repository 'com_google_googletest' because it already exists.
DEBUG: C:/_bzl/bvu2os57/external/org_tensorflow/third_party/repo.bzl:124:14:
Warning: skipping import of repository 'com_github_gflags_gflags' because it already exists.
DEBUG: C:/_bzl/bvu2os57/external/org_tensorflow/third_party/repo.bzl:124:14:
Warning: skipping import of repository 'rules_python' because it already exists.
DEBUG: C:/_bzl/bvu2os57/external/org_tensorflow/third_party/repo.bzl:124:14:
Warning: skipping import of repository 'build_bazel_rules_apple' because it already exists.
DEBUG: C:/_bzl/bvu2os57/external/org_tensorflow/third_party/repo.bzl:124:14:
Warning: skipping import of repository 'build_bazel_rules_swift' because it already exists.
DEBUG: C:/_bzl/bvu2os57/external/org_tensorflow/third_party/repo.bzl:124:14:
Warning: skipping import of repository 'build_bazel_apple_support' because it already exists.
DEBUG: C:/_bzl/bvu2os57/external/org_tensorflow/third_party/repo.bzl:124:14:
Warning: skipping import of repository 'xctestrunner' because it already exists.
DEBUG: C:/_bzl/bvu2os57/external/org_tensorflow/third_party/repo.bzl:124:14:
Warning: skipping import of repository 'pybind11' because it already exists.
INFO: SHA256 (https://github.com/bazelbuild/rules_cc/archive/main.zip) = 73106859751c2bc314861adc136d5cbecee3f7ae7d05539dc8235efbf4efdcbe
DEBUG: Rule 'rules_cc' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = "73106859751c2bc314861adc136d5cbecee3f7ae7d05539dc8235efbf4efdcbe"
DEBUG: Repository rules_cc instantiated at:
C:/users/styro/onedrive/desktop/projet/new/mediapipeunityplugin/WORKSPACE:90:13: in
Repository rule http_archive defined at:
C:/_bzl/bvu2os57/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in
ERROR: Traceback (most recent call last):
File "C:/_bzl/bvu2os57/external/rules_cc/cc/private/rules_impl/cc_flags_supplier.bzl", line 16, column 76, in
load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain", "use_cpp_toolchain")
Error: file '@bazel_tools//tools/cpp:toolchain_utils.bzl' does not contain symbol 'use_cpp_toolchain' (did you mean 'find_cpp_toolchain'?)
ERROR: While resolving toolchains for target @rules_pkg//pkg/private/zip:build_zip: com.google.devtools.build.lib.packages.BuildFileContainsErrorsException: error loading package '@bazel_tools//tools/cpp': in C:/_bzl/bvu2os57/external/rules_cc/cc/defs.bzl: Extension file 'cc/private/rules_impl/cc_flags_supplier.bzl' has errors
ERROR: Analysis of target '//mediapipe_api:mediapipe_proto_srcs' failed; build aborted: com.google.devtools.build.lib.packages.BuildFileContainsErrorsException: error loading package '@bazel_tools//tools/cpp': in C:/_bzl/bvu2os57/external/rules_cc/cc/defs.bzl: Extension file 'cc/private/rules_impl/cc_flags_supplier.bzl' has errors
INFO: Elapsed time: 231.503s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (31 packages loaded, 12 targets configured)
currently loading: @com_google_mediapipe//mediapipe/framework ... (20 packages)
Fetching @com_google_protobuf; fetching
Fetching ...otobuf; Extracting C:/_bzl/bvu2os57/external/com_google_protobuf/temp11821339174834429399/v3.19.1.tar.
gz
Traceback (most recent call last):
File "C:\Users\StyrO\OneDrive\Desktop\Projet\New\MediaPipeUnityPlugin\build.py", line 459, in
Argument().command().run()
File "C:\Users\StyrO\OneDrive\Desktop\Projet\New\MediaPipeUnityPlugin\build.py", line 109, in run
self._run_command(self._build_proto_srcs_commands())
File "C:\Users\StyrO\OneDrive\Desktop\Projet\New\MediaPipeUnityPlugin\build.py", line 54, in _run_command
return subprocess.run(' '.join(command_list), check=True, shell=shell)
File "C:\Users\StyrO\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 528, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command 'bazel --output_user_root C:/_bzl build -c opt --action_env PYTHON_BIN_PATH="C://Users//StyrO//AppData//Local//Programs//Python//Python39//python.exe" --action_env ProgramData --action_env PROCESSOR_ARCHITECTURE --action_env PROCESSOR_IDENTIFIER --action_env PROCESSOR_LEVEL --action_env PROCESSOR_REVISION //mediapipe_api:mediapipe_proto_srcs' returned non-zero exit status 1.

Additional Context

i've been trying for the past week trying to put every possible way to build it without issues but every time i get the same log.

@KaramBelmoujoud KaramBelmoujoud added the type:build/install Cannot build/install the plugin label Jun 22, 2022
@homuler homuler changed the title Building issues Error: file '@bazel_tools//tools/cpp:toolchain_utils.bzl' does not contain symbol 'use_cpp_toolchain' (did you mean 'find_cpp_toolchain'? Jun 23, 2022
@homuler homuler added the host:windows Issue that occurs when host OS is Windows label Jun 23, 2022
@homuler
Copy link
Owner

homuler commented Jun 23, 2022

[Windows Only] Visual Studio C++ and Windows SDK Version

Fill this field.

https://github.com/homuler/MediaPipeUnityPlugin/wiki/Installation-Guide#windows-10

  1. Install Bazelisk and add the location of the executable to %PATH% environment variable.

I think the cause is that you didn't install Bazelisk but Bazel (maybe 4.2.1).
However, your OS is Windows 10 Pro, so you should use Docker to build.

If you use Window 10 Pro, go to Docker Windows Container. Otherwise, go to Docker Linux Container.

@homuler
Copy link
Owner

homuler commented Jun 23, 2022

Sorry, I confirmed that this error can be reproduced when trying to build without cache.

@KaramBelmoujoud
Copy link
Author

i tried installing using Docker but the build keeps getting stuck in installing p7zip
Screenshot 2022-06-24 105235

@homuler
Copy link
Owner

homuler commented Jun 24, 2022

See https://github.com/homuler/MediaPipeUnityPlugin/wiki/Installation-Guide#docker-windows-container.

This process will hang when MSYS2 is being installed.
If this issue occurs, remove C:\ProgramData\Docker\tmp\hcs*\Files$Recycle.Bin\ manually (hcs* is random name).
cf. docker/for-win#8910

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
host:windows Issue that occurs when host OS is Windows type:build/install Cannot build/install the plugin
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants