Update to newer version of bazel. Uses MODULE.bazel instead of WORKSPACE

PiperOrigin-RevId: 893663415
Change-Id: I1ec8a89d2a5e35accc5606fe34393ded65059083
diff --git a/.bazeliskrc b/.bazeliskrc
index e679d7f..e50f3cd 100644
--- a/.bazeliskrc
+++ b/.bazeliskrc
@@ -1 +1 @@
-USE_BAZEL_VERSION=7.1.2
\ No newline at end of file
+USE_BAZEL_VERSION=8.6.0
\ No newline at end of file
diff --git a/.bazelrc b/.bazelrc
index e363e37..5e186f2 100644
--- a/.bazelrc
+++ b/.bazelrc
@@ -21,6 +21,11 @@
 
 build --copt=-Wno-unused-function --cxxopt="-std=c++17"
 build --host_copt=-Wno-unused-function --host_cxxopt="-std=c++17"
-# TODO: migrate all dependencies from WORKSPACE to MODULE.bazel
-# https://github.com/protocolbuffers/protobuf/issues/14313
-common --noenable_bzlmod
+
+# Force include cstdint to provide uintptr_t for Abseil and other deps
+build --cxxopt=-include --cxxopt=cstdint
+build --host_cxxopt=-include --host_cxxopt=cstdint
+
+common --registry=https://raw.githubusercontent.com/google/mpact-sim-codelabs/main/
+common --registry=https://bcr.bazel.build/
+
diff --git a/.bazelversion b/.bazelversion
index a8a1887..acd405b 100644
--- a/.bazelversion
+++ b/.bazelversion
@@ -1 +1 @@
-7.1.2
+8.6.0
diff --git a/MODULE.bazel b/MODULE.bazel
new file mode 100644
index 0000000..4655aa1
--- /dev/null
+++ b/MODULE.bazel
@@ -0,0 +1,68 @@
+# Copyright 2026 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+module(
+    name = "mpact-cheriot",
+    version = "1.0.0",
+)
+
+# Core Dependencies
+bazel_dep(
+    name = "mpact-sim",
+    version = "1.0.0",
+)
+bazel_dep(
+    name = "mpact-riscv",
+    version = "1.0.0",
+)
+bazel_dep(
+    name = "abseil-cpp",
+    version = "20240116.2",
+)
+bazel_dep(
+    name = "protobuf",
+    version = "29.0",
+    repo_name = "com_google_protobuf",
+)
+bazel_dep(
+    name = "googletest",
+    version = "1.14.0.bcr.1",
+    repo_name = "com_google_googletest",
+)
+bazel_dep(
+    name = "re2",
+    version = "2023-11-01",
+    repo_name = "com_googlesource_code_re2",
+)
+bazel_dep(
+    name = "rules_license",
+    version = "1.0.0",
+)
+bazel_dep(
+    name = "bazel_skylib",
+    version = "1.7.1",
+)
+bazel_dep(
+    name = "rules_cc",
+    version = "0.1.3",
+)
+
+sim_deps = use_extension(
+    "@mpact-sim//:extensions.bzl",
+    "non_module_deps",
+)
+use_repo(
+    sim_deps,
+    "com_github_serge1_elfio",
+)
diff --git a/cheriot/cheriot_debug_interface.h b/cheriot/cheriot_debug_interface.h
index ebf4274..bbdc21d 100644
--- a/cheriot/cheriot_debug_interface.h
+++ b/cheriot/cheriot_debug_interface.h
@@ -38,14 +38,6 @@
   // length specifies the number of bytes (tags) to read.
   virtual absl::StatusOr<size_t> ReadTagMemory(uint64_t address, void* buf,
                                                size_t length) = 0;
-  // Set a data watchpoint for the given memory range. Any access matching the
-  // given access type (load/store) will halt execution following the completion
-  // of that access.
-  virtual absl::Status SetDataWatchpoint(uint64_t address, size_t length,
-                                         AccessType access_type) = 0;
-  // Clear data watchpoint for the given memory address and access type.
-  virtual absl::Status ClearDataWatchpoint(uint64_t address,
-                                           AccessType access_type) = 0;
   // Set an action point at the given address to execute the specified action.
   virtual absl::StatusOr<int> SetActionPoint(
       uint64_t address, absl::AnyInvocable<void(uint64_t, int)> action) = 0;
diff --git a/gitfiles/WORKSPACE b/gitfiles/WORKSPACE
deleted file mode 100644
index ef793a5..0000000
--- a/gitfiles/WORKSPACE
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright 2023 Google LLC
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     https://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-workspace(name = "com_google_mpact-cheriot")
-
-# First load the immediate repo dependencies (mpact-riscv).
-load("@com_google_mpact-cheriot//:repos.bzl", "mpact_cheriot_repos")
-
-mpact_cheriot_repos()
-
-# Next load in the riscv immediate dependency.
-load("@com_google_mpact-cheriot//:riscv_repos.bzl", "mpact_cheriot_riscv_repos")
-
-mpact_cheriot_riscv_repos()
-
-# Next load in the transitive repo dependencies.
-load("@com_google_mpact-cheriot//:riscv_dep_repos.bzl",
-     "mpact_cheriot_riscv_dep_repos")
-
-mpact_cheriot_riscv_dep_repos()
-
-# Call the deps function. It will call any other dependent deps functions.
-load("@com_google_mpact-cheriot//:deps.bzl", "mpact_cheriot_deps");
-
-mpact_cheriot_deps()
-
-# Load the protobuf deps from mpact_sim
-load("@com_google_mpact-sim//:protobuf_deps.bzl", "mpact_sim_protobuf_deps")
-
-mpact_sim_protobuf_deps()
\ No newline at end of file
diff --git a/gitfiles/deps.bzl b/gitfiles/deps.bzl
deleted file mode 100644
index b0de613..0000000
--- a/gitfiles/deps.bzl
+++ /dev/null
@@ -1,22 +0,0 @@
-# Copyright 2024 Google LLC
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     https://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-"""Set up extra repositories with the dependencies"""
-
-load("@com_google_mpact-riscv//:deps.bzl", "mpact_riscv_deps")
-
-def mpact_cheriot_deps():
-    """ Extra dependencies to finish setting up Google repositories"""
-
-    mpact_riscv_deps()
diff --git a/gitfiles/repos.bzl b/gitfiles/repos.bzl
deleted file mode 100644
index 92dc809..0000000
--- a/gitfiles/repos.bzl
+++ /dev/null
@@ -1,28 +0,0 @@
-# Copyright 2024 Google LLC
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     https://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-"""Load dependent repositories"""
-
-load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
-
-def mpact_cheriot_repos():
-    """ Load dependencies needed to use mpact-riscv as a 3rd-party consumer"""
-
-    if not native.existing_rule("com_google_mpact-riscv"):
-        http_archive(
-            name = "com_google_mpact-riscv",
-            sha256 = "07e08dbbe442b982c4285080d666a1c649f36b7ed21010c01502e957bf39b4a7",
-            strip_prefix = "mpact-riscv-cbdc1f57c3e11b9416f57fbe6da1263031e108e1",
-            url = "https://github.com/google/mpact-riscv/archive/cbdc1f57c3e11b9416f57fbe6da1263031e108e1.tar.gz",
-        )
diff --git a/gitfiles/riscv_dep_repos.bzl b/gitfiles/riscv_dep_repos.bzl
deleted file mode 100644
index 1b9a4f6..0000000
--- a/gitfiles/riscv_dep_repos.bzl
+++ /dev/null
@@ -1,22 +0,0 @@
-# Copyright 2024 Google LLC
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     https://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-"""Call the first level dependent repos to load their dependencies."""
-
-load("@com_google_mpact-riscv//:dep_repos.bzl", "mpact_riscv_dep_repos")
-
-def mpact_cheriot_riscv_dep_repos():
-    """ Extra dependencies to finish setting up repositories"""
-
-    mpact_riscv_dep_repos()
diff --git a/gitfiles/riscv_repos.bzl b/gitfiles/riscv_repos.bzl
deleted file mode 100644
index 3def0d4..0000000
--- a/gitfiles/riscv_repos.bzl
+++ /dev/null
@@ -1,22 +0,0 @@
-# Copyright 2024 Google LLC
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     https://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-"""Call the first level dependent repos to load their dependencies."""
-
-load("@com_google_mpact-riscv//:repos.bzl", "mpact_riscv_repos")
-
-def mpact_cheriot_riscv_repos():
-    """ Extra dependencies to finish setting up repositories"""
-
-    mpact_riscv_repos()