Skip to content

Commit

Permalink
[tools] Consolidate rules_cc to a single point of control (RobotLocom…
Browse files Browse the repository at this point in the history
…otion#20230)

Never use the implicit native.cc_library, native.cc_binary, etc. We
want to have a single point of control where we can pin a version of
rules_cc, or insert project-wide build flags.

Undo the mysticism around loading from @drake//foo vs just //foo.
Several years ago this made a subtle difference, but it no longer
does.
  • Loading branch information
jwnimmer-tri authored Sep 21, 2023
1 parent 9484fa3 commit 143fe62
Show file tree
Hide file tree
Showing 378 changed files with 756 additions and 950 deletions.
2 changes: 1 addition & 1 deletion BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# OSX it won't conflict with a build artifacts directory named "build".

load("//tools/skylark:py.bzl", "py_library")
load("@drake//tools/install:install.bzl", "install", "install_test")
load("//tools/install:install.bzl", "install", "install_test")
load("//tools/lint:lint.bzl", "add_lint_tests")

package(
Expand Down
2 changes: 1 addition & 1 deletion bindings/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
load("//tools/lint:lint.bzl", "add_lint_tests")
load(
"@drake//tools/skylark:pybind.bzl",
"//tools/skylark:pybind.bzl",
"drake_pybind_library",
)
load(
Expand Down
8 changes: 4 additions & 4 deletions bindings/pydrake/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
load("@drake//tools/install:install.bzl", "install")
load("//tools/install:install.bzl", "install")
load(
"@drake//tools/skylark:drake_cc.bzl",
"//tools/skylark:drake_cc.bzl",
"drake_cc_googletest",
"drake_cc_library",
)
load(
"@drake//tools/skylark:drake_py.bzl",
"//tools/skylark:drake_py.bzl",
"drake_py_binary",
"drake_py_library",
"drake_py_unittest",
)
load(
"@drake//tools/skylark:pybind.bzl",
"//tools/skylark:pybind.bzl",
"drake_pybind_cc_googletest",
"drake_pybind_library",
"generate_pybind_documentation_header",
Expand Down
8 changes: 4 additions & 4 deletions bindings/pydrake/common/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
load("@drake//tools/install:install.bzl", "install")
load("//tools/install:install.bzl", "install")
load(
"@drake//tools/skylark:drake_cc.bzl",
"//tools/skylark:drake_cc.bzl",
"drake_cc_googletest",
"drake_cc_library",
)
load(
"@drake//tools/skylark:pybind.bzl",
"//tools/skylark:pybind.bzl",
"drake_pybind_cc_googletest",
"drake_pybind_library",
"generate_pybind_documentation_header",
"get_drake_py_installs",
"get_pybind_package_info",
)
load(
"@drake//tools/skylark:drake_py.bzl",
"//tools/skylark:drake_py.bzl",
"drake_py_binary",
"drake_py_library",
"drake_py_unittest",
Expand Down
4 changes: 2 additions & 2 deletions bindings/pydrake/common/test_utilities/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
load(
"@drake//tools/skylark:pybind.bzl",
"//tools/skylark:pybind.bzl",
"get_pybind_package_info",
)
load(
"@drake//tools/skylark:drake_py.bzl",
"//tools/skylark:drake_py.bzl",
"drake_py_library",
"drake_py_unittest",
)
Expand Down
6 changes: 3 additions & 3 deletions bindings/pydrake/examples/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
load("@drake//tools/install:install.bzl", "install")
load("//tools/install:install.bzl", "install")
load(
"@drake//tools/skylark:pybind.bzl",
"//tools/skylark:pybind.bzl",
"drake_pybind_library",
"get_drake_py_installs",
"get_pybind_package_info",
)
load(
"@drake//tools/skylark:drake_py.bzl",
"//tools/skylark:drake_py.bzl",
"drake_py_library",
"drake_py_unittest",
)
Expand Down
4 changes: 2 additions & 2 deletions bindings/pydrake/examples/gym/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
load("@drake//tools/install:install.bzl", "install")
load("//tools/install:install.bzl", "install")
load(
"@drake//tools/skylark:pybind.bzl",
"//tools/skylark:pybind.bzl",
"get_pybind_package_info",
)
load(
Expand Down
6 changes: 3 additions & 3 deletions bindings/pydrake/examples/multibody/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
load("@drake//tools/install:install.bzl", "install")
load("//tools/install:install.bzl", "install")
load(
"@drake//tools/skylark:pybind.bzl",
"//tools/skylark:pybind.bzl",
"get_drake_py_installs",
"get_pybind_package_info",
)
load(
"@drake//tools/skylark:drake_py.bzl",
"//tools/skylark:drake_py.bzl",
"drake_py_binary",
"drake_py_library",
)
Expand Down
8 changes: 4 additions & 4 deletions bindings/pydrake/geometry/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
load("@drake//tools/install:install.bzl", "install")
load("//tools/install:install.bzl", "install")
load(
"@drake//tools/skylark:drake_cc.bzl",
"//tools/skylark:drake_cc.bzl",
"drake_cc_library",
)
load(
"@drake//tools/skylark:drake_py.bzl",
"//tools/skylark:drake_py.bzl",
"drake_py_unittest",
)
load(
"@drake//tools/skylark:pybind.bzl",
"//tools/skylark:pybind.bzl",
"drake_pybind_library",
"get_drake_py_installs",
"get_pybind_package_info",
Expand Down
4 changes: 2 additions & 2 deletions bindings/pydrake/gym/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
load("@drake//tools/install:install.bzl", "install")
load("//tools/install:install.bzl", "install")
load(
"@drake//tools/skylark:pybind.bzl",
"//tools/skylark:pybind.bzl",
"get_pybind_package_info",
)
load(
Expand Down
6 changes: 3 additions & 3 deletions bindings/pydrake/manipulation/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
load("@drake//tools/install:install.bzl", "install")
load("//tools/install:install.bzl", "install")
load(
"@drake//tools/skylark:pybind.bzl",
"//tools/skylark:pybind.bzl",
"drake_pybind_library",
"get_drake_py_installs",
"get_pybind_package_info",
)
load(
"@drake//tools/skylark:drake_py.bzl",
"//tools/skylark:drake_py.bzl",
"drake_py_library",
"drake_py_unittest",
)
Expand Down
10 changes: 5 additions & 5 deletions bindings/pydrake/multibody/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
load("@drake//tools/install:install.bzl", "install", "install_files")
load("//tools/install:install.bzl", "install", "install_files")
load(
"@drake//tools/skylark:pybind.bzl",
"//tools/skylark:pybind.bzl",
"drake_pybind_library",
"get_drake_py_installs",
"get_pybind_package_info",
)
load(
"@drake//tools/skylark:drake_py.bzl",
"//tools/skylark:drake_py.bzl",
"drake_py_binary",
"drake_py_library",
"drake_py_unittest",
)
load(
"@drake//tools/skylark:alias.bzl",
"//tools/skylark:alias.bzl",
"drake_py_library_aliases",
)
load("//bindings/pydrake:pydrake.bzl", "add_lint_tests_pydrake")
load("//tools/jupyter:jupyter_py.bzl", "drake_jupyter_py_binary")
load("@python//:version.bzl", "PYTHON_SITE_PACKAGES_RELPATH")
load(
"@drake//tools/workspace:cmake_configure_file.bzl",
"//tools/workspace:cmake_configure_file.bzl",
"cmake_configure_file",
)

Expand Down
6 changes: 3 additions & 3 deletions bindings/pydrake/planning/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
load("@drake//tools/install:install.bzl", "install")
load("//tools/install:install.bzl", "install")
load(
"@drake//tools/skylark:pybind.bzl",
"//tools/skylark:pybind.bzl",
"drake_pybind_library",
"get_drake_py_installs",
"get_pybind_package_info",
)
load(
"@drake//tools/skylark:drake_py.bzl",
"//tools/skylark:drake_py.bzl",
"drake_py_unittest",
)
load("//bindings/pydrake:pydrake.bzl", "add_lint_tests_pydrake")
Expand Down
12 changes: 6 additions & 6 deletions bindings/pydrake/solvers/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
load("@drake//tools/install:install.bzl", "install")
load("//tools/install:install.bzl", "install")
load(
"@drake//tools/skylark:test_tags.bzl",
"//tools/skylark:test_tags.bzl",
"gurobi_test_tags",
"mosek_test_tags",
)
load(
"@drake//tools/skylark:drake_cc.bzl",
"//tools/skylark:drake_cc.bzl",
"drake_cc_library",
)
load(
"@drake//tools/skylark:pybind.bzl",
"//tools/skylark:pybind.bzl",
"drake_pybind_library",
"get_drake_py_installs",
"get_pybind_package_info",
)
load(
"@drake//tools/skylark:drake_py.bzl",
"//tools/skylark:drake_py.bzl",
"drake_py_library",
"drake_py_unittest",
)
load(
"@drake//tools/skylark:alias.bzl",
"//tools/skylark:alias.bzl",
"drake_py_library_aliases",
)
load("//bindings/pydrake:pydrake.bzl", "add_lint_tests_pydrake")
Expand Down
8 changes: 4 additions & 4 deletions bindings/pydrake/systems/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
load("@drake//tools/install:install.bzl", "install")
load("//tools/install:install.bzl", "install")
load(
"@drake//tools/skylark:pybind.bzl",
"//tools/skylark:pybind.bzl",
"drake_pybind_library",
"get_drake_py_installs",
"get_pybind_package_info",
)
load(
"@drake//tools/skylark:drake_cc.bzl",
"//tools/skylark:drake_cc.bzl",
"drake_cc_library",
)
load(
"@drake//tools/skylark:drake_py.bzl",
"//tools/skylark:drake_py.bzl",
"drake_py_binary",
"drake_py_library",
"drake_py_unittest",
Expand Down
8 changes: 4 additions & 4 deletions bindings/pydrake/visualization/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
load("@drake//tools/install:install.bzl", "install", "install_files")
load("//tools/install:install.bzl", "install", "install_files")
load(
"@drake//tools/skylark:pybind.bzl",
"//tools/skylark:pybind.bzl",
"drake_pybind_library",
"get_drake_py_installs",
"get_pybind_package_info",
)
load(
"@drake//tools/skylark:drake_py.bzl",
"//tools/skylark:drake_py.bzl",
"drake_py_binary",
"drake_py_library",
"drake_py_unittest",
)
load("@python//:version.bzl", "PYTHON_SITE_PACKAGES_RELPATH")
load(
"@drake//tools/workspace:cmake_configure_file.bzl",
"//tools/workspace:cmake_configure_file.bzl",
"cmake_configure_file",
)
load("//bindings/pydrake:pydrake.bzl", "add_lint_tests_pydrake")
Expand Down
6 changes: 3 additions & 3 deletions common/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
load(
"@drake//tools/skylark:drake_cc.bzl",
"//tools/skylark:drake_cc.bzl",
"drake_cc_binary",
"drake_cc_googletest",
"drake_cc_library",
"drake_cc_package_library",
"drake_cc_test",
)
load(
"@drake//tools/skylark:drake_py.bzl",
"//tools/skylark:drake_py.bzl",
"drake_py_binary",
"drake_py_unittest",
)
load("@drake//tools/install:install.bzl", "install")
load("//tools/install:install.bzl", "install")
load("//tools/lint:lint.bzl", "add_lint_tests")

package(default_visibility = ["//visibility:public"])
Expand Down
2 changes: 1 addition & 1 deletion common/ad/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load(
"@drake//tools/skylark:drake_cc.bzl",
"//tools/skylark:drake_cc.bzl",
"drake_cc_googletest",
"drake_cc_library",
"drake_cc_package_library",
Expand Down
2 changes: 1 addition & 1 deletion common/benchmarking/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load(
"@drake//tools/performance:defs.bzl",
"//tools/performance:defs.bzl",
"drake_cc_googlebench_binary",
"drake_py_experiment_binary",
)
Expand Down
6 changes: 3 additions & 3 deletions common/proto/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
load(
"@drake//tools/skylark:drake_cc.bzl",
"//tools/skylark:drake_cc.bzl",
"drake_cc_googletest",
"drake_cc_library",
"drake_cc_package_library",
)
load(
"@drake//tools/skylark:drake_py.bzl",
"//tools/skylark:drake_py.bzl",
"drake_py_binary",
"drake_py_library",
"drake_py_unittest",
)
load("@drake//tools/install:install.bzl", "install")
load("//tools/install:install.bzl", "install")
load("//tools/lint:lint.bzl", "add_lint_tests")

package(default_visibility = ["//visibility:public"])
Expand Down
2 changes: 1 addition & 1 deletion common/schema/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load(
"@drake//tools/skylark:drake_cc.bzl",
"//tools/skylark:drake_cc.bzl",
"drake_cc_googletest",
"drake_cc_library",
"drake_cc_package_library",
Expand Down
2 changes: 1 addition & 1 deletion common/symbolic/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load(
"@drake//tools/skylark:drake_cc.bzl",
"//tools/skylark:drake_cc.bzl",
"drake_cc_googletest",
"drake_cc_library",
"drake_cc_package_library",
Expand Down
2 changes: 1 addition & 1 deletion common/symbolic/expression/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load(
"@drake//tools/skylark:drake_cc.bzl",
"//tools/skylark:drake_cc.bzl",
"drake_cc_googletest",
"drake_cc_library",
"drake_cc_package_library",
Expand Down
4 changes: 2 additions & 2 deletions common/test_utilities/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
load(
"@drake//tools/skylark:drake_cc.bzl",
"//tools/skylark:drake_cc.bzl",
"drake_cc_binary",
"drake_cc_googletest",
"drake_cc_library",
"drake_cc_package_library",
)
load(
"@drake//tools/skylark:drake_py.bzl",
"//tools/skylark:drake_py.bzl",
"drake_py_library",
)
load("//tools/lint:lint.bzl", "add_lint_tests")
Expand Down
2 changes: 1 addition & 1 deletion common/trajectories/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load(
"@drake//tools/skylark:drake_cc.bzl",
"//tools/skylark:drake_cc.bzl",
"drake_cc_googletest",
"drake_cc_library",
"drake_cc_package_library",
Expand Down
2 changes: 1 addition & 1 deletion common/yaml/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load(
"@drake//tools/skylark:drake_cc.bzl",
"//tools/skylark:drake_cc.bzl",
"drake_cc_googletest",
"drake_cc_library",
"drake_cc_package_library",
Expand Down
2 changes: 1 addition & 1 deletion doc/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package(default_visibility = ["//visibility:private"])

load(
"@drake//tools/skylark:drake_py.bzl",
"//tools/skylark:drake_py.bzl",
"drake_py_binary",
"drake_py_library",
)
Expand Down
Loading

0 comments on commit 143fe62

Please sign in to comment.