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

Unable to compile/build TCMalloc on WSL2/Ubuntu 22.04 with Bazel 7.0.0-pre.20221102.3 #149

Open
semihc opened this issue Nov 16, 2022 · 2 comments

Comments

@semihc
Copy link

semihc commented Nov 16, 2022

I am unable to compile TCMalloc on WSL2 running Ubuntu 22.04. Using very recent version of Bazel 7.0.0-pre.20221102.3. Details are given below.

Thanks. Semih

semihc@PC29238:/opt/TC/ext$ git clone [email protected]:google/tcmalloc.git
Cloning into 'tcmalloc'...
remote: Enumerating objects: 8091, done.
remote: Counting objects: 100% (204/204), done.
remote: Compressing objects: 100% (91/91), done.
remote: Total 8091 (delta 112), reused 164 (delta 109), pack-reused 7887
Receiving objects: 100% (8091/8091), 3.92 MiB | 2.43 MiB/s, done.
Resolving deltas: 100% (6384/6384), done.
semihc@PC29238:/opt/TC/ext$ cd tcmalloc/
semihc@PC29238:/opt/TC/ext/tcmalloc$ git pull
Already up to date.
semihc@PC29238:/opt/TC/ext/tcmalloc$ bazel test //tcmalloc/...
Starting local Bazel server and connecting to it...
DEBUG: /home/semihc/.cache/bazel/_bazel_semihc/6b6ec2ae9dccae02807306c3dc2aadde/external/rules_python/python/repositories.bzl:32:10: py_repositories is a no-op and is deprecated. You can remove this from your WORKSPACE file
ERROR: /home/semihc/.cache/bazel/_bazel_semihc/6b6ec2ae9dccae02807306c3dc2aadde/external/bazel_tools/platforms/BUILD:89:6: in alias rule @bazel_tools//platforms:windows: Constraints from @bazel_tools//platforms have been removed. Please use constraints from @platforms repository embedded in Bazel, or preferably declare dependency on https://github.com/bazelbuild/platforms. See bazelbuild/bazel#8622 for details.
ERROR: /home/semihc/.cache/bazel/_bazel_semihc/6b6ec2ae9dccae02807306c3dc2aadde/external/bazel_tools/platforms/BUILD:89:6: Analysis of target '@bazel_tools//platforms:windows' failed
INFO: Repository pypi__click instantiated at:
/opt/TC/ext/tcmalloc/WORKSPACE:102:19: in
/home/semihc/.cache/bazel/_bazel_semihc/6b6ec2ae9dccae02807306c3dc2aadde/external/rules_fuzzing/fuzzing/init.bzl:23:16: in rules_fuzzing_init
/home/semihc/.cache/bazel/_bazel_semihc/6b6ec2ae9dccae02807306c3dc2aadde/external/rules_python/python/pip.bzl:96:29: in pip_install
/home/semihc/.cache/bazel/_bazel_semihc/6b6ec2ae9dccae02807306c3dc2aadde/external/rules_python/python/pip_install/repositories.bzl:122:14: in pip_install_dependencies
/home/semihc/.cache/bazel/_bazel_semihc/6b6ec2ae9dccae02807306c3dc2aadde/external/bazel_tools/tools/build_defs/repo/utils.bzl:233:18: in maybe
Repository rule http_archive defined at:
/home/semihc/.cache/bazel/_bazel_semihc/6b6ec2ae9dccae02807306c3dc2aadde/external/bazel_tools/tools/build_defs/repo/http.bzl:372:31: in
INFO: repository @pypi__click' used the following cache hits instead of downloading the corresponding file.

  • Hash 'fba402a4a47334742d782209a7c79bc448911afe1149d07bdabdf480b3e2f4b6' for https://files.pythonhosted.org/packages/76/0a/b6c5f311e32aeb3b406e03c079ade51e905ea630fc19d1262a46249c1c86/click-8.0.1-py3-none-any.whl
    If the definition of 'repository @pypi__click' was updated, verify that the hashes were also updated.
    INFO: Repository remote_coverage_tools instantiated at:
    /DEFAULT.WORKSPACE.SUFFIX:4:6: in
    /home/semihc/.cache/bazel/_bazel_semihc/6b6ec2ae9dccae02807306c3dc2aadde/external/bazel_tools/tools/build_defs/repo/utils.bzl:233:18: in maybe
    Repository rule http_archive defined at:
    /home/semihc/.cache/bazel/_bazel_semihc/6b6ec2ae9dccae02807306c3dc2aadde/external/bazel_tools/tools/build_defs/repo/http.bzl:372:31: in
    ERROR: /opt/TC/ext/tcmalloc/tcmalloc/internal/BUILD:43:8: While resolving toolchains for target //tcmalloc/internal:affinity_test: invalid registered toolchain '@bazel_skylib//toolchains/unittest:cmd_toolchain':
    ERROR: Analysis of target '//tcmalloc/internal:affinity_test' failed; build aborted:
    INFO: Elapsed time: 2.694s
    INFO: 0 processes.
    FAILED: Build did NOT complete successfully (42 packages loaded, 352 targets configured)
    currently loading: @rules_fuzzing//fuzzing/tools ... (2 packages)
    Fetching repository @fuzzing_py_deps; Restarting.
    Fetching repository @rules_pkg; starting
    Fetching ...l/_bazel_semihc/6b6ec2ae9dccae02807306c3dc2aadde/external/rules_pkg; Extracting rules_pkg-0.5.1.tar.gz
    Fetching ...ihc/6b6ec2ae9dccae02807306c3dc2aadde/external/pypi__click; Extracting click-8.0.1-py3-none-any.whl.zip
    Fetching https://mirror.bazel.build/bazel_coverage_output_generator/releases/coverage_output_generator-v2.6.zip
    ERROR: Couldn't start the build. Unable to run tests
    semihc@PC29238:/opt/TC/ext/tcmalloc$ date
    Wed Nov 16 15:49:32 AEDT 2022
    semihc@PC29238:/opt/TC/ext/tcmalloc$

semihc@PC29238:/opt/TC/ext/tcmalloc$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.1 LTS
Release: 22.04
Codename: jammy
semihc@PC29238:/opt/TC/ext/tcmalloc$ bazel version
Build label: 7.0.0-pre.20221102.3
Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Fri Nov 11 18:06:13 2022 (1668189973)
Build timestamp: 1668189973
Build timestamp as int: 1668189973
semihc@PC29238:/opt/TC/ext/tcmalloc$ bazel info
DEBUG: /home/semihc/.cache/bazel/_bazel_semihc/6b6ec2ae9dccae02807306c3dc2aadde/external/rules_python/python/repositories.bzl:32:10: py_repositories is a no-op and is deprecated. You can remove this from your WORKSPACE file
bazel-bin: /home/semihc/.cache/bazel/_bazel_semihc/6b6ec2ae9dccae02807306c3dc2aadde/execroot/com_google_tcmalloc/bazel-out/k8-fastbuild/bin
bazel-genfiles: /home/semihc/.cache/bazel/_bazel_semihc/6b6ec2ae9dccae02807306c3dc2aadde/execroot/com_google_tcmalloc/bazel-out/k8-fastbuild/bin
bazel-testlogs: /home/semihc/.cache/bazel/_bazel_semihc/6b6ec2ae9dccae02807306c3dc2aadde/execroot/com_google_tcmalloc/bazel-out/k8-fastbuild/testlogs
character-encoding: file.encoding = ISO-8859-1, defaultCharset = ISO-8859-1
command_log: /home/semihc/.cache/bazel/_bazel_semihc/6b6ec2ae9dccae02807306c3dc2aadde/command.log
committed-heap-size: 115MB
execution_root: /home/semihc/.cache/bazel/_bazel_semihc/6b6ec2ae9dccae02807306c3dc2aadde/execroot/com_google_tcmalloc
gc-count: 7
gc-time: 75ms
install_base: /home/semihc/.cache/bazel/_bazel_semihc/install/69fcff9bbda52e7d707ee522ffcba568
java-home: /home/semihc/.cache/bazel/_bazel_semihc/install/69fcff9bbda52e7d707ee522ffcba568/embedded_tools/jdk
java-runtime: OpenJDK Runtime Environment (build 11.0.6+10-LTS) by Azul Systems, Inc.
java-vm: OpenJDK 64-Bit Server VM (build 11.0.6+10-LTS, mixed mode) by Azul Systems, Inc.
max-heap-size: 6599MB
output_base: /home/semihc/.cache/bazel/_bazel_semihc/6b6ec2ae9dccae02807306c3dc2aadde
output_path: /home/semihc/.cache/bazel/_bazel_semihc/6b6ec2ae9dccae02807306c3dc2aadde/execroot/com_google_tcmalloc/bazel-out
package_path: %workspace%
release: release 7.0.0-pre.20221102.3
repository_cache: /home/semihc/.cache/bazel/_bazel_semihc/cache/repos/v1
server_log: /home/semihc/.cache/bazel/_bazel_semihc/6b6ec2ae9dccae02807306c3dc2aadde/java.log.pc29238.semihc.log.java.20221116-154908.2014
server_pid: 2014
used-heap-size: 42MB
workspace: /opt/TC/ext/tcmalloc
semihc@PC29238:/opt/TC/ext/tcmalloc$

@ckennelly
Copy link
Collaborator

Are you able to build other packages with Bazel?

The error message looks somewhat generic

While resolving toolchains for target //tcmalloc/internal:affinity_test: invalid registered toolchain '@bazel_skylib//toolchains/unittest:cmd_toolchain':

@semihc
Copy link
Author

semihc commented Nov 17, 2022

Yes I can, for instance gflags:

semihc@PC29238:/opt/TC/ext/gflags$ bazel build //:gflags
INFO: Analyzed target //:gflags (36 packages loaded, 303 targets configured).
INFO: Found 1 target...
Target //:gflags up-to-date:
bazel-bin/libgflags.a
bazel-bin/libgflags.so
INFO: Elapsed time: 5.102s, Critical Path: 3.62s
INFO: 21 processes: 10 internal, 11 linux-sandbox.
INFO: Build completed successfully, 21 total actions
semihc@PC29238:/opt/TC/ext/gflags$ bazel info
bazel-bin: /home/semihc/.cache/bazel/_bazel_semihc/603f01d40fd207d2c40e45341f311af2/execroot/com_github_gflags_gflags/bazel-out/k8-fastbuild/bin
bazel-genfiles: /home/semihc/.cache/bazel/_bazel_semihc/603f01d40fd207d2c40e45341f311af2/execroot/com_github_gflags_gflags/bazel-out/k8-fastbuild/bin
bazel-testlogs: /home/semihc/.cache/bazel/_bazel_semihc/603f01d40fd207d2c40e45341f311af2/execroot/com_github_gflags_gflags/bazel-out/k8-fastbuild/testlogs
character-encoding: file.encoding = ISO-8859-1, defaultCharset = ISO-8859-1
command_log: /home/semihc/.cache/bazel/_bazel_semihc/603f01d40fd207d2c40e45341f311af2/command.log
committed-heap-size: 80MB
execution_root: /home/semihc/.cache/bazel/_bazel_semihc/603f01d40fd207d2c40e45341f311af2/execroot/com_github_gflags_gflags
gc-count: 11
gc-time: 126ms
install_base: /home/semihc/.cache/bazel/_bazel_semihc/install/69fcff9bbda52e7d707ee522ffcba568
java-home: /home/semihc/.cache/bazel/_bazel_semihc/install/69fcff9bbda52e7d707ee522ffcba568/embedded_tools/jdk
java-runtime: OpenJDK Runtime Environment (build 11.0.6+10-LTS) by Azul Systems, Inc.
java-vm: OpenJDK 64-Bit Server VM (build 11.0.6+10-LTS, mixed mode) by Azul Systems, Inc.
max-heap-size: 6599MB
output_base: /home/semihc/.cache/bazel/_bazel_semihc/603f01d40fd207d2c40e45341f311af2
output_path: /home/semihc/.cache/bazel/_bazel_semihc/603f01d40fd207d2c40e45341f311af2/execroot/com_github_gflags_gflags/bazel-out
package_path: %workspace%
release: release 7.0.0-pre.20221102.3
repository_cache: /home/semihc/.cache/bazel/_bazel_semihc/cache/repos/v1
server_log: /home/semihc/.cache/bazel/_bazel_semihc/603f01d40fd207d2c40e45341f311af2/java.log.pc29238.semihc.log.java.20221117-234940.285
server_pid: 285
used-heap-size: 35MB
workspace: /opt/TC/ext/gflags
semihc@PC29238:/opt/TC/ext/gflags$

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants