-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for bzlmod (excluding Python bindings) (#1615)
* Migrate to bzlmod * Update Python version to PY3, as indicated by the actual source file. * Migrate more libraries & first draft of direct pywheel rule usage in Bazel * Integrate with nanobind and libpfm * Make Python toolchain a dev dependency * Undo py_wheel usage until later * Added support for bzlmod for C++ parts of google_benchmark. * Make //tools:all buildable with --enable_bzlmod --------- Co-authored-by: Andy Christiansen <achristiansen@google.com>
- Loading branch information
Showing
7 changed files
with
51 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
module(name = "com_github_google_benchmark", version="1.8.0") | ||
|
||
bazel_dep(name = "bazel_skylib", version = "1.4.1") | ||
bazel_dep(name = "platforms", version = "0.0.6") | ||
bazel_dep(name = "rules_foreign_cc", version = "0.9.0") | ||
bazel_dep(name = "rules_cc", version = "0.0.6") | ||
bazel_dep(name = "rules_python", version = "0.23.1") | ||
bazel_dep(name = "googletest", version = "1.12.1", repo_name = "com_google_googletest") | ||
bazel_dep(name = "libpfm", version = "4.11.0") | ||
|
||
# Register a toolchain for Python 3.9 to be able to build numpy. Python | ||
# versions >=3.10 are problematic. | ||
# A second reason for this is to be able to build Python hermetically instead | ||
# of relying on the changing default version from rules_python. | ||
|
||
python = use_extension("@rules_python//python/extensions:python.bzl", "python") | ||
python.toolchain(python_version = "3.9") | ||
|
||
# Extract the interpreter from the hermetic toolchain above, so we can use that | ||
# instead of the system interpreter for the pip compiplation step below. | ||
interpreter = use_extension("@rules_python//python/extensions:interpreter.bzl", "interpreter") | ||
interpreter.install( | ||
name = "interpreter", | ||
python_name = "python_3_9", | ||
) | ||
use_repo(interpreter, "interpreter") | ||
|
||
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip") | ||
pip.parse( | ||
name="tools_pip_deps", | ||
incompatible_generate_aliases = True, | ||
python_interpreter_target="@interpreter//:python", | ||
requirements_lock="//tools:requirements.txt") | ||
use_repo(pip, "tools_pip_deps") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# This file marks the root of the Bazel workspace. | ||
# See MODULE.bazel for dependencies and setup. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
scipy>=1.5.0 | ||
numpy == 1.25 | ||
scipy == 1.5.4 |