Skip to content

Commit

Permalink
Migrate C++ toolchains to bzlmod
Browse files Browse the repository at this point in the history
For unknown reasons this behaves better with toolchain resolution and
unbreaks the Bazel build on Windows.
  • Loading branch information
aaronmondal committed Dec 15, 2023
1 parent 4d9d897 commit 86ff6f6
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 25 deletions.
2 changes: 2 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

build --enable_bzlmod

# Use the earliest supported C++ version for protoc.
build --cxxopt=-std=c++14 --host_cxxopt=-std=c++14

Expand Down
17 changes: 17 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module(
name = "nativelink",
version = "0.0.0",
compatibility_level = 0,
)

register_execution_platforms(
"@nativelink//local-remote-execution/generated/config:platform",
)

register_toolchains(
"@nativelink//local-remote-execution/generated/config:cc-toolchain",
"@nativelink//local-remote-execution/generated/java:all",
)

bazel_dep(name = "platforms", version = "0.0.8")
bazel_dep(name = "rules_cc", version = "0.0.9")
25 changes: 0 additions & 25 deletions WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,6 @@ workspace(name = "nativelink")

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "rules_cc",
sha256 = "2037875b9a4456dce4a79d112a8ae885bbc4aad968e6587dca6e64f3a0900cdf",
strip_prefix = "rules_cc-0.0.9",
urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.0.9/rules_cc-0.0.9.tar.gz"],
)

register_execution_platforms(
"@nativelink//local-remote-execution/generated/config:platform",
)

register_toolchains(
"@nativelink//local-remote-execution/generated/config:cc-toolchain",
"@nativelink//local-remote-execution/generated/java:all",
)

http_archive(
name = "rules_rust",
sha256 = "36ab8f9facae745c9c9c1b33d225623d976e78f2cc3f729b7973d8c20934ab95",
Expand All @@ -26,15 +10,6 @@ http_archive(
],
)

http_archive(
name = "rules_python",
sha256 = "84aec9e21cc56fbc7f1335035a71c850d1b9b5cc6ff497306f84cced9a769841",
strip_prefix = "rules_python-0.23.1",
urls = [
"https://github.com/bazelbuild/rules_python/releases/download/0.23.1/rules_python-0.23.1.tar.gz",
],
)

load(
"@rules_rust//rust:repositories.bzl",
"rules_rust_dependencies",
Expand Down

0 comments on commit 86ff6f6

Please sign in to comment.