diff --git a/MODULE.bazel b/MODULE.bazel index 6f8f97a8..fa01604f 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -8,6 +8,12 @@ bazel_dep(name = "rules_python", version = "0.19.0") bazel_dep(name = "platforms", version = "0.0.7") bazel_dep(name = "cgrindel_bazel_starlib", version = "0.18.0") +# not a direct dependency, but required here for bazel starlib's difftest macros to work +bazel_dep( + name = "buildifier_prebuilt", + version = "6.1.2", +) + register_toolchains("@bazel_tools//tools/python:autodetecting_toolchain") # Must keep the Bazel version listed in WORKSPACE in sync with those loaded diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index 1dd46a01..dcf05ad7 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -18,7 +18,8 @@ "https://bcr.bazel.build/modules/bazel_skylib/1.6.1/MODULE.bazel": "8fdee2dbaace6c252131c00e1de4b165dc65af02ea278476187765e1a617b917", "https://bcr.bazel.build/modules/bazel_skylib/1.6.1/source.json": "082ed5f9837901fada8c68c2f3ddc958bb22b6d654f71dd73f3df30d45d4b749", "https://bcr.bazel.build/modules/buildifier_prebuilt/6.0.0.1/MODULE.bazel": "5d23708e6a5527ab4f151da7accabc22808cb5fb579c8cc4cd4a292da57a5c97", - "https://bcr.bazel.build/modules/buildifier_prebuilt/6.0.0.1/source.json": "57bc8b05bd4bb2736efe1b41f9f4bf551cdced8314e8d20420b8a0e5a0751b30", + "https://bcr.bazel.build/modules/buildifier_prebuilt/6.1.2/MODULE.bazel": "2ef4962c8b0b6d8d21928a89190755619254459bc67f870dc0ccb9ba9952d444", + "https://bcr.bazel.build/modules/buildifier_prebuilt/6.1.2/source.json": "19fb45ed3f0d55cbff94e402c39512940833ae3a68f9cbfd9518a1926b609c7c", "https://bcr.bazel.build/modules/buildozer/7.1.2/MODULE.bazel": "2e8dd40ede9c454042645fd8d8d0cd1527966aa5c919de86661e62953cd73d84", "https://bcr.bazel.build/modules/buildozer/7.1.2/source.json": "c9028a501d2db85793a6996205c8de120944f50a0d570438fcae0457a5f9d1f8", "https://bcr.bazel.build/modules/cgrindel_bazel_starlib/0.18.0/MODULE.bazel": "1d548f0c383ec8fce15c14b42b7f5f4fc29e910fb747d54b40d8c949a5dea09c", @@ -209,8 +210,8 @@ }, "@@buildifier_prebuilt~//:defs.bzl%buildifier_prebuilt_deps_extension": { "general": { - "bzlTransitiveDigest": "OoWi5m9k5b1vcdkzlL5LgptXPW6UHcvdioFl1jYehOU=", - "usagesDigest": "XfKr5E71RWCdeHzfpN7UfG8Uh5FTpmmLv0mGGeiymYM=", + "bzlTransitiveDigest": "cnU/K9IY/VeHcxnGaL5eLuX+z8qIjt0yUjs2dZfB3Rc=", + "usagesDigest": "dJKWOSZZDy7RHc2XG1O6ezkxcNMSeKBpUqAz2pk8cbY=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, "envVariables": {}, @@ -220,11 +221,11 @@ "ruleClassName": "http_file", "attributes": { "urls": [ - "https://github.com/bazelbuild/buildtools/releases/download/6.0.0/buildozer-darwin-amd64" + "https://github.com/bazelbuild/buildtools/releases/download/v6.1.2/buildozer-darwin-amd64" ], "downloaded_file_path": "buildozer", "executable": true, - "sha256": "17c97b23ebf0aa59c3c457800090e5d9b937511bafbe91d22aec972fbdf588d0" + "sha256": "4014751a4cc5e91a7dc4b64be7b30c565bd9014ae6d1879818dc624562a1d431" } }, "buildifier_linux_amd64": { @@ -232,11 +233,11 @@ "ruleClassName": "http_file", "attributes": { "urls": [ - "https://github.com/bazelbuild/buildtools/releases/download/6.0.0/buildifier-linux-amd64" + "https://github.com/bazelbuild/buildtools/releases/download/v6.1.2/buildifier-linux-amd64" ], "downloaded_file_path": "buildifier", "executable": true, - "sha256": "7ff82176879c0c13bc682b6b0e482d670fbe13bbb20e07915edb0ad11be50502" + "sha256": "51bc947dabb7b14ec6fb1224464fbcf7a7cb138f1a10a3b328f00835f72852ce" } }, "buildozer_darwin_arm64": { @@ -244,11 +245,11 @@ "ruleClassName": "http_file", "attributes": { "urls": [ - "https://github.com/bazelbuild/buildtools/releases/download/6.0.0/buildozer-darwin-arm64" + "https://github.com/bazelbuild/buildtools/releases/download/v6.1.2/buildozer-darwin-arm64" ], "downloaded_file_path": "buildozer", "executable": true, - "sha256": "8d5e26446cd5a945588b1e0c72854d2cc367fac98d16ddeccbc59b0c87a9a05e" + "sha256": "e78bd5357f2356067d4b0d49ec4e4143dd9b1308746afc6ff11b55b952f462d7" } }, "buildozer_linux_amd64": { @@ -256,11 +257,23 @@ "ruleClassName": "http_file", "attributes": { "urls": [ - "https://github.com/bazelbuild/buildtools/releases/download/6.0.0/buildozer-linux-amd64" + "https://github.com/bazelbuild/buildtools/releases/download/v6.1.2/buildozer-linux-amd64" ], "downloaded_file_path": "buildozer", "executable": true, - "sha256": "b46c12c81ab45306d3bbb4b3a6cd795532d1c3036ed126fbc43fde23d6c35f2d" + "sha256": "2aef0f1ef80a0140b8fe6e6a8eb822e14827d8855bfc6681532c7530339ea23b" + } + }, + "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.1.2/buildozer-windows-amd64.exe" + ], + "downloaded_file_path": "buildozer.exe", + "executable": true, + "sha256": "07664d5d08ee099f069cd654070cabf2708efaae9f52dc83921fa400c67a868b" } }, "buildozer_linux_arm64": { @@ -268,18 +281,30 @@ "ruleClassName": "http_file", "attributes": { "urls": [ - "https://github.com/bazelbuild/buildtools/releases/download/6.0.0/buildozer-linux-arm64" + "https://github.com/bazelbuild/buildtools/releases/download/v6.1.2/buildozer-linux-arm64" ], "downloaded_file_path": "buildozer", "executable": true, - "sha256": "548c3a6c890ef5cc4398d5afeb1399717b43740eb910f7488a36b76440ca0383" + "sha256": "586e27630cbc242e8bd6fe8e24485eca8dcadea6410cc13cbe059202655980ac" + } + }, + "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.1.2/buildifier-windows-amd64.exe" + ], + "downloaded_file_path": "buildifier.exe", + "executable": true, + "sha256": "92bdd284fbc6766fc3e300b434ff9e68ac4d76a06cb29d1bdefe79a102a8d135" } }, "buildifier_prebuilt_toolchains": { "bzlFile": "@@buildifier_prebuilt~//:defs.bzl", "ruleClassName": "_buildifier_toolchain_setup", "attributes": { - "assets_json": "[{\"arch\":\"amd64\",\"name\":\"buildifier\",\"platform\":\"darwin\",\"sha256\":\"3f8ab7dd5d5946ce44695f29c3b895ad11a9a6776c247ad5273e9c8480216ae1\",\"version\":\"6.0.0\"},{\"arch\":\"arm64\",\"name\":\"buildifier\",\"platform\":\"darwin\",\"sha256\":\"21fa0d48ef0b7251eb6e3521cbe25d1e52404763cd2a43aa29f69b5380559dd1\",\"version\":\"6.0.0\"},{\"arch\":\"amd64\",\"name\":\"buildifier\",\"platform\":\"linux\",\"sha256\":\"7ff82176879c0c13bc682b6b0e482d670fbe13bbb20e07915edb0ad11be50502\",\"version\":\"6.0.0\"},{\"arch\":\"arm64\",\"name\":\"buildifier\",\"platform\":\"linux\",\"sha256\":\"9ffa62ea1f55f420c36eeef1427f71a34a5d24332cb861753b2b59c66d6343e2\",\"version\":\"6.0.0\"},{\"arch\":\"amd64\",\"name\":\"buildozer\",\"platform\":\"darwin\",\"sha256\":\"17c97b23ebf0aa59c3c457800090e5d9b937511bafbe91d22aec972fbdf588d0\",\"version\":\"6.0.0\"},{\"arch\":\"arm64\",\"name\":\"buildozer\",\"platform\":\"darwin\",\"sha256\":\"8d5e26446cd5a945588b1e0c72854d2cc367fac98d16ddeccbc59b0c87a9a05e\",\"version\":\"6.0.0\"},{\"arch\":\"amd64\",\"name\":\"buildozer\",\"platform\":\"linux\",\"sha256\":\"b46c12c81ab45306d3bbb4b3a6cd795532d1c3036ed126fbc43fde23d6c35f2d\",\"version\":\"6.0.0\"},{\"arch\":\"arm64\",\"name\":\"buildozer\",\"platform\":\"linux\",\"sha256\":\"548c3a6c890ef5cc4398d5afeb1399717b43740eb910f7488a36b76440ca0383\",\"version\":\"6.0.0\"}]" + "assets_json": "[{\"arch\":\"amd64\",\"name\":\"buildifier\",\"platform\":\"darwin\",\"sha256\":\"e2f4a67691c5f55634fbfb3850eb97dd91be0edd059d947b6c83d120682e0216\",\"version\":\"v6.1.2\"},{\"arch\":\"arm64\",\"name\":\"buildifier\",\"platform\":\"darwin\",\"sha256\":\"7549b5f535219ac957aa2a6069d46fbfc9ea3f74abd85fd3d460af4b1a2099a6\",\"version\":\"v6.1.2\"},{\"arch\":\"amd64\",\"name\":\"buildifier\",\"platform\":\"linux\",\"sha256\":\"51bc947dabb7b14ec6fb1224464fbcf7a7cb138f1a10a3b328f00835f72852ce\",\"version\":\"v6.1.2\"},{\"arch\":\"arm64\",\"name\":\"buildifier\",\"platform\":\"linux\",\"sha256\":\"0ba6e8e3208b5a029164e542ddb5509e618f87b639ffe8cc2f54770022853080\",\"version\":\"v6.1.2\"},{\"arch\":\"amd64\",\"name\":\"buildifier\",\"platform\":\"windows\",\"sha256\":\"92bdd284fbc6766fc3e300b434ff9e68ac4d76a06cb29d1bdefe79a102a8d135\",\"version\":\"v6.1.2\"},{\"arch\":\"amd64\",\"name\":\"buildozer\",\"platform\":\"darwin\",\"sha256\":\"4014751a4cc5e91a7dc4b64be7b30c565bd9014ae6d1879818dc624562a1d431\",\"version\":\"v6.1.2\"},{\"arch\":\"arm64\",\"name\":\"buildozer\",\"platform\":\"darwin\",\"sha256\":\"e78bd5357f2356067d4b0d49ec4e4143dd9b1308746afc6ff11b55b952f462d7\",\"version\":\"v6.1.2\"},{\"arch\":\"amd64\",\"name\":\"buildozer\",\"platform\":\"linux\",\"sha256\":\"2aef0f1ef80a0140b8fe6e6a8eb822e14827d8855bfc6681532c7530339ea23b\",\"version\":\"v6.1.2\"},{\"arch\":\"arm64\",\"name\":\"buildozer\",\"platform\":\"linux\",\"sha256\":\"586e27630cbc242e8bd6fe8e24485eca8dcadea6410cc13cbe059202655980ac\",\"version\":\"v6.1.2\"},{\"arch\":\"amd64\",\"name\":\"buildozer\",\"platform\":\"windows\",\"sha256\":\"07664d5d08ee099f069cd654070cabf2708efaae9f52dc83921fa400c67a868b\",\"version\":\"v6.1.2\"}]" } }, "buildifier_darwin_amd64": { @@ -287,11 +312,11 @@ "ruleClassName": "http_file", "attributes": { "urls": [ - "https://github.com/bazelbuild/buildtools/releases/download/6.0.0/buildifier-darwin-amd64" + "https://github.com/bazelbuild/buildtools/releases/download/v6.1.2/buildifier-darwin-amd64" ], "downloaded_file_path": "buildifier", "executable": true, - "sha256": "3f8ab7dd5d5946ce44695f29c3b895ad11a9a6776c247ad5273e9c8480216ae1" + "sha256": "e2f4a67691c5f55634fbfb3850eb97dd91be0edd059d947b6c83d120682e0216" } }, "buildifier_darwin_arm64": { @@ -299,11 +324,11 @@ "ruleClassName": "http_file", "attributes": { "urls": [ - "https://github.com/bazelbuild/buildtools/releases/download/6.0.0/buildifier-darwin-arm64" + "https://github.com/bazelbuild/buildtools/releases/download/v6.1.2/buildifier-darwin-arm64" ], "downloaded_file_path": "buildifier", "executable": true, - "sha256": "21fa0d48ef0b7251eb6e3521cbe25d1e52404763cd2a43aa29f69b5380559dd1" + "sha256": "7549b5f535219ac957aa2a6069d46fbfc9ea3f74abd85fd3d460af4b1a2099a6" } }, "buildifier_linux_arm64": { @@ -311,11 +336,11 @@ "ruleClassName": "http_file", "attributes": { "urls": [ - "https://github.com/bazelbuild/buildtools/releases/download/6.0.0/buildifier-linux-arm64" + "https://github.com/bazelbuild/buildtools/releases/download/v6.1.2/buildifier-linux-arm64" ], "downloaded_file_path": "buildifier", "executable": true, - "sha256": "9ffa62ea1f55f420c36eeef1427f71a34a5d24332cb861753b2b59c66d6343e2" + "sha256": "0ba6e8e3208b5a029164e542ddb5509e618f87b639ffe8cc2f54770022853080" } } }, diff --git a/shared.bazelrc b/shared.bazelrc index 3cd55f06..b4788b01 100644 --- a/shared.bazelrc +++ b/shared.bazelrc @@ -12,3 +12,10 @@ common --color=auto --curses=auto # Enable bzlmod common --enable_bzlmod + +# Required for windows +startup --windows_enable_symlinks + +# this library requires runfiles for the bzlformat_lint_test +# but this is off by default on windows. Switch it on. +common --enable_runfiles diff --git a/tests/tools_tests/remove_child_wksp_bazel_symlinks_test.sh b/tests/tools_tests/remove_child_wksp_bazel_symlinks_test.sh index 53ef7126..16fe799c 100755 --- a/tests/tools_tests/remove_child_wksp_bazel_symlinks_test.sh +++ b/tests/tools_tests/remove_child_wksp_bazel_symlinks_test.sh @@ -38,6 +38,10 @@ child_a_bazel_out="${bazel_out}/child_a" child_b_bazel_out="${bazel_out}/child_b" mkdir -p "${bazel_out}" "${child_a_bazel_out}" "${child_b_bazel_out}" "${parent_bazel_out}" +# Windows requires this for msys to create real symlinks +# https://superuser.com/questions/1097481/msys2-create-a-sym-link-into-windows-folder-location +export MSYS=winsymlinks:nativestrict + # Add bazel symlinks parent_symlink="${parent_dir}/bazel-parent" child_a_symlink="${child_a_dir}/bazel-child_a"