No public description PiperOrigin-RevId: 638646059 Change-Id: I5f8f410470a54cdb421003fbfd7782c562a10be9
diff --git a/WORKSPACE b/WORKSPACE index 9ba8ebf..43cc395 100644 --- a/WORKSPACE +++ b/WORKSPACE
@@ -14,29 +14,17 @@ workspace(name = "com_google_mpact-cheriot") -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") +# First load the immediate repo dependencies (mpact-sim). +load("@com_google_mpact-cheriot//:repos.bzl", "mpact_cheriot_repos") -# MPACT-RiscV repo -http_archive( - name = "com_google_mpact-riscv", - sha256 = "c30dc2ec57fd476d833dc8e5c02045acdfda4136cb5c2376044432d453aecd4d", - strip_prefix = "mpact-riscv-a43a92ba38d8260f4207416e11721ceee7135624", - url = "https://github.com/google/mpact-riscv/archive/a43a92ba38d8260f4207416e11721ceee7135624.tar.gz" -) +mpact_cheriot_repos() -load("@com_google_mpact-riscv//:repos.bzl, "mpact_riscv_repos") +# Next load in the transitive repo dependencies. +load("@com_google_mpact-cheriot//:dep_repos.bzl", "mpact_cheriot_dep_repos") -mpact_riscv_repos() +mpact_cheriot_dep_repos() -load("@com_google_mpact-riscv//::deps.bzl, "mpact_riscv_deps") +# Call the deps function. It will call any other dependent deps functions. +load("@com_google_mpact-cheriot//:deps.bzl", "mpact_cheriot_deps"); -mpact_riscv_deps() - -load("@com_google_mpact-sim//:repos.bzl", "mpact_sim_repos") - -mpact_sim_repos() - -load("@com_google_mpact-sim//:deps.bzl", "mpact_sim_deps") - -mpact_sim_deps() +mpact_cheriot_deps()
diff --git a/deps.bzl b/deps.bzl new file mode 100644 index 0000000..b0de613 --- /dev/null +++ b/deps.bzl
@@ -0,0 +1,22 @@ +# 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/dep_repos.bzl b/gitfiles/dep_repos.bzl new file mode 100644 index 0000000..ba185a7 --- /dev/null +++ b/gitfiles/dep_repos.bzl
@@ -0,0 +1,22 @@ +# 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_dep_repos") + +def mpact_cheriot_dep_repos(): + """ Extra dependencies to finish setting up repositories""" + + mpact_riscv_dep_repos()
diff --git a/repos.bzl b/repos.bzl new file mode 100644 index 0000000..6490680 --- /dev/null +++ b/repos.bzl
@@ -0,0 +1,28 @@ +# 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 = "43606c66d9664f824967345036c5a6c808f9a1f219a082a078382ef091c13ae3", + strip_prefix = "mpact-riscv-116a72298bc6c012644739cb84e7ff593673cb84", + url = "https://github.com/google/mpact-riscv/archive/116a72298bc6c012644739cb84e7ff593673cb84.tar.gz", + )