Rename @third_party Bazel repo to @crates.io
diff --git a/BUILD b/BUILD
index 1c233bd..4e87d8c 100644
--- a/BUILD
+++ b/BUILD
@@ -28,11 +28,11 @@
data = ["gen/cmd/src/gen/include/cxx.h"],
edition = "2021",
deps = [
- "@third_party//:clap",
- "@third_party//:codespan-reporting",
- "@third_party//:proc-macro2",
- "@third_party//:quote",
- "@third_party//:syn",
+ "@crates.io//:clap",
+ "@crates.io//:codespan-reporting",
+ "@crates.io//:proc-macro2",
+ "@crates.io//:quote",
+ "@crates.io//:syn",
],
)
@@ -55,9 +55,9 @@
srcs = glob(["macro/src/**/*.rs"]),
edition = "2021",
deps = [
- "@third_party//:proc-macro2",
- "@third_party//:quote",
- "@third_party//:syn",
+ "@crates.io//:proc-macro2",
+ "@crates.io//:quote",
+ "@crates.io//:syn",
],
)
@@ -67,13 +67,13 @@
data = ["gen/build/src/gen/include/cxx.h"],
edition = "2021",
deps = [
- "@third_party//:cc",
- "@third_party//:codespan-reporting",
- "@third_party//:once_cell",
- "@third_party//:proc-macro2",
- "@third_party//:quote",
- "@third_party//:scratch",
- "@third_party//:syn",
+ "@crates.io//:cc",
+ "@crates.io//:codespan-reporting",
+ "@crates.io//:once_cell",
+ "@crates.io//:proc-macro2",
+ "@crates.io//:quote",
+ "@crates.io//:scratch",
+ "@crates.io//:syn",
],
)
@@ -84,10 +84,10 @@
edition = "2021",
visibility = ["//visibility:public"],
deps = [
- "@third_party//:cc",
- "@third_party//:codespan-reporting",
- "@third_party//:proc-macro2",
- "@third_party//:quote",
- "@third_party//:syn",
+ "@crates.io//:cc",
+ "@crates.io//:codespan-reporting",
+ "@crates.io//:proc-macro2",
+ "@crates.io//:quote",
+ "@crates.io//:syn",
],
)
diff --git a/MODULE.bazel b/MODULE.bazel
index 499ccc0..a597ca0 100644
--- a/MODULE.bazel
+++ b/MODULE.bazel
@@ -12,4 +12,4 @@
register_toolchains("@rust_toolchains//:all")
crate_repositories = use_extension("//tools/bazel:extension.bzl", "crate_repositories")
-use_repo(crate_repositories, third_party = "vendor")
+use_repo(crate_repositories, "crates.io")
diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock
index ef4e63b..e1df96c 100644
--- a/MODULE.bazel.lock
+++ b/MODULE.bazel.lock
@@ -1,6 +1,6 @@
{
"lockFileVersion": 6,
- "moduleFileHash": "36542d567471d94e13bc08e148c59304483983deecce62b38c1dfa8b870f296e",
+ "moduleFileHash": "cfc1fb790ae3b331704c8cb14306153abf7a406b141152022ddb5c2a13e5c566",
"flags": {
"cmdRegistries": [
"https://bcr.bazel.build/"
@@ -68,7 +68,7 @@
"column": 35
},
"imports": {
- "third_party": "vendor"
+ "crates.io": "crates.io"
},
"devImports": [],
"tags": [],
@@ -1328,7 +1328,7 @@
"moduleExtensions": {
"//tools/bazel:extension.bzl%crate_repositories": {
"general": {
- "bzlTransitiveDigest": "82LNMqtYo7rmi4vVOrxBnxiUgtCfcdw0VbROG1p0jQk=",
+ "bzlTransitiveDigest": "mMVzzptFEe4M3dfpM1chYMwTdpqJiAez+R1cfoMax1o=",
"recordedFileInputs": {},
"recordedDirentsInputs": {},
"envVariables": {},
@@ -1450,6 +1450,13 @@
"build_file": "@@//third-party/bazel:BUILD.winapi-i686-pc-windows-gnu-0.4.0.bazel"
}
},
+ "crates.io": {
+ "bzlFile": "@@//tools/bazel:extension.bzl",
+ "ruleClassName": "_crates_vendor_remote_repository",
+ "attributes": {
+ "build_file": "@@//third-party/bazel:BUILD.bazel"
+ }
+ },
"vendor__unicode-ident-1.0.12": {
"bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
"ruleClassName": "http_archive",
@@ -1515,14 +1522,6 @@
"build_file": "@@//third-party/bazel:BUILD.codespan-reporting-0.11.1.bazel"
}
},
- "vendor": {
- "bzlFile": "@@rules_rust~//crate_universe/private:crates_vendor.bzl",
- "ruleClassName": "crates_vendor_remote_repository",
- "attributes": {
- "build_file": "@@//third-party/bazel:BUILD.bazel",
- "defs_module": "@@//third-party/bazel:defs.bzl"
- }
- },
"vendor__clap_lex-0.7.0": {
"bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
"ruleClassName": "http_archive",
@@ -1576,14 +1575,6 @@
}
}
},
- "moduleExtensionMetadata": {
- "explicitRootModuleDirectDeps": [
- "vendor"
- ],
- "explicitRootModuleDirectDevDeps": [],
- "useAllRepos": "NO",
- "reproducible": false
- },
"recordedRepoMappingEntries": [
[
"",
@@ -1602,11 +1593,6 @@
],
[
"",
- "rules_rust",
- "rules_rust~"
- ],
- [
- "",
"vendor__cc-1.0.90",
"vendor__cc-1.0.90"
],
diff --git a/tools/bazel/extension.bzl b/tools/bazel/extension.bzl
index ebf0fd2..1d1ae0b 100644
--- a/tools/bazel/extension.bzl
+++ b/tools/bazel/extension.bzl
@@ -1,10 +1,20 @@
-load("//third-party/bazel:crates.bzl", _crate_repositories = "crate_repositories")
+load("//third-party/bazel:defs.bzl", _crate_repositories = "crate_repositories")
+
+def _crates_vendor_remote_repository_impl(repository_ctx):
+ repository_ctx.symlink(repository_ctx.attr.build_file, "BUILD.bazel")
+
+_crates_vendor_remote_repository = repository_rule(
+ implementation = _crates_vendor_remote_repository_impl,
+ attrs = {
+ "build_file": attr.label(mandatory = True),
+ },
+)
def _crate_repositories_impl(module_ctx):
_crate_repositories()
- return module_ctx.extension_metadata(
- root_module_direct_deps = ["vendor"],
- root_module_direct_dev_deps = [],
+ _crates_vendor_remote_repository(
+ name = "crates.io",
+ build_file = "//third-party/bazel:BUILD.bazel",
)
crate_repositories = module_extension(