You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When creating a cmake target the build_args don't seem to be getting passed to the cmake build command. For example:
WORKSPACE
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@rules_foreign_cc//foreign_cc:repositories.bzl", "rules_foreign_cc_dependencies")
# This sets up some common toolchains for building targets. For more details, please see# https://github.com/bazelbuild/rules_foreign_cc/tree/main/docs#rules_foreign_cc_dependenciesrules_foreign_cc_dependencies()
_ALL_CONTENT="""\filegroup( name = "all_srcs", srcs = glob(["**"]), visibility = ["//visibility:public"],)"""http_archive(
name="com_mongodb_wiredtiger",
urls= ["https://github.com/wiredtiger/wiredtiger/archive/refs/tags/11.0.0.tar.gz"],
strip_prefix="wiredtiger-11.0.0",
sha256="1dad4afb604fa0dbebfa8024739226d6faec1ffd9f36b1ea00de86a7ac832168",
build_file_content=_ALL_CONTENT,
)
This seems to build a lot slower than running cmake build -j10 or cmake build --parallel 10 manually myself for the library. Is there any way to have rules_foreign_cc show the output of the command used to invoke cmake? I'd love to be able to have some parallelism in my foreign_cc builds.
Also this is a pretty hacky way to get the parallelism -- it would be great if rules_foreign_cc could detect my number of processors and do this automatically to speed up builds.
The text was updated successfully, but these errors were encountered:
You can find the scripts generated to see the command line that bazel is invoking cmake with in the build artifacts in the _foreign_cc directory.
Regarding parallel build - see #329 for some discussion around the complexity of supporting this. The easiest way to get parallelism at the moment is to use ninja as the generator as ninja does what you are asking - it automatically spawns jobs based on the number of processors on the machine. Note though that this can lead to over subscription of your build machine as bazel assumes each action only requires 1 core and so will concurrently spawn other actions at the same time.
When creating a cmake target the build_args don't seem to be getting passed to the
cmake build
command. For example:WORKSPACE
BUILD
This seems to build a lot slower than running
cmake build -j10
orcmake build --parallel 10
manually myself for the library. Is there any way to have rules_foreign_cc show the output of the command used to invoke cmake? I'd love to be able to have some parallelism in my foreign_cc builds.Also this is a pretty hacky way to get the parallelism -- it would be great if rules_foreign_cc could detect my number of processors and do this automatically to speed up builds.
The text was updated successfully, but these errors were encountered: