Skip to content

Commit

Permalink
[drake_bazel_download] Upgrade MODULE.bazel
Browse files Browse the repository at this point in the history
Upgrade rules_cc to latest 0.0.x release 0.0.17.

Upgrade rules_python to latest release 0.40.0; this requires some
additional toolchain shenanigans.
  • Loading branch information
jwnimmer-tri committed Nov 24, 2024
1 parent bd3ec3a commit a4f0249
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
20 changes: 18 additions & 2 deletions drake_bazel_download/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
# SPDX-License-Identifier: MIT-0

# This is an empty BUILD file, to ensure that this project's root directory is
# a Bazel package.
# We must opt-out of the py_exec_tools_toolchain, otherwise rules_python will
# download a random copy from the internet that doesn't work correctly in CI.

load(
"@rules_python//python:py_exec_tools_toolchain.bzl",
"py_exec_tools_toolchain",
)

py_exec_tools_toolchain(
name = "python_no_exec_tools",
exec_interpreter = "@rules_python//python:none",
)

toolchain(
name = "python_no_exec_tools_toolchain",
toolchain = ":python_no_exec_tools",
toolchain_type = "@rules_python//python:exec_tools_toolchain_type",
)
7 changes: 5 additions & 2 deletions drake_bazel_download/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@
module(name = "drake_external_examples")

# Add the Bazel rulesets we need.
bazel_dep(name = "rules_cc", version = "0.0.9")
bazel_dep(name = "rules_python", version = "0.31.0")
bazel_dep(name = "rules_cc", version = "0.0.17")
bazel_dep(name = "rules_python", version = "0.40.0")

# Use the host system python.
register_toolchains("@bazel_tools//tools/python:autodetecting_toolchain")

# Disable the exec tools toolchain.
register_toolchains("//:python_no_exec_tools_toolchain")

# Use the host system Eigen.
local_eigen_repositiory = use_repo_rule("//:eigen.bzl", "local_eigen_repository")
local_eigen_repositiory(name = "eigen")
Expand Down

0 comments on commit a4f0249

Please sign in to comment.