From 60a57b4b30e1e383bb96e68815f99844252c93da Mon Sep 17 00:00:00 2001 From: Alex Rodionov Date: Fri, 22 Mar 2024 17:55:43 -0700 Subject: [PATCH] [bazel] Move buildifier to MODULE --- BUILD.bazel | 2 +- MODULE.bazel | 1 + MODULE.bazel.lock | 282 +++++++++++++++++++++++++++++++++++++++------- WORKSPACE.bzlmod | 9 -- 4 files changed, 243 insertions(+), 51 deletions(-) diff --git a/BUILD.bazel b/BUILD.bazel index f08bd9d81b5ba..df867ec44f7e8 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -1,5 +1,5 @@ load("@aspect_rules_js//npm:defs.bzl", "npm_link_package") -load("@com_github_bazelbuild_buildtools//buildifier:def.bzl", "buildifier") +load("@buildifier_prebuilt//:rules.bzl", "buildifier") load("@npm//:defs.bzl", "npm_link_all_packages") load("//common:browsers.bzl", "chrome_data", "firefox_data") load("//java:browsers.bzl", "chrome_jvm_flags", "firefox_jvm_flags") diff --git a/MODULE.bazel b/MODULE.bazel index fb979816e670e..fa2b2ef0a3b22 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -5,6 +5,7 @@ bazel_dep(name = "aspect_rules_esbuild", version = "0.18.0") bazel_dep(name = "aspect_rules_js", version = "1.35.0") bazel_dep(name = "aspect_rules_ts", version = "2.1.0") bazel_dep(name = "bazel_features", version = "1.9.0") +bazel_dep(name = "buildifier_prebuilt", version = "6.4.0") bazel_dep(name = "contrib_rules_jvm", version = "0.24.0") bazel_dep(name = "platforms", version = "0.0.8") bazel_dep(name = "rules_dotnet", version = "0.14.0") diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index 3781853fd8e32..21b140207aee4 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -1,6 +1,6 @@ { "lockFileVersion": 6, - "moduleFileHash": "38f1e628ed8722e925c917336c929bf26dc8b24a7f6064046cf664a3cc898d3d", + "moduleFileHash": "5033931fac34032b67be998a839cabd443081a8434d3d754633f12717453ad77", "flags": { "cmdRegistries": [ "https://bcr.bazel.build/" @@ -35,7 +35,7 @@ "usingModule": "", "location": { "file": "@@//:MODULE.bazel", - "line": 21, + "line": 23, "column": 23 }, "imports": {}, @@ -50,7 +50,7 @@ "devDependency": false, "location": { "file": "@@//:MODULE.bazel", - "line": 22, + "line": 24, "column": 17 } }, @@ -63,7 +63,7 @@ "devDependency": false, "location": { "file": "@@//:MODULE.bazel", - "line": 26, + "line": 28, "column": 17 } }, @@ -75,7 +75,7 @@ "devDependency": false, "location": { "file": "@@//:MODULE.bazel", - "line": 30, + "line": 32, "column": 16 } } @@ -89,7 +89,7 @@ "usingModule": "", "location": { "file": "@@//:MODULE.bazel", - "line": 32, + "line": 34, "column": 21 }, "imports": {}, @@ -103,7 +103,7 @@ "devDependency": false, "location": { "file": "@@//:MODULE.bazel", - "line": 33, + "line": 35, "column": 15 } } @@ -117,7 +117,7 @@ "usingModule": "", "location": { "file": "@@//:MODULE.bazel", - "line": 35, + "line": 37, "column": 20 }, "imports": { @@ -144,7 +144,7 @@ "devDependency": false, "location": { "file": "@@//:MODULE.bazel", - "line": 36, + "line": 38, "column": 23 } } @@ -158,7 +158,7 @@ "usingModule": "", "location": { "file": "@@//:MODULE.bazel", - "line": 52, + "line": 54, "column": 29 }, "imports": { @@ -176,7 +176,7 @@ "devDependency": true, "location": { "file": "@@//:MODULE.bazel", - "line": 57, + "line": 59, "column": 18 } } @@ -190,7 +190,7 @@ "usingModule": "", "location": { "file": "@@//:MODULE.bazel", - "line": 62, + "line": 64, "column": 24 }, "imports": { @@ -206,7 +206,7 @@ "devDependency": false, "location": { "file": "@@//:MODULE.bazel", - "line": 63, + "line": 65, "column": 18 } } @@ -220,7 +220,7 @@ "usingModule": "", "location": { "file": "@@//:MODULE.bazel", - "line": 68, + "line": 70, "column": 23 }, "imports": { @@ -236,7 +236,7 @@ "devDependency": false, "location": { "file": "@@//:MODULE.bazel", - "line": 69, + "line": 71, "column": 17 } } @@ -250,7 +250,7 @@ "usingModule": "", "location": { "file": "@@//:MODULE.bazel", - "line": 72, + "line": 74, "column": 31 }, "imports": { @@ -267,7 +267,7 @@ "usingModule": "", "location": { "file": "@@//:MODULE.bazel", - "line": 77, + "line": 79, "column": 20 }, "imports": { @@ -287,7 +287,7 @@ "devDependency": false, "location": { "file": "@@//:MODULE.bazel", - "line": 78, + "line": 80, "column": 9 } }, @@ -301,7 +301,7 @@ "devDependency": false, "location": { "file": "@@//:MODULE.bazel", - "line": 83, + "line": 85, "column": 9 } }, @@ -315,7 +315,7 @@ "devDependency": false, "location": { "file": "@@//:MODULE.bazel", - "line": 88, + "line": 90, "column": 9 } } @@ -329,7 +329,7 @@ "usingModule": "", "location": { "file": "@@//:MODULE.bazel", - "line": 95, + "line": 97, "column": 23 }, "imports": { @@ -346,7 +346,7 @@ "devDependency": false, "location": { "file": "@@//:MODULE.bazel", - "line": 96, + "line": 98, "column": 17 } }, @@ -358,7 +358,7 @@ "devDependency": false, "location": { "file": "@@//:MODULE.bazel", - "line": 100, + "line": 102, "column": 17 } }, @@ -370,7 +370,7 @@ "devDependency": false, "location": { "file": "@@//:MODULE.bazel", - "line": 101, + "line": 103, "column": 17 } }, @@ -382,7 +382,7 @@ "devDependency": false, "location": { "file": "@@//:MODULE.bazel", - "line": 102, + "line": 104, "column": 17 } } @@ -396,7 +396,7 @@ "usingModule": "", "location": { "file": "@@//:MODULE.bazel", - "line": 105, + "line": 107, "column": 20 }, "imports": { @@ -414,7 +414,7 @@ "devDependency": false, "location": { "file": "@@//:MODULE.bazel", - "line": 108, + "line": 110, "column": 14 } }, @@ -428,7 +428,7 @@ "devDependency": false, "location": { "file": "@@//:MODULE.bazel", - "line": 108, + "line": 110, "column": 14 } }, @@ -442,7 +442,7 @@ "devDependency": false, "location": { "file": "@@//:MODULE.bazel", - "line": 108, + "line": 110, "column": 14 } }, @@ -456,7 +456,7 @@ "devDependency": false, "location": { "file": "@@//:MODULE.bazel", - "line": 108, + "line": 110, "column": 14 } } @@ -470,7 +470,7 @@ "usingModule": "", "location": { "file": "@@//:MODULE.bazel", - "line": 125, + "line": 127, "column": 32 }, "imports": { @@ -497,7 +497,7 @@ "usingModule": "", "location": { "file": "@@//:MODULE.bazel", - "line": 141, + "line": 143, "column": 22 }, "imports": { @@ -583,7 +583,7 @@ "devDependency": false, "location": { "file": "@@//:MODULE.bazel", - "line": 142, + "line": 144, "column": 14 } } @@ -597,7 +597,7 @@ "usingModule": "", "location": { "file": "@@//:MODULE.bazel", - "line": 217, + "line": 219, "column": 21 }, "imports": { @@ -616,7 +616,7 @@ "devDependency": false, "location": { "file": "@@//:MODULE.bazel", - "line": 218, + "line": 220, "column": 15 } }, @@ -713,7 +713,7 @@ "devDependency": false, "location": { "file": "@@//:MODULE.bazel", - "line": 222, + "line": 224, "column": 18 } } @@ -727,7 +727,7 @@ "usingModule": "", "location": { "file": "@@//:MODULE.bazel", - "line": 314, + "line": 316, "column": 21 }, "imports": { @@ -746,7 +746,7 @@ "devDependency": false, "location": { "file": "@@//:MODULE.bazel", - "line": 315, + "line": 317, "column": 15 } } @@ -760,7 +760,7 @@ "usingModule": "", "location": { "file": "@@//:MODULE.bazel", - "line": 321, + "line": 323, "column": 22 }, "imports": { @@ -780,7 +780,7 @@ "devDependency": false, "location": { "file": "@@//:MODULE.bazel", - "line": 322, + "line": 324, "column": 17 } } @@ -794,7 +794,7 @@ "usingModule": "", "location": { "file": "@@//:MODULE.bazel", - "line": 329, + "line": 331, "column": 43 }, "imports": { @@ -814,6 +814,7 @@ "aspect_rules_js": "aspect_rules_js@1.35.0", "aspect_rules_ts": "aspect_rules_ts@2.1.0", "bazel_features": "bazel_features@1.9.0", + "buildifier_prebuilt": "buildifier_prebuilt@6.4.0", "contrib_rules_jvm": "contrib_rules_jvm@0.24.0", "platforms": "platforms@0.0.8", "rules_dotnet": "rules_dotnet@0.14.0", @@ -1131,6 +1132,56 @@ } } }, + "buildifier_prebuilt@6.4.0": { + "name": "buildifier_prebuilt", + "version": "6.4.0", + "key": "buildifier_prebuilt@6.4.0", + "repoName": "buildifier_prebuilt", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [ + "@buildifier_prebuilt_toolchains//:all" + ], + "extensionUsages": [ + { + "extensionBzlFile": "@buildifier_prebuilt//:defs.bzl", + "extensionName": "buildifier_prebuilt_deps_extension", + "usingModule": "buildifier_prebuilt@6.4.0", + "location": { + "file": "https://bcr.bazel.build/modules/buildifier_prebuilt/6.4.0/MODULE.bazel", + "line": 10, + "column": 32 + }, + "imports": { + "buildifier_prebuilt_toolchains": "buildifier_prebuilt_toolchains" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + } + ], + "deps": { + "bazel_skylib": "bazel_skylib@1.5.0", + "platforms": "platforms@0.0.8", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/keith/buildifier-prebuilt/archive/refs/tags/6.4.0.tar.gz" + ], + "integrity": "sha256-itqdiOUev1of3/N9de1B1R9eZ3zb6vsKIt2lR0fW4H4=", + "strip_prefix": "buildifier-prebuilt-6.4.0", + "remote_patches": { + "https://bcr.bazel.build/modules/buildifier_prebuilt/6.4.0/patches/module_dot_bazel_version.patch": "sha256-FpUp/q4zJ2H12lwezrYaPUGLY2rr1XoWpiDRaE19udw=" + }, + "remote_patch_strip": 0 + } + } + }, "contrib_rules_jvm@0.24.0": { "name": "contrib_rules_jvm", "version": "0.24.0", @@ -59456,6 +59507,155 @@ "recordedRepoMappingEntries": [] } }, + "@@buildifier_prebuilt~//:defs.bzl%buildifier_prebuilt_deps_extension": { + "general": { + "bzlTransitiveDigest": "uAKOFsVgkdVxGK8RC6cNqxYMcezLf942BzB5DqaZxDQ=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "buildozer_darwin_amd64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "urls": [ + "https://github.com/bazelbuild/buildtools/releases/download/v6.4.0/buildozer-darwin-amd64" + ], + "downloaded_file_path": "buildozer", + "executable": true, + "sha256": "d29e347ecd6b5673d72cb1a8de05bf1b06178dd229ff5eb67fad5100c840cc8e" + } + }, + "buildifier_linux_amd64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "urls": [ + "https://github.com/bazelbuild/buildtools/releases/download/v6.4.0/buildifier-linux-amd64" + ], + "downloaded_file_path": "buildifier", + "executable": true, + "sha256": "be63db12899f48600bad94051123b1fd7b5251e7661b9168582ce52396132e92" + } + }, + "buildozer_darwin_arm64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "urls": [ + "https://github.com/bazelbuild/buildtools/releases/download/v6.4.0/buildozer-darwin-arm64" + ], + "downloaded_file_path": "buildozer", + "executable": true, + "sha256": "9b9e71bdbec5e7223871e913b65d12f6d8fa026684daf991f00e52ed36a6978d" + } + }, + "buildozer_linux_amd64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "urls": [ + "https://github.com/bazelbuild/buildtools/releases/download/v6.4.0/buildozer-linux-amd64" + ], + "downloaded_file_path": "buildozer", + "executable": true, + "sha256": "8dfd6345da4e9042daa738d7fdf34f699c5dfce4632f7207956fceedd8494119" + } + }, + "buildozer_windows_amd64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "urls": [ + "https://github.com/bazelbuild/buildtools/releases/download/v6.4.0/buildozer-windows-amd64.exe" + ], + "downloaded_file_path": "buildozer.exe", + "executable": true, + "sha256": "e7f05bf847f7c3689dd28926460ce6e1097ae97380ac8e6ae7147b7b706ba19b" + } + }, + "buildozer_linux_arm64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "urls": [ + "https://github.com/bazelbuild/buildtools/releases/download/v6.4.0/buildozer-linux-arm64" + ], + "downloaded_file_path": "buildozer", + "executable": true, + "sha256": "6559558fded658c8fa7432a9d011f7c4dcbac6b738feae73d2d5c352e5f605fa" + } + }, + "buildifier_windows_amd64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "urls": [ + "https://github.com/bazelbuild/buildtools/releases/download/v6.4.0/buildifier-windows-amd64.exe" + ], + "downloaded_file_path": "buildifier.exe", + "executable": true, + "sha256": "da8372f35e34b65fb6d997844d041013bb841e55f58b54d596d35e49680fe13c" + } + }, + "buildifier_prebuilt_toolchains": { + "bzlFile": "@@buildifier_prebuilt~//:defs.bzl", + "ruleClassName": "_buildifier_toolchain_setup", + "attributes": { + "assets_json": "[{\"arch\":\"amd64\",\"name\":\"buildifier\",\"platform\":\"darwin\",\"sha256\":\"eeb47b2de27f60efe549348b183fac24eae80f1479e8b06cac0799c486df5bed\",\"version\":\"v6.4.0\"},{\"arch\":\"arm64\",\"name\":\"buildifier\",\"platform\":\"darwin\",\"sha256\":\"fa07ba0d20165917ca4cc7609f9b19a8a4392898148b7babdf6bb2a7dd963f05\",\"version\":\"v6.4.0\"},{\"arch\":\"amd64\",\"name\":\"buildifier\",\"platform\":\"linux\",\"sha256\":\"be63db12899f48600bad94051123b1fd7b5251e7661b9168582ce52396132e92\",\"version\":\"v6.4.0\"},{\"arch\":\"arm64\",\"name\":\"buildifier\",\"platform\":\"linux\",\"sha256\":\"18540fc10f86190f87485eb86963e603e41fa022f88a2d1b0cf52ff252b5e1dd\",\"version\":\"v6.4.0\"},{\"arch\":\"amd64\",\"name\":\"buildifier\",\"platform\":\"windows\",\"sha256\":\"da8372f35e34b65fb6d997844d041013bb841e55f58b54d596d35e49680fe13c\",\"version\":\"v6.4.0\"},{\"arch\":\"amd64\",\"name\":\"buildozer\",\"platform\":\"darwin\",\"sha256\":\"d29e347ecd6b5673d72cb1a8de05bf1b06178dd229ff5eb67fad5100c840cc8e\",\"version\":\"v6.4.0\"},{\"arch\":\"arm64\",\"name\":\"buildozer\",\"platform\":\"darwin\",\"sha256\":\"9b9e71bdbec5e7223871e913b65d12f6d8fa026684daf991f00e52ed36a6978d\",\"version\":\"v6.4.0\"},{\"arch\":\"amd64\",\"name\":\"buildozer\",\"platform\":\"linux\",\"sha256\":\"8dfd6345da4e9042daa738d7fdf34f699c5dfce4632f7207956fceedd8494119\",\"version\":\"v6.4.0\"},{\"arch\":\"arm64\",\"name\":\"buildozer\",\"platform\":\"linux\",\"sha256\":\"6559558fded658c8fa7432a9d011f7c4dcbac6b738feae73d2d5c352e5f605fa\",\"version\":\"v6.4.0\"},{\"arch\":\"amd64\",\"name\":\"buildozer\",\"platform\":\"windows\",\"sha256\":\"e7f05bf847f7c3689dd28926460ce6e1097ae97380ac8e6ae7147b7b706ba19b\",\"version\":\"v6.4.0\"}]" + } + }, + "buildifier_darwin_amd64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "urls": [ + "https://github.com/bazelbuild/buildtools/releases/download/v6.4.0/buildifier-darwin-amd64" + ], + "downloaded_file_path": "buildifier", + "executable": true, + "sha256": "eeb47b2de27f60efe549348b183fac24eae80f1479e8b06cac0799c486df5bed" + } + }, + "buildifier_darwin_arm64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "urls": [ + "https://github.com/bazelbuild/buildtools/releases/download/v6.4.0/buildifier-darwin-arm64" + ], + "downloaded_file_path": "buildifier", + "executable": true, + "sha256": "fa07ba0d20165917ca4cc7609f9b19a8a4392898148b7babdf6bb2a7dd963f05" + } + }, + "buildifier_linux_arm64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "urls": [ + "https://github.com/bazelbuild/buildtools/releases/download/v6.4.0/buildifier-linux-arm64" + ], + "downloaded_file_path": "buildifier", + "executable": true, + "sha256": "18540fc10f86190f87485eb86963e603e41fa022f88a2d1b0cf52ff252b5e1dd" + } + } + }, + "recordedRepoMappingEntries": [ + [ + "buildifier_prebuilt~", + "bazel_skylib", + "bazel_skylib~" + ], + [ + "buildifier_prebuilt~", + "bazel_tools", + "bazel_tools" + ] + ] + } + }, "@@protobuf~//:non_module_deps.bzl%non_module_deps": { "general": { "bzlTransitiveDigest": "aGnO/HqVtCmRLEQWGCuKp7jwX+lCh/nc3/hI3clfwD8=", diff --git a/WORKSPACE.bzlmod b/WORKSPACE.bzlmod index 7730463e910f0..8baad6369411d 100644 --- a/WORKSPACE.bzlmod +++ b/WORKSPACE.bzlmod @@ -28,12 +28,3 @@ rules_closure_toolchains() load("//common:repositories.bzl", "pin_browsers") pin_browsers() - -http_archive( - name = "com_github_bazelbuild_buildtools", - sha256 = "65391537d1ef528bf772ae25d2c163bd5cee6a929b06cad985e0734f1a12610b", - strip_prefix = "buildtools-6.1.2", - urls = [ - "https://github.com/bazelbuild/buildtools/archive/refs/tags/v6.1.2.zip", - ], -)