bazel_7: cleanup unused files

This commit is contained in:
Guillaume Maudoux
2023-12-13 22:48:27 +01:00
parent 058102dd42
commit a4cf97e415
10 changed files with 0 additions and 3135 deletions
@@ -1,13 +0,0 @@
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/toolchains/RegisteredToolchainsFunction.java b/src/main/java/com/google/devtools/build/lib/skyframe/toolchains/RegisteredToolchainsFunction.java
index 2b407202a3..7591e78f85 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/toolchains/RegisteredToolchainsFunction.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/toolchains/RegisteredToolchainsFunction.java
@@ -88,7 +88,7 @@ public class RegisteredToolchainsFunction implements SkyFunction {
try {
targetPatternBuilder.addAll(
TargetPatternUtil.parseAllSigned(
- platformConfiguration.getExtraToolchains(), mainRepoParser));
+ platformConfiguration.getExtraToolchains().reverse(), mainRepoParser));
} catch (InvalidTargetPatternException e) {
throw new RegisteredToolchainsFunctionException(
new InvalidToolchainLabelException(e), Transience.PERSISTENT);
@@ -1,63 +0,0 @@
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/repository/starlark/StarlarkOS.java b/src/main/java/com/google/devtools/build/lib/bazel/repository/starlark/StarlarkOS.java
index 333ea07801..287760f8b6 100644
--- a/src/main/java/com/google/devtools/build/lib/bazel/repository/starlark/StarlarkOS.java
+++ b/src/main/java/com/google/devtools/build/lib/bazel/repository/starlark/StarlarkOS.java
@@ -64,6 +64,8 @@ final class StarlarkOS implements StarlarkValue {
"A string identifying the architecture Bazel is running on (the value of the \"os.arch\""
+ " Java property converted to lower case).")
public String getArch() {
- return System.getProperty("os.arch").toLowerCase(Locale.ROOT);
+ String arch = System.getProperty("os.arch").toLowerCase(Locale.ROOT);
+ System.out.println("ARCH is " + arch);
+ return arch;
}
}
diff --git a/tools/cpp/cc_configure.bzl b/tools/cpp/cc_configure.bzl
index 56399fb4e3..a0172717b5 100644
--- a/tools/cpp/cc_configure.bzl
+++ b/tools/cpp/cc_configure.bzl
@@ -32,16 +32,20 @@ def cc_autoconf_toolchains_impl(repository_ctx):
# Should we try to find C++ toolchain at all? If not, we don't have to generate toolchains for C++ at all.
should_detect_cpp_toolchain = "BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN" not in env or env["BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN"] != "1"
+ cpu_value = get_cpu_value(repository_ctx)
+ print('cc_autoconf_toolchains_impl', "cpu_value", cpu_value)
if should_detect_cpp_toolchain:
+ print('cc_autoconf_toolchains_impl', repository_ctx.name, "should detect")
paths = resolve_labels(repository_ctx, [
"@bazel_tools//tools/cpp:BUILD.toolchains.tpl",
])
repository_ctx.template(
"BUILD",
paths["@bazel_tools//tools/cpp:BUILD.toolchains.tpl"],
- {"%{name}": get_cpu_value(repository_ctx)},
+ {"%{name}": cpu_value},
)
else:
+ print('cc_autoconf_toolchains_impl', repository_ctx.name, "should NOT detect")
repository_ctx.file("BUILD", "# C++ toolchain autoconfiguration was disabled by BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN env variable.")
cc_autoconf_toolchains = repository_rule(
@@ -62,6 +66,7 @@ def cc_autoconf_impl(repository_ctx, overriden_tools = dict()):
env = repository_ctx.os.environ
cpu_value = get_cpu_value(repository_ctx)
+ print('cc_autoconf_impl', "cpu_value", cpu_value)
if "BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN" in env and env["BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN"] == "1":
paths = resolve_labels(repository_ctx, [
"@bazel_tools//tools/cpp:BUILD.empty.tpl",
@@ -148,12 +153,14 @@ def cc_configure():
cc_autoconf_toolchains(name = "local_config_cc_toolchains")
cc_autoconf(name = "local_config_cc")
native.bind(name = "cc_toolchain", actual = "@local_config_cc//:toolchain")
+ print('cc_configure does register')
native.register_toolchains(
# Use register_toolchain's target pattern expansion to register all toolchains in the package.
"@local_config_cc_toolchains//:all",
)
def _cc_configure_extension_impl(ctx):
+ print('cc_configure_extension does NOT register')
cc_autoconf_toolchains(name = "local_config_cc_toolchains")
cc_autoconf(name = "local_config_cc")
@@ -1,40 +0,0 @@
{ lib
, stdenv
, version
, src
, sourceRoot
, substituteAll
, defaultShellPath
, bazelRC
, enableNixHacks
, coreutils
, CoreFoundation
, CoreServices
, Foundation
, IOKit
, libcxx
, cctools
, sigtool
, bash
, python3
, buildJdk
, unzip
, zip
, ...
}:
stdenv.mkDerivation {
name = "bazel-patched-sources";
inherit version;
inherit src;
dontBuild = true;
nativeBuildInputs = [ zip unzip ];
installPhase = ''
mkdir $out
cp -r . $out
'';
}
@@ -1,218 +0,0 @@
[
"0a8003b044294d7840ac7d9d73eef05d6ceb682d7516781a4ec62eeb34702578",
"sha256-CoADsEQpTXhArH2dc+7wXWzraC11FngaTsYu6zRwJXg=",
"0a4c735bb80e342d418c0ef7d2add7793aaf72b91c449bde2769ea81f1869737",
"sha256-CkxzW7gONC1BjA730q3XeTqvcrkcRJveJ2nqgfGGlzc=",
"0d830380ec66bd7e25eee63aa0a5a08578e46ad187fb72d99b44d9ba22827f91",
"sha256-DYMDgOxmvX4l7uY6oKWghXjkatGH+3LZm0TZuiKCf5E=",
"0ea47b5ba23ca1da8eb9146c8fc755c1271414633b1e2be2ce1df764ba0fff2a",
"sha256-DqR7W6I8odqOuRRsj8dVwScUFGM7Hivizh33ZLoP/yo=",
"1b49a7bcbcc595fe1123a5c069816ae31efe6a9625b15dd6fa094f7ff439175e",
"sha256-G0mnvLzFlf4RI6XAaYFq4x7+apYlsV3W+glPf/Q5F14=",
"1dee0481072d19c929b623e155e14d2f6085dc011529a0a0dbefc84cf571d865",
"sha256-He4EgQctGckptiPhVeFNL2CF3AEVKaCg2+/ITPVx2GU=",
"1e490b98005664d149b379a9529a6aa05932b8a11b76b4cd86f3d22d76346f47",
"sha256-HkkLmABWZNFJs3mpUppqoFkyuKEbdrTNhvPSLXY0b0c=",
"1ef5535a8bd41cf3072469f381b9ee6ab28275311a7499f53d6e52adf976fef0",
"sha256-HvVTWovUHPMHJGnzgbnuarKCdTEadJn1PW5Srfl2/vA=",
"1fc4964236b67cf3c5651d7ac1dff668f73b7810c7f1dc0862a0e5bc01608785",
"sha256-H8SWQja2fPPFZR16wd/2aPc7eBDH8dwIYqDlvAFgh4U=",
"2a51593342a2ee4f8f1b946dc48d06b02d0721493238e4ae83d1ad66f8b0c9f4",
"sha256-KlFZM0Ki7k+PG5RtxI0GsC0HIUkyOOSug9GtZviwyfQ=",
"2b70cdfa8c9e997b4007035a266c273c0df341f9c57c9d0b45a680ae3fd882db",
"sha256-K3DN+oyemXtABwNaJmwnPA3zQfnFfJ0LRaaArj/Ygts=",
"2ac5f7fbefa0b73ef783889069344d5515505a14b2303be693c5002c486df2b4",
"sha256-KsX3+++gtz73g4iQaTRNVRVQWhSyMDvmk8UALEht8rQ=",
"2f25841c937e24959a57b630e2c4b8525b3d0f536f2e511c9b2bed30b1651d54",
"sha256-LyWEHJN+JJWaV7Yw4sS4Uls9D1NvLlEcmyvtMLFlHVQ=",
"2fb9007e12f768e9c968f9db292be4ea9cba2ef40fb8d179f3f8746ebdc73c1b",
"sha256-L7kAfhL3aOnJaPnbKSvk6py6LvQPuNF58/h0br3HPBs=",
"3ea995b55a4068be22989b70cc29a4d788c2d328d1d50613a7a9afd13fdd2d0a",
"sha256-PqmVtVpAaL4imJtwzCmk14jC0yjR1QYTp6mv0T/dLQo=",
"3a561c99e7bdbe9173aa653fd579fe849f1d8d67395780ab4770b1f381431d51",
"sha256-OlYcmee9vpFzqmU/1Xn+hJ8djWc5V4CrR3Cx84FDHVE=",
"4e5f563ae14ed713381816d582f5fcfd0615aefb29203486cdfb782d8a00a02b",
"sha256-Tl9WOuFO1xM4GBbVgvX8/QYVrvspIDSGzft4LYoAoCs=",
"4ae44dd05b49a1109a463c0d2aaf920c24f76d1e996bb89f29481c4ff75ec526",
"sha256-SuRN0FtJoRCaRjwNKq+SDCT3bR6Za7ifKUgcT/dexSY=",
"5a76c3d401c984999d59868f08df05a15613d1428f7764fed80b722e2a277f6c",
"sha256-WnbD1AHJhJmdWYaPCN8FoVYT0UKPd2T+2AtyLionf2w=",
"4fccff8382aafc589962c4edb262f6aa595e34f1e11e61057d1c6a96e8fc7323",
"sha256-T8z/g4Kq/FiZYsTtsmL2qlleNPHhHmEFfRxqluj8cyM=",
"5a725b777976b77aa122b707d1b6f0f39b6020f66cd427bb111a585599c857b1",
"sha256-WnJbd3l2t3qhIrcH0bbw85tgIPZs1Ce7ERpYVZnIV7E=",
"5bb6b0253ccf64b53d6c7249625a7e3f6c3bc6402abd52d3778bfa48258703a0",
"sha256-W7awJTzPZLU9bHJJYlp+P2w7xkAqvVLTd4v6SCWHA6A=",
"5bc8365613fe2f8ce6cc33959b7667b13b7fe56cb9d16ba740c06e1a7c4242fc",
"sha256-W8g2VhP+L4zmzDOVm3ZnsTt/5Wy50WunQMBuGnxCQvw=",
"5efa9fbb54a58b1a12205a5fac565f6982abfeb0ff45bdbc318748ef5fd3a3ff",
"sha256-Xvqfu1SlixoSIFpfrFZfaYKr/rD/Rb28MYdI71/To/8=",
"6c4e993c28cf2882964cac82a0f96e81a325840043884526565017b2f62c5ba4",
"sha256-bE6ZPCjPKIKWTKyCoPlugaMlhABDiEUmVlAXsvYsW6Q=",
"6ab68b0a3bb3834af44208df058be4631425b56ef95f9b9412aa21df3311e8d3",
"sha256-araLCjuzg0r0QgjfBYvkYxQltW75X5uUEqoh3zMR6NM=",
"6d472ee6d2b60ef3f3e6801e7cd4dbec5fbbef81e883a0de1fbc55e6defe1cb7",
"sha256-bUcu5tK2DvPz5oAefNTb7F+774Hog6DeH7xV5t7+HLc=",
"8a9b54d3506a3b92ee46b217bcee79196b21ca6d52dc2967c686a205fb2f9c15",
"sha256-iptU01BqO5LuRrIXvO55GWshym1S3ClnxoaiBfsvnBU=",
"007c7d9c378df02d390567d0d7ddf542ffddb021b7313dbf502392113ffabb08",
"sha256-AHx9nDeN8C05BWfQ1931Qv/dsCG3MT2/UCOSET/6uwg=",
"8b0862cad85b9549f355fe383c6c63816d2f19529634e033ae06d0107ab110b9",
"sha256-iwhiythblUnzVf44PGxjgW0vGVKWNOAzrgbQEHqxELk=",
"8d784075bec0b7c55042c109a4de8923b3b6d2ebd2e00912d518f07240f9c23a",
"sha256-jXhAdb7At8VQQsEJpN6JI7O20uvS4AkS1RjwckD5wjo=",
"8f9ee2dc10c1ae514ee599a8b42ed99fa262b757058f65ad3c384289ff70c4b8",
"sha256-j57i3BDBrlFO5ZmotC7Zn6Jit1cFj2WtPDhCif9wxLg=",
"21af30c92267bd6122c0e0b4d20cccb6641a37eaf956c6540ec471d584e64a7b",
"sha256-Ia8wySJnvWEiwOC00gzMtmQaN+r5VsZUDsRx1YTmSns=",
"30dba0a651fd5fba8fcae81f92938c590230300f9265ea849f431494f7f92c16",
"sha256-MNugplH9X7qPyugfkpOMWQIwMA+SZeqEn0MUlPf5LBY=",
"50f11b09f877c294d56f24463f47d28f929cf5044f648661c0f0cfbae9a2f49c",
"sha256-UPEbCfh3wpTVbyRGP0fSj5Kc9QRPZIZhwPDPuumi9Jw=",
"54e5be675e5c2ab0958647fcaa35c14bd8f7c08358c634f5ab786e4ed7268576",
"sha256-VOW+Z15cKrCVhkf8qjXBS9j3wINYxjT1q3huTtcmhXY=",
"82ca0e08171846d1768d5ac3f13244d6fe5a54102c14735ef40bf15d57d478e5",
"sha256-gsoOCBcYRtF2jVrD8TJE1v5aVBAsFHNe9AvxXVfUeOU=",
"84ee23b7989d4bf19930b5bd3d03c0f2efb9e73bcee3a0208a9d1b2e1979c049",
"sha256-hO4jt5idS/GZMLW9PQPA8u+55zvO46Agip0bLhl5wEk=",
"91ac87d30cc6d79f9ab974c51874a704de9c2647c40f6932597329a282217ba8",
"sha256-kayH0wzG15+auXTFGHSnBN6cJkfED2kyWXMpooIhe6g=",
"117a1227cdaf813a20a1bba78a9f2d8fb30841000c33e2f2d2a640bd224c9282",
"sha256-EXoSJ82vgTogobunip8tj7MIQQAMM+Ly0qZAvSJMkoI=",
"153fa3cdc153ac3ee25649e8037aeda4438256153d35acf3c27e83e4ee6165a4",
"sha256-FT+jzcFTrD7iVknoA3rtpEOCVhU9Nazzwn6D5O5hZaQ=",
"193edf97aefa28b93c5892bdc598bac34fa4c396588030084f290b1440e8b98a",
"sha256-GT7fl676KLk8WJK9xZi6w0+kw5ZYgDAITykLFEDouYo=",
"211b306cfc44f8f96df3a0a3ddaf75ba8c5289eed77d60d72f889bb855f535e5",
"sha256-IRswbPxE+Plt86Cj3a91uoxSie7XfWDXL4ibuFX1NeU=",
"261be84be30a56994e132d718a85efcd579197a2edb9426b84c5722c56955eca",
"sha256-JhvoS+MKVplOEy1xioXvzVeRl6LtuUJrhMVyLFaVXso=",
"443bb316599fb16e3baeba2fb58881814d7ff0b7af176fe76e38071a6e86f8c0",
"sha256-RDuzFlmfsW47rrovtYiBgU1/8LevF2/nbjgHGm6G+MA=",
"453fe595c3e12b9228b930b845140aaed93a9fb87d1a5d829c55b31d670def9f",
"sha256-RT/llcPhK5IouTC4RRQKrtk6n7h9Gl2CnFWzHWcN758=",
"685de33b53eb313049bbeee7f4b7a80dd09e8e754e96b048a3edab2cebb36442",
"sha256-aF3jO1PrMTBJu+7n9LeoDdCejnVOlrBIo+2rLOuzZEI=",
"725c26b4dd58a1aa782020952ad949bdb607235dd20ee49e5a5875c15456ca86",
"sha256-clwmtN1Yoap4ICCVKtlJvbYHI13SDuSeWlh1wVRWyoY=",
"766ad2a0783f2687962c8ad74ceecc38a28b9f72a2d085ee438b7813e928d0c7",
"sha256-dmrSoHg/JoeWLIrXTO7MOKKLn3Ki0IXuQ4t4E+ko0Mc=",
"878fbe521731c072d14d2d65b983b1beae6ad06fda0007b6a8bae81f73f433c4",
"sha256-h4++UhcxwHLRTS1luYOxvq5q0G/aAAe2qLroH3P0M8Q=",
"914ce84508410ee1419514925f93b1855a9f7a7b5b5d02fc07f411d2a45f1bba",
"sha256-kUzoRQhBDuFBlRSSX5OxhVqfentbXQL8B/QR0qRfG7o=",
"990c378168dc6364c6ff569701f4f2f122fffe8998b3e189eba4c4d868ed1084",
"sha256-mQw3gWjcY2TG/1aXAfTy8SL//omYs+GJ66TE2GjtEIQ=",
"2067b788d4c1c96fd621ad861053a5c4d8a801cfafc77fec20d49a6e9340a745",
"sha256-IGe3iNTByW/WIa2GEFOlxNioAc+vx3/sINSabpNAp0U=",
"2220f02fcfc480e3798bab43b2618d158319f9fcb357c9eb04b4a68117699808",
"sha256-IiDwL8/EgON5i6tDsmGNFYMZ+fyzV8nrBLSmgRdpmAg=",
"2744ccc1bbd653c9f65f5764ab211f51cae56aa6c2e2288850a9add9c805be56",
"sha256-J0TMwbvWU8n2X1dkqyEfUcrlaqbC4iiIUKmt2cgFvlY=",
"4531deccb913639c30e5c7512a054d5d875698daeb75d8cf90f284375fe7c360",
"sha256-RTHezLkTY5ww5cdRKgVNXYdWmNrrddjPkPKEN1/nw2A=",
"5493a21f5ed3fc502e66fec6b9449c06a551ced63002fa48903c40dfa8de7a4a",
"sha256-VJOiH17T/FAuZv7GuUScBqVRztYwAvpIkDxA36jeeko=",
"6436f19cef264fd949fb7a41e11424e373aa3b1096cad0b7e518f1c81aa60f23",
"sha256-ZDbxnO8mT9lJ+3pB4RQk43OqOxCWytC35RjxyBqmDyM=",
"8923a73ba8a373f7b994906f5902ba9f6bb59d181d4ad01576a6e0c5abb09b67",
"sha256-iSOnO6ijc/e5lJBvWQK6n2u1nRgdStAVdqbgxauwm2c=",
"23722fa366ba017137a68c5e92fc3ee27bbb341c681ac4790f61c6adb7289e26",
"sha256-I3Ivo2a6AXE3poxekvw+4nu7NBxoGsR5D2HGrbconiY=",
"366009a43cfada35015e4cc40a7efc4b7f017c6b8df5cac3f87d2478027b2056",
"sha256-NmAJpDz62jUBXkzECn78S38BfGuN9crD+H0keAJ7IFY=",
"748677bebb1651a313317dfd93e984ed8f8c9e345538fa8b0ab0cbb804631953",
"sha256-dIZ3vrsWUaMTMX39k+mE7Y+MnjRVOPqLCrDLuARjGVM=",
"774165a1c4dbaacb17f9c1ad666b3569a6a59715ae828e7c3d47703f479a53e7",
"sha256-d0FlocTbqssX+cGtZms1aaallxWugo58PUdwP0eaU+c=",
"320366665d19027cda87b2368c03939006a37e0388bfd1091c8d2a96fbc93bd8",
"sha256-MgNmZl0ZAnzah7I2jAOTkAajfgOIv9EJHI0qlvvJO9g=",
"810232374e76a954949f0e2185cd7d9515addb918cf3da3481f77e07c356b49a",
"sha256-gQIyN052qVSUnw4hhc19lRWt25GM89o0gfd+B8NWtJo=",
"a5a78019bc1cd43dbc3c7b7cdd3801912ca26d1f498fb560514fee497864ba96",
"sha256-paeAGbwc1D28PHt83TgBkSyibR9Jj7VgUU/uSXhkupY=",
"2044542933fcdf40ad18441bec37646d150c491871157f288847e29cb81de4cb",
"sha256-IERUKTP830CtGEQb7DdkbRUMSRhxFX8oiEfinLgd5Ms=",
"a136d3dce67168d88751115fa223bec80eae6cc062aa2f8173e8344a98235ec4",
"sha256-oTbT3OZxaNiHURFfoiO+yA6ubMBiqi+Bc+g0SpgjXsQ=",
"a42edc9cab792e39fe39bb94f3fca655ed157ff87a8af78e1d6ba5b07c4a00ab",
"sha256-pC7cnKt5Ljn+ObuU8/ymVe0Vf/h6iveOHWulsHxKAKs=",
"a171ee4c734dd2da837e4b16be9df4661afab72a41adaf31eb84dfdaf936ca26",
"sha256-oXHuTHNN0tqDfksWvp30Zhr6typBra8x64Tf2vk2yiY=",
"aa11ecd5fc0af2769f0f2bdd25e2f4de7c1291ed24326fb23fa69bdd5dcae2b5",
"sha256-qhHs1fwK8nafDyvdJeL03nwSke0kMm+yP6ab3V3K4rU=",
"a827c49183f3a632277d27a0a4673686cb341507447b9d570261094bd748aa68",
"sha256-qCfEkYPzpjInfSegpGc2hss0FQdEe51XAmEJS9dIqmg=",
"aabf9bd23091a4ebfc109c1f3ee7cf3e4b89f6ba2d3f51c5243f16b3cffae011",
"sha256-qr+b0jCRpOv8EJwfPufPPkuJ9rotP1HFJD8Ws8/64BE=",
"ae46b722a8b8e9b62170f83bfb040cbf12adb732144e689985a66b26410a7d6f",
"sha256-rka3Iqi46bYhcPg7+wQMvxKttzIUTmiZhaZrJkEKfW8=",
"ae63be5fe345ffdd5157284d90b783138eb31634e274182a8495242f9ad66a56",
"sha256-rmO+X+NF/91RVyhNkLeDE46zFjTidBgqhJUkL5rWalY=",
"aeb8d7a1361aa3d8f5a191580fa7f8cbc5ceb53137a4a698590f612f791e2c45",
"sha256-rrjXoTYao9j1oZFYD6f4y8XOtTE3pKaYWQ9hL3keLEU=",
"b5ecd1483e041197012786f749968a62063c1964d3ecfbf96ba92a95797bb8f5",
"sha256-tezRSD4EEZcBJ4b3SZaKYgY8GWTT7Pv5a6kqlXl7uPU=",
"b8a1527901774180afc798aeb28c4634bdccf19c4d98e7bdd1ce79d1fe9aaad7",
"sha256-uKFSeQF3QYCvx5iusoxGNL3M8ZxNmOe90c550f6aqtc=",
"b9d4fe4d71938df38839f0eca42aaaa64cf8b313d678da036f0cb3ca199b47f5",
"sha256-udT+TXGTjfOIOfDspCqqpkz4sxPWeNoDbwyzyhmbR/U=",
"b372a037d4230aa57fbeffdef30fd6123f9c0c2db85d0aced00c91b974f33f99",
"sha256-s3KgN9QjCqV/vv/e8w/WEj+cDC24XQrO0AyRuXTzP5k=",
"ba734e1e84c09d615af6a09d33034b4f0442f8772dec120efb376d86a565ae15",
"sha256-unNOHoTAnWFa9qCdMwNLTwRC+Hct7BIO+zdthqVlrhU=",
"bb529ba133c0256df49139bd403c17835edbf60d2ecd6463549c6a5fe279364d",
"sha256-u1KboTPAJW30kTm9QDwXg17b9g0uzWRjVJxqX+J5Nk0=",
"be4ce53138a238bb522cd781cf91f3ba5ce2f6ca93ec62d46a162a127225e0a6",
"sha256-vkzlMTiiOLtSLNeBz5Hzulzi9sqT7GLUahYqEnIl4KY=",
"c7bec54b7b5588b5967e870341091c5691181d954cf2039f1bf0a6eeb837473b",
"sha256-x77FS3tViLWWfocDQQkcVpEYHZVM8gOfG/Cm7rg3Rzs=",
"c96d60551331a196dac54b745aa642cd078ef89b6f267146b705f2c2cbef052d",
"sha256-yW1gVRMxoZbaxUt0WqZCzQeO+JtvJnFGtwXywsvvBS0=",
"cb852272c1cb0c8449d8b1a70f3e0f2c1efb2063e543183faa43078fb446f540",
"sha256-y4UicsHLDIRJ2LGnDz4PLB77IGPlQxg/qkMHj7RG9UA=",
"cf7f71eaff90b24c1a28b49645a9ff03a9a6c1e7134291ce70901cb63e7364b5",
"sha256-z39x6v+QskwaKLSWRan/A6mmwecTQpHOcJActj5zZLU=",
"d76b9afea61c7c082908023f0cbc1427fab9abd2df915c8b8a3e7a509bccbc6d",
"sha256-12ua/qYcfAgpCAI/DLwUJ/q5q9LfkVyLij56UJvMvG0=",
"d96cc09045a1341c6d47494352aa263b87b72fb1d2ea9eca161aa73820bfe8bb",
"sha256-2WzAkEWhNBxtR0lDUqomO4e3L7HS6p7KFhqnOCC/6Ls=",
"dc3fb206a2cb3441b485eb1e423165b231235a1ea9b031b4433cf7bc1fa460dd",
"sha256-3D+yBqLLNEG0heseQjFlsjEjWh6psDG0Qzz3vB+kYN0=",
"dacf78ce78ab2d29570325db4cd2451ea589639807de95881a0fa7155a9e6b55",
"sha256-2s94znirLSlXAyXbTNJFHqWJY5gH3pWIGg+nFVqea1U=",
"e04ba5195bcd555dc95650f7cc614d151e4bcd52d29a10b8aa2197f3ab89ab9b",
"sha256-4EulGVvNVV3JVlD3zGFNFR5LzVLSmhC4qiGX86uJq5s=",
"de69a09dc70417580aabf20a28619bb3ef60d038470c7cf8442fafcf627c21cb",
"sha256-3mmgnccEF1gKq/IKKGGbs+9g0DhHDHz4RC+vz2J8Ics=",
"e47edfb2ceaf43fc699e20c179ec428b6f3e497cf8e2dcd8e9c936d4b96b1e56",
"sha256-5H7fss6vQ/xpniDBeexCi28+SXz44tzY6ck21LlrHlY=",
"e59770b66e81822e5d111ac4e544d7eb0c543e0a285f52628e53941acd8ed759",
"sha256-5Zdwtm6Bgi5dERrE5UTX6wxUPgooX1JijlOUGs2O11k=",
"ec76c5e79db59762776bece58b69507d095856c37b81fd35bfb0958e74b61d93",
"sha256-7HbF5521l2J3a+zli2lQfQlYVsN7gf01v7CVjnS2HZM=",
"ec92dae810034f4b46dbb16ef4364a4013b0efb24a8c5dd67435cae46a290d8e",
"sha256-7JLa6BADT0tG27Fu9DZKQBOw77JKjF3WdDXK5GopDY4=",
"eede807f0dd5eb1ad74ea1ae1094430631da63fcde00d4dc20eb0cd048bb0ac3",
"sha256-7t6Afw3V6xrXTqGuEJRDBjHaY/zeANTcIOsM0Ei7CsM=",
"eca21884e6f66a88c358e580fd67a6b148d30ab57b1680f62a96c00f9bc6a07e",
"sha256-7KIYhOb2aojDWOWA/WemsUjTCrV7FoD2KpbAD5vGoH4=",
"eeeae917917144a68a741d4c0dff66aa5c5c5fd85593ff217bced3fc8ca783b8",
"sha256-7urpF5FxRKaKdB1MDf9mqlxcX9hVk/8he87T/Iyng7g=",
"f43f29fe2a6ebaf04b2598cdeec32a4e346d49a9404e990f5fc19c19f3a28d0e",
"sha256-9D8p/ipuuvBLJZjN7sMqTjRtSalATpkPX8GcGfOijQ4=",
"f86fd42a809e1871ca0aabe89db0d440451219c3ce46c58da240c7dcdc00125f",
"sha256-+G/UKoCeGHHKCqvonbDUQEUSGcPORsWNokDH3NwAEl8=",
"f87a502f3d257bc41f80bd0b90c19e6b4a48d0600fb26e7b5d6c2c675680fa0e",
"sha256-+HpQLz0le8QfgL0LkMGea0pI0GAPsm57XWwsZ1aA+g4=",
"f195cd6228d3f99fa7e30ff2dee60ad0f2c7923be31399a7dcdc1abd679aa22e",
"sha256-8ZXNYijT+Z+n4w/y3uYK0PLHkjvjE5mn3NwavWeaoi4=",
"fa5469f4c44ee598a2d8f033ab0a9dcbc6498a0c5e0c998dfa0c2adf51358044",
"sha256-+lRp9MRO5Zii2PAzqwqdy8ZJigxeDJmN+gwq31E1gEQ=",
"f1474d47f4b6b001558ad27b952e35eda5cc7146788877fc52938c6eba24b382",
"sha256-8UdNR/S2sAFVitJ7lS417aXMcUZ4iHf8UpOMbroks4I=",
"ff2d59fad74e867630fbc7daab14c432654712ac624dbee468d220677b124dd5",
"sha256-/y1Z+tdOhnYw+8faqxTEMmVHEqxiTb7kaNIgZ3sSTdU=",
"ff5b3cd331ae8a9a804768280da98f50f424fef23dd3c788bb320e08c94ee598",
"sha256-/1s80zGuipqAR2goDamPUPQk/vI908eIuzIOCMlO5Zg="
]
@@ -1,12 +0,0 @@
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/bzlmod/GsonTypeAdapterUtil.java b/src/main/java/com/google/devtools/build/lib/bazel/bzlmod/GsonTypeAdapterUtil.java
index 05a54e2e05..6e22f10386 100644
--- a/src/main/java/com/google/devtools/build/lib/bazel/bzlmod/GsonTypeAdapterUtil.java
+++ b/src/main/java/com/google/devtools/build/lib/bazel/bzlmod/GsonTypeAdapterUtil.java
@@ -362,6 +362,7 @@ public final class GsonTypeAdapterUtil {
public static Gson createLockFileGson(Path moduleFilePath) {
return new GsonBuilder()
.setPrettyPrinting()
+ .serializeNulls()
.disableHtmlEscaping()
.enableComplexMapKeySerialization()
.registerTypeAdapterFactory(GenerateTypeAdapter.FACTORY)
File diff suppressed because it is too large Load Diff
@@ -1,60 +0,0 @@
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/bzlmod/ModuleFileFunction.java b/src/main/java/com/google/devtools/build/lib/bazel/bzlmod/ModuleFileFunction.java
index 958669706c..dc27d3de26 100644
--- a/src/main/java/com/google/devtools/build/lib/bazel/bzlmod/ModuleFileFunction.java
+++ b/src/main/java/com/google/devtools/build/lib/bazel/bzlmod/ModuleFileFunction.java
@@ -52,6 +52,7 @@ import com.google.devtools.build.skyframe.SkyKey;
import com.google.devtools.build.skyframe.SkyValue;
import com.google.errorprone.annotations.FormatMethod;
import java.io.IOException;
+import java.io.*;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.List;
@@ -404,6 +405,7 @@ public class ModuleFileFunction implements SkyFunction {
GetModuleFileResult result = new GetModuleFileResult();
for (Registry registry : registryObjects) {
try {
+ System.out.println("Trying to find module " + key + " in " + registry.getUrl());
Optional<ModuleFile> moduleFile = registry.getModuleFile(key, env.getListener());
if (moduleFile.isEmpty()) {
continue;
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/repository/cache/RepositoryCache.java b/src/main/java/com/google/devtools/build/lib/bazel/repository/cache/RepositoryCache.java
index 07bc071655..0ee990e0f4 100644
--- a/src/main/java/com/google/devtools/build/lib/bazel/repository/cache/RepositoryCache.java
+++ b/src/main/java/com/google/devtools/build/lib/bazel/repository/cache/RepositoryCache.java
@@ -27,6 +27,7 @@ import com.google.devtools.build.lib.vfs.Path;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
+import java.io.*;
import java.util.UUID;
import javax.annotation.Nullable;
@@ -166,6 +167,7 @@ public class RepositoryCache {
assertKeyIsValid(cacheKey, keyType);
if (!exists(cacheKey, keyType)) {
+ System.out.println("Cache lookup failed for " + keyType + " key " + cacheKey);
return null;
}
diff --git a/src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryDelegatorFunction.java b/src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryDelegatorFunction.java
index a8e2a08145..fcbe05fcea 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryDelegatorFunction.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryDelegatorFunction.java
@@ -48,6 +48,7 @@ import com.google.devtools.build.skyframe.SkyFunctionException.Transience;
import com.google.devtools.build.skyframe.SkyKey;
import com.google.devtools.build.skyframe.SkyValue;
import java.io.IOException;
+import java.io.*;
import java.nio.charset.StandardCharsets;
import java.util.Map;
import java.util.Optional;
@@ -345,6 +346,7 @@ public final class RepositoryDelegatorFunction implements SkyFunction {
if (!repoRoot.exists()) {
// The repository isn't on the file system, there is nothing we can do.
+ System.out.println("Failed to find repo " + repositoryName.getNameWithAt());
throw new RepositoryFunctionException(
new IOException(
"to fix, run\n\tbazel fetch //...\nExternal repository "
@@ -1,157 +0,0 @@
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/platform/DeclaredToolchainInfo.java b/src/main/java/com/google/devtools/build/lib/analysis/platform/DeclaredToolchainInfo.java
index fa322cf6f0..4a94087a3c 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/platform/DeclaredToolchainInfo.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/platform/DeclaredToolchainInfo.java
@@ -47,6 +47,9 @@ public abstract class DeclaredToolchainInfo implements TransitiveInfoProvider {
/** The label of the toolchain to resolve for use in toolchain-aware rules. */
public abstract Label toolchainLabel();
+ /** The label of the toolchain native rule invocation, for debugging. */
+ public abstract Label label();
+
/** Builder class to assist in creating {@link DeclaredToolchainInfo} instances. */
public static class Builder {
private ToolchainTypeInfo toolchainType;
@@ -55,6 +58,7 @@ public abstract class DeclaredToolchainInfo implements TransitiveInfoProvider {
private ImmutableList.Builder<ConfigMatchingProvider> targetSettings =
new ImmutableList.Builder<>();
private Label toolchainLabel;
+ private Label label;
/** Sets the type of the toolchain being declared. */
@CanIgnoreReturnValue
@@ -100,6 +104,13 @@ public abstract class DeclaredToolchainInfo implements TransitiveInfoProvider {
return this;
}
+ /** Sets the label of the toolchain to resolve for use in toolchain-aware rules. */
+ @CanIgnoreReturnValue
+ public Builder label(Label label) {
+ this.label = label;
+ return this;
+ }
+
/** Returns the newly created {@link DeclaredToolchainInfo} instance. */
public DeclaredToolchainInfo build() throws DuplicateConstraintException {
// Handle constraint duplication in attributes separately, so they can be reported correctly.
@@ -128,7 +139,8 @@ public abstract class DeclaredToolchainInfo implements TransitiveInfoProvider {
execConstraints,
targetConstraints,
targetSettings.build(),
- toolchainLabel);
+ toolchainLabel,
+ label);
}
}
diff --git a/src/main/java/com/google/devtools/build/lib/rules/platform/Toolchain.java b/src/main/java/com/google/devtools/build/lib/rules/platform/Toolchain.java
index 16d14a5edd..93ad4e47ec 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/platform/Toolchain.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/platform/Toolchain.java
@@ -57,6 +57,7 @@ public class Toolchain implements RuleConfiguredTargetFactory {
.collect(toImmutableList());
Label toolchainLabel =
ruleContext.attributes().get(ToolchainRule.TOOLCHAIN_ATTR, BuildType.NODEP_LABEL);
+ Label label = ruleContext.getLabel();
DeclaredToolchainInfo registeredToolchain;
try {
@@ -67,6 +68,7 @@ public class Toolchain implements RuleConfiguredTargetFactory {
.addTargetConstraints(targetConstraints)
.addTargetSettings(targetSettings)
.toolchainLabel(toolchainLabel)
+ .label(label)
.build();
} catch (DeclaredToolchainInfo.DuplicateConstraintException e) {
if (e.execConstraintsException() != null) {
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/toolchains/SingleToolchainResolutionFunction.java b/src/main/java/com/google/devtools/build/lib/skyframe/toolchains/SingleToolchainResolutionFunction.java
index 933c200471..5c61ebcb12 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/toolchains/SingleToolchainResolutionFunction.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/toolchains/SingleToolchainResolutionFunction.java
@@ -182,11 +182,12 @@ public class SingleToolchainResolutionFunction implements SkyFunction {
if (!nonmatchingSettings.isEmpty()) {
debugMessage(
eventHandler,
- " Type %s: %s platform %s: Rejected toolchain %s; mismatching config settings: %s",
+ " Type %s: %s platform %s: Rejected toolchain %s (from %s); mismatching config settings: %s",
toolchainType.toolchainType(),
"target",
targetPlatform.label(),
toolchain.toolchainLabel(),
+ toolchain.label(),
String.join(", ", nonmatchingSettings));
continue;
}
@@ -198,7 +199,8 @@ public class SingleToolchainResolutionFunction implements SkyFunction {
"target",
targetPlatform,
toolchainType,
- toolchain.toolchainLabel())) {
+ toolchain.toolchainLabel(),
+ toolchain.label())) {
continue;
}
@@ -208,12 +210,13 @@ public class SingleToolchainResolutionFunction implements SkyFunction {
if (platformKeysSeen.contains(executionPlatformKey)) {
debugMessage(
eventHandler,
- " Type %s: target platform %s: execution platform %s: Skipping toolchain %s;"
+ " Type %s: target platform %s: execution platform %s: Skipping toolchain %s (from %s);"
+ " execution platform already has selected toolchain",
toolchainType.toolchainType(),
targetPlatform.label(),
executionPlatformKey.getLabel(),
- toolchain.toolchainLabel());
+ toolchain.toolchainLabel(),
+ toolchain.label());
continue;
}
@@ -224,17 +227,19 @@ public class SingleToolchainResolutionFunction implements SkyFunction {
"execution",
executionPlatform,
toolchainType,
- toolchain.toolchainLabel())) {
+ toolchain.toolchainLabel(),
+ toolchain.label())) {
continue;
}
debugMessage(
eventHandler,
- " Type %s: target platform %s: execution %s: Selected toolchain %s",
+ " Type %s: target platform %s: execution %s: Selected toolchain %s (from %s)",
toolchainType.toolchainType(),
targetPlatform.label(),
executionPlatformKey.getLabel(),
- toolchain.toolchainLabel());
+ toolchain.toolchainLabel(),
+ toolchain.label());
builder.put(executionPlatformKey, toolchain.toolchainLabel());
platformKeysSeen.add(executionPlatformKey);
}
@@ -276,7 +281,8 @@ public class SingleToolchainResolutionFunction implements SkyFunction {
String platformType,
PlatformInfo platform,
ToolchainTypeRequirement toolchainType,
- Label toolchainLabel) {
+ Label toolchainLabel,
+ Label label) {
// Check every constraint_setting in either the toolchain or the platform.
ImmutableSet<ConstraintSettingInfo> mismatchSettings =
@@ -315,11 +321,12 @@ public class SingleToolchainResolutionFunction implements SkyFunction {
}
debugMessage(
eventHandler,
- " Type %s: %s platform %s: Rejected toolchain %s%s%s",
+ " Type %s: %s platform %s: Rejected toolchain %s (from %s)%s%s",
toolchainType.toolchainType(),
platformType,
platform.label(),
toolchainLabel,
+ label,
mismatchValues,
missingSettings);
}
@@ -1,271 +0,0 @@
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/toolchains/SingleToolchainResolutionFunction.java b/src/main/java/com/google/devtools/build/lib/skyframe/toolchains/SingleToolchainResolutionFunction.java
index 933c200471..1e5bbaa44b 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/toolchains/SingleToolchainResolutionFunction.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/toolchains/SingleToolchainResolutionFunction.java
@@ -32,7 +32,6 @@ import com.google.devtools.build.lib.analysis.platform.PlatformInfo;
import com.google.devtools.build.lib.analysis.platform.ToolchainTypeInfo;
import com.google.devtools.build.lib.cmdline.Label;
import com.google.devtools.build.lib.events.Event;
-import com.google.devtools.build.lib.events.EventHandler;
import com.google.devtools.build.lib.server.FailureDetails.Toolchain.Code;
import com.google.devtools.build.lib.skyframe.ConfiguredTargetKey;
import com.google.devtools.build.lib.skyframe.toolchains.PlatformLookupUtil.InvalidPlatformException;
@@ -91,14 +90,21 @@ public class SingleToolchainResolutionFunction implements SkyFunction {
.debugToolchainResolution(key.toolchainType().toolchainType());
// Find the right one.
- return resolveConstraints(
+ ArrayList<String> trace = debug ? new ArrayList<>() : null;
+ SingleToolchainResolutionValue toolchainResolution = resolveConstraints(
key.toolchainType(),
key.toolchainTypeInfo(),
key.availableExecutionPlatformKeys(),
key.targetPlatformKey(),
toolchains.registeredToolchains(),
env,
- debug ? env.getListener() : null);
+ trace);
+
+ if (debug) {
+ env.getListener().handle(Event.info(String.join("\n", trace)));
+ }
+
+ return toolchainResolution;
}
/**
@@ -114,7 +120,7 @@ public class SingleToolchainResolutionFunction implements SkyFunction {
ConfiguredTargetKey targetPlatformKey,
ImmutableList<DeclaredToolchainInfo> toolchains,
Environment env,
- @Nullable EventHandler eventHandler)
+ @Nullable List<String> trace)
throws ToolchainResolutionFunctionException, InterruptedException {
// Load the PlatformInfo needed to check constraints.
@@ -151,10 +157,20 @@ public class SingleToolchainResolutionFunction implements SkyFunction {
toolchain.toolchainType().typeLabel().equals(toolchainType.toolchainType()))
.collect(toImmutableList());
+ debugMessage(
+ trace,
+ "Performing resolution of %s for target platform %s",
+ toolchainType.toolchainType(),
+ targetPlatform.label());
+
for (DeclaredToolchainInfo toolchain : filteredToolchains) {
// Make sure the target setting matches but watch out for resolution errors.
ArrayList<String> nonmatchingSettings = new ArrayList<>();
ArrayList<String> errors = new ArrayList<>();
+ debugMessage(
+ trace,
+ " toolchain %s",
+ toolchain.toolchainLabel());
// TODO(blaze-configurability-team): If this pattern comes up more often, add a central
// facility for merging multiple MatchResult
@@ -181,11 +197,8 @@ public class SingleToolchainResolutionFunction implements SkyFunction {
}
if (!nonmatchingSettings.isEmpty()) {
debugMessage(
- eventHandler,
- " Type %s: %s platform %s: Rejected toolchain %s; mismatching config settings: %s",
- toolchainType.toolchainType(),
- "target",
- targetPlatform.label(),
+ trace,
+ " Rejected toolchain %s; mismatching config settings: %s",
toolchain.toolchainLabel(),
String.join(", ", nonmatchingSettings));
continue;
@@ -193,35 +206,36 @@ public class SingleToolchainResolutionFunction implements SkyFunction {
// Make sure the target platform matches.
if (!checkConstraints(
- eventHandler,
+ trace,
toolchain.targetConstraints(),
- "target",
+ " Rejected toolchain %1s%3s",
targetPlatform,
toolchainType,
toolchain.toolchainLabel())) {
continue;
}
+
+ debugMessage(
+ trace,
+ " Toolchain %s is compatible with target plaform, searching for execution platforms:",
+ toolchain.toolchainLabel());
// Find the matching execution platforms.
for (ConfiguredTargetKey executionPlatformKey : availableExecutionPlatformKeys) {
// Only check the toolchains if this is a new platform.
if (platformKeysSeen.contains(executionPlatformKey)) {
debugMessage(
- eventHandler,
- " Type %s: target platform %s: execution platform %s: Skipping toolchain %s;"
- + " execution platform already has selected toolchain",
- toolchainType.toolchainType(),
- targetPlatform.label(),
- executionPlatformKey.getLabel(),
- toolchain.toolchainLabel());
+ trace,
+ " Skipping execution platform %s; it has already selected a toolchain",
+ executionPlatformKey.getLabel());
continue;
}
PlatformInfo executionPlatform = platforms.get(executionPlatformKey);
if (!checkConstraints(
- eventHandler,
+ trace,
toolchain.execConstraints(),
- "execution",
+ " Incompatible execution platform %2s%3s",
executionPlatform,
toolchainType,
toolchain.toolchainLabel())) {
@@ -229,51 +243,64 @@ public class SingleToolchainResolutionFunction implements SkyFunction {
}
debugMessage(
- eventHandler,
- " Type %s: target platform %s: execution %s: Selected toolchain %s",
- toolchainType.toolchainType(),
- targetPlatform.label(),
- executionPlatformKey.getLabel(),
- toolchain.toolchainLabel());
+ trace,
+ " Compatible execution platform %s",
+ executionPlatformKey.getLabel());
builder.put(executionPlatformKey, toolchain.toolchainLabel());
platformKeysSeen.add(executionPlatformKey);
}
}
ImmutableMap<ConfiguredTargetKey, Label> resolvedToolchainLabels = builder.buildOrThrow();
- if (resolvedToolchainLabels.isEmpty()) {
- debugMessage(
- eventHandler,
- " Type %s: target platform %s: No toolchains found.",
- toolchainType.toolchainType(),
- targetPlatform.label());
+ if (trace != null) {
+ if (resolvedToolchainLabels.isEmpty()) {
+ debugMessage(
+ trace,
+ "No %s toolchain found for target platform %s.",
+ toolchainType.toolchainType(),
+ targetPlatform.label());
+ } else {
+ debugMessage(
+ trace,
+ "Recap of selected %s toolchains for target platform %s:",
+ toolchainType.toolchainType(),
+ targetPlatform.label());
+ resolvedToolchainLabels.forEach((executionPlatformKey, toolchainLabel) ->
+ debugMessage(
+ trace,
+ " Selected toolchain %s to run on exec platform %s",
+ toolchainLabel,
+ executionPlatformKey.getLabel())
+ );
+ }
}
return SingleToolchainResolutionValue.create(toolchainTypeInfo, resolvedToolchainLabels);
}
/**
- * Helper method to print a debugging message, if the given {@link EventHandler} is not {@code
+ * Helper method to print a debugging message, if the given {@link trace} is not {@code
* null}.
*/
@FormatMethod
private static void debugMessage(
- @Nullable EventHandler eventHandler, @FormatString String template, Object... args) {
- if (eventHandler == null) {
+ @Nullable List<String> trace, @FormatString String template, Object... args) {
+ if (trace == null) {
return;
}
- eventHandler.handle(Event.info("ToolchainResolution: " + String.format(template, args)));
+ trace.add(String.format(template, args));
}
/**
* Returns {@code true} iff all constraints set by the toolchain and in the {@link PlatformInfo}
* match.
*/
+ @SuppressWarnings("FormatStringAnnotation")
private static boolean checkConstraints(
- @Nullable EventHandler eventHandler,
+ @Nullable List<String> trace,
ConstraintCollection toolchainConstraints,
- String platformType,
+ String debugMessage,
PlatformInfo platform,
ToolchainTypeRequirement toolchainType,
Label toolchainLabel) {
@@ -295,7 +322,7 @@ public class SingleToolchainResolutionFunction implements SkyFunction {
.filter(toolchainConstraints::hasWithoutDefault)
.collect(ImmutableSet.toImmutableSet());
- if (!mismatchSettingsWithDefault.isEmpty()) {
+ if (trace != null && !mismatchSettingsWithDefault.isEmpty()) {
String mismatchValues =
mismatchSettingsWithDefault.stream()
.filter(toolchainConstraints::has)
@@ -314,14 +341,11 @@ public class SingleToolchainResolutionFunction implements SkyFunction {
missingSettings = "; missing: " + missingSettings;
}
debugMessage(
- eventHandler,
- " Type %s: %s platform %s: Rejected toolchain %s%s%s",
- toolchainType.toolchainType(),
- platformType,
- platform.label(),
+ trace,
+ debugMessage,
toolchainLabel,
- mismatchValues,
- missingSettings);
+ platform.label(),
+ mismatchValues + missingSettings);
}
return mismatchSettingsWithDefault.isEmpty();
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/toolchains/ToolchainResolutionFunction.java b/src/main/java/com/google/devtools/build/lib/skyframe/toolchains/ToolchainResolutionFunction.java
index 3bdf2d0b23..fea848eca0 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/toolchains/ToolchainResolutionFunction.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/toolchains/ToolchainResolutionFunction.java
@@ -80,14 +80,7 @@ public class ToolchainResolutionFunction implements SkyFunction {
Preconditions.checkNotNull(configuration.getFragment(PlatformConfiguration.class));
// Check if debug output should be generated.
- boolean debug =
- key.debugTarget()
- || configuration
- .getFragment(PlatformConfiguration.class)
- .debugToolchainResolution(
- key.toolchainTypes().stream()
- .map(ToolchainTypeRequirement::toolchainType)
- .collect(toImmutableSet()));
+ boolean debug = key.debugTarget();
// Load the configured target for the toolchain types to ensure that they are valid and
// resolve aliases.
@@ -138,9 +131,10 @@ public class ToolchainResolutionFunction implements SkyFunction {
.handle(
Event.info(
String.format(
- "ToolchainResolution: Target platform %s: Selected execution platform %s,"
+ "ToolchainResolution: Target platform %s (%s): Selected execution platform %s, "
+ " %s",
unloadedToolchainContext.targetPlatform().label(),
+ configuration,
unloadedToolchainContext.executionPlatform().label(),
selectedToolchains)));
}
@@ -1,54 +0,0 @@
#!/usr/bin/env python3
import sys
import json
if len(sys.argv) != 2:
print("usage: ./this-script src-deps.json < WORKSPACE", file=sys.stderr)
print("Takes the bazel WORKSPACE file and reads all archives into a json dict (by evaling it as python code)", file=sys.stderr)
print("Hail Eris.", file=sys.stderr)
sys.exit(1)
http_archives = []
# just the kw args are the dict { name, sha256, urls … }
def http_archive(**kw):
http_archives.append(kw)
# like http_file
def http_file(**kw):
http_archives.append(kw)
# this is inverted from http_archive/http_file and bundles multiple archives
def _distdir_tar(**kw):
for archive_name in kw['archives']:
http_archives.append({
"name": archive_name,
"sha256": kw['sha256'][archive_name],
"urls": kw['urls'][archive_name]
})
# TODO?
def git_repository(**kw):
print(json.dumps(kw, sort_keys=True, indent=4), file=sys.stderr)
sys.exit(1)
# execute the WORKSPACE like it was python code in this module,
# using all the function stubs from above.
exec(sys.stdin.read())
# transform to a dict with the names as keys
d = { el['name']: el for el in http_archives }
def has_urls(el):
return ('url' in el and el['url']) or ('urls' in el and el['urls'])
def has_sha256(el):
return 'sha256' in el and el['sha256']
bad_archives = list(filter(lambda el: not has_urls(el) or not has_sha256(el), d.values()))
if bad_archives:
print('Following bazel dependencies are missing url or sha256', file=sys.stderr)
print('Check bazel sources for master or non-checksummed dependencies', file=sys.stderr)
for el in bad_archives:
print(json.dumps(el, sort_keys=True, indent=4), file=sys.stderr)
sys.exit(1)
with open(sys.argv[1], "w") as f:
print(json.dumps(d, sort_keys=True, indent=4), file=f)