From b58d3cd6df767fbcf72e1398c9211b41ced0ced7 Mon Sep 17 00:00:00 2001 From: Michael Krasnyk Date: Tue, 7 Apr 2026 15:27:50 +0200 Subject: [PATCH] Fix symbols loading for Bazel v9 --- .github/workflows/ci.yml | 6 +- MODULE.bazel | 4 +- MODULE.bazel.lock | 81 +++----- examples/bzlmod/MODULE.bazel | 4 +- examples/gcc_version/MODULE.bazel | 4 +- examples/linkmap/MODULE.bazel | 4 +- examples/raspberry_pi/MODULE.bazel | 4 +- examples/workspace/WORKSPACE | 2 +- test/basic_cas.json | 304 ++++++++++++++++------------- toolchain/config.bzl | 3 + toolchain/transitions.bzl | 2 + 11 files changed, 214 insertions(+), 204 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 706a5f8..0f4a19d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,9 +21,9 @@ jobs: include: - os: ubuntu-latest target: "x86_64-unknown-linux-gnu" - - os: macos-13 + - os: macos-latest target: "x86_64-apple-darwin" - - os: macos-14 + - os: macos-latest target: "aarch64-apple-darwin" env: USE_BAZEL_VERSION: "7.x" @@ -65,7 +65,7 @@ jobs: - uses: actions/checkout@v2 - name: run nativelink run: | - cargo install --git https://github.com/TraceMachina/nativelink --tag v0.2.0 + cargo install nativelink --git https://github.com/TraceMachina/nativelink --tag v0.7.0 (nativelink test/basic_cas.json &) - name: remote execution run: | diff --git a/MODULE.bazel b/MODULE.bazel index 8b1c8f5..41c834c 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -6,8 +6,8 @@ module( compatibility_level = 1, ) -bazel_dep(name = "platforms", version = "0.0.8") -bazel_dep(name = "rules_cc", version = "0.0.9") +bazel_dep(name = "platforms", version = "1.0.0") +bazel_dep(name = "rules_cc", version = "0.2.17") bazel_dep(name = "bazel_skylib", version = "1.5.0") # DEV ONLY (not needed for release) diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index e03f760..eb0578b 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -19,7 +19,8 @@ "https://bcr.bazel.build/modules/bazel_features/1.18.0/MODULE.bazel": "1be0ae2557ab3a72a57aeb31b29be347bcdc5d2b1eb1e70f39e3851a7e97041a", "https://bcr.bazel.build/modules/bazel_features/1.19.0/MODULE.bazel": "59adcdf28230d220f0067b1f435b8537dd033bfff8db21335ef9217919c7fb58", "https://bcr.bazel.build/modules/bazel_features/1.21.0/MODULE.bazel": "675642261665d8eea09989aa3b8afb5c37627f1be178382c320d1b46afba5e3b", - "https://bcr.bazel.build/modules/bazel_features/1.21.0/source.json": "3e8379efaaef53ce35b7b8ba419df829315a880cb0a030e5bb45c96d6d5ecb5f", + "https://bcr.bazel.build/modules/bazel_features/1.28.0/MODULE.bazel": "4b4200e6cbf8fa335b2c3f43e1d6ef3e240319c33d43d60cc0fbd4b87ece299d", + "https://bcr.bazel.build/modules/bazel_features/1.28.0/source.json": "16a3fc5b4483cb307643791f5a4b7365fa98d2e70da7c378cdbde55f0c0b32cf", "https://bcr.bazel.build/modules/bazel_features/1.4.1/MODULE.bazel": "e45b6bb2350aff3e442ae1111c555e27eac1d915e77775f6fdc4b351b758b5d7", "https://bcr.bazel.build/modules/bazel_features/1.9.1/MODULE.bazel": "8f679097876a9b609ad1f60249c49d68bfab783dd9be012faf9d82547b14815a", "https://bcr.bazel.build/modules/bazel_skylib/1.0.3/MODULE.bazel": "bcb0fd896384802d1ad283b4e4eb4d718eebd8cb820b0a2c3a347fb971afd9d8", @@ -45,12 +46,13 @@ "https://bcr.bazel.build/modules/jsoncpp/1.9.5/source.json": "4108ee5085dd2885a341c7fab149429db457b3169b86eb081fa245eadf69169d", "https://bcr.bazel.build/modules/libpfm/4.11.0/MODULE.bazel": "45061ff025b301940f1e30d2c16bea596c25b176c8b6b3087e92615adbd52902", "https://bcr.bazel.build/modules/platforms/0.0.10/MODULE.bazel": "8cb8efaf200bdeb2150d93e162c40f388529a25852b332cec879373771e48ed5", - "https://bcr.bazel.build/modules/platforms/0.0.10/source.json": "f22828ff4cf021a6b577f1bf6341cb9dcd7965092a439f64fc1bb3b7a5ae4bd5", "https://bcr.bazel.build/modules/platforms/0.0.4/MODULE.bazel": "9b328e31ee156f53f3c416a64f8491f7eb731742655a47c9eec4703a71644aee", "https://bcr.bazel.build/modules/platforms/0.0.5/MODULE.bazel": "5733b54ea419d5eaf7997054bb55f6a1d0b5ff8aedf0176fef9eea44f3acda37", "https://bcr.bazel.build/modules/platforms/0.0.6/MODULE.bazel": "ad6eeef431dc52aefd2d77ed20a4b353f8ebf0f4ecdd26a807d2da5aa8cd0615", "https://bcr.bazel.build/modules/platforms/0.0.7/MODULE.bazel": "72fd4a0ede9ee5c021f6a8dd92b503e089f46c227ba2813ff183b71616034814", "https://bcr.bazel.build/modules/platforms/0.0.8/MODULE.bazel": "9f142c03e348f6d263719f5074b21ef3adf0b139ee4c5133e2aa35664da9eb2d", + "https://bcr.bazel.build/modules/platforms/1.0.0/MODULE.bazel": "f05feb42b48f1b3c225e4ccf351f367be0371411a803198ec34a389fb22aa580", + "https://bcr.bazel.build/modules/platforms/1.0.0/source.json": "f4ff1fd412e0246fd38c82328eb209130ead81d62dcd5a9e40910f867f733d96", "https://bcr.bazel.build/modules/protobuf/21.7/MODULE.bazel": "a5a29bb89544f9b97edce05642fac225a808b5b7be74038ea3640fae2f8e66a7", "https://bcr.bazel.build/modules/protobuf/27.0/MODULE.bazel": "7873b60be88844a0a1d8f80b9d5d20cfbd8495a689b8763e76c6372998d3f64c", "https://bcr.bazel.build/modules/protobuf/27.1/MODULE.bazel": "703a7b614728bb06647f965264967a8ef1c39e09e8f167b3ca0bb1fd80449c0d", @@ -70,11 +72,12 @@ "https://bcr.bazel.build/modules/rules_cc/0.0.14/MODULE.bazel": "5e343a3aac88b8d7af3b1b6d2093b55c347b8eefc2e7d1442f7a02dc8fea48ac", "https://bcr.bazel.build/modules/rules_cc/0.0.15/MODULE.bazel": "6704c35f7b4a72502ee81f61bf88706b54f06b3cbe5558ac17e2e14666cd5dcc", "https://bcr.bazel.build/modules/rules_cc/0.0.16/MODULE.bazel": "7661303b8fc1b4d7f532e54e9d6565771fea666fbdf839e0a86affcd02defe87", - "https://bcr.bazel.build/modules/rules_cc/0.0.16/source.json": "227e83737046aa4f50015da48e98e0d8ab42fd0ec74d8d653b6cc9f9a357f200", "https://bcr.bazel.build/modules/rules_cc/0.0.2/MODULE.bazel": "6915987c90970493ab97393024c156ea8fb9f3bea953b2f3ec05c34f19b5695c", "https://bcr.bazel.build/modules/rules_cc/0.0.6/MODULE.bazel": "abf360251023dfe3efcef65ab9d56beefa8394d4176dd29529750e1c57eaa33f", "https://bcr.bazel.build/modules/rules_cc/0.0.8/MODULE.bazel": "964c85c82cfeb6f3855e6a07054fdb159aced38e99a5eecf7bce9d53990afa3e", "https://bcr.bazel.build/modules/rules_cc/0.0.9/MODULE.bazel": "836e76439f354b89afe6a911a7adf59a6b2518fafb174483ad78a2a2fde7b1c5", + "https://bcr.bazel.build/modules/rules_cc/0.2.17/MODULE.bazel": "1849602c86cb60da8613d2de887f9566a6d354a6df6d7009f9d04a14402f9a84", + "https://bcr.bazel.build/modules/rules_cc/0.2.17/source.json": "3832f45d145354049137c0090df04629d9c2b5493dc5c2bf46f1834040133a07", "https://bcr.bazel.build/modules/rules_foreign_cc/0.9.0/MODULE.bazel": "c9e8c682bf75b0e7c704166d79b599f93b72cfca5ad7477df596947891feeef6", "https://bcr.bazel.build/modules/rules_fuzzing/0.5.2/MODULE.bazel": "40c97d1144356f52905566c55811f13b299453a14ac7769dfba2ac38192337a8", "https://bcr.bazel.build/modules/rules_fuzzing/0.5.2/source.json": "c8b1e2c717646f1702290959a3302a178fb639d987ab61d548105019f11e527e", @@ -139,7 +142,7 @@ "moduleExtensions": { "//:extensions.bzl%arm_toolchain": { "general": { - "bzlTransitiveDigest": "t3cHywM6dCabqw7xBNJN+O3csA16VA/X6g/5Yqx9Tqc=", + "bzlTransitiveDigest": "Dc9jnqsf4t9vuDuerUt77tTdCNnfGkuLQwF41t2iFF8=", "usagesDigest": "P/3UnhHe8mBjAHhQOgY8IbRzO7gyGHPkTqDB/W/U9qY=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, @@ -182,7 +185,7 @@ "version": "13.2.1", "sha256": "075faa4f3e8eb45e59144858202351a28706f54a6ec17eedd88c9fb9412372cc", "strip_prefix": "arm-gnu-toolchain-13.2.Rel1-darwin-x86_64-arm-none-eabi", - "url": "https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-darwin-x86_64-arm-none-eabi.tar.xz?rev=a3d8c87bb0af4c40b7d7e0e291f6541b&hash=10927356ACA904E1A0122794E036E8DDE7D8435D", + "url": "https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-darwin-x86_64-arm-none-eabi.tar.xz", "exec_compatible_with": [ "@platforms//os:macos", "@platforms//cpu:x86_64" @@ -196,7 +199,7 @@ "version": "13.2.1", "sha256": "39c44f8af42695b7b871df42e346c09fee670ea8dfc11f17083e296ea2b0d279", "strip_prefix": "arm-gnu-toolchain-13.2.Rel1-darwin-arm64-arm-none-eabi", - "url": "https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-darwin-arm64-arm-none-eabi.tar.xz?rev=73e10891de3d41e29e95ac2878742b74&hash=6036196A3358CB5AD85FC01DFD0FEC02A", + "url": "https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-darwin-arm64-arm-none-eabi.tar.xz", "exec_compatible_with": [ "@platforms//os:macos", "@platforms//cpu:arm64" @@ -210,7 +213,7 @@ "version": "13.2.1", "sha256": "6cd1bbc1d9ae57312bcd169ae283153a9572bd6a8e4eeae2fedfbc33b115fdbb", "strip_prefix": "arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi", - "url": "https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-eabi.tar.xz?rev=e434b9ea4afc4ed7998329566b764309&hash=688C370BF08399033CA9DE3C1CC8CF8E31D8C441", + "url": "https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-eabi.tar.xz", "exec_compatible_with": [ "@platforms//os:linux", "@platforms//cpu:x86_64" @@ -224,7 +227,7 @@ "version": "13.2.1", "sha256": "8fd8b4a0a8d44ab2e195ccfbeef42223dfb3ede29d80f14dcf2183c34b8d199a", "strip_prefix": "arm-gnu-toolchain-13.2.Rel1-aarch64-arm-none-eabi", - "url": "https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-aarch64-arm-none-eabi.tar.xz?rev=17baf091942042768d55c9a304610954&hash=7F32B9E3ADFAFC4F8F74C30EBBBFECEB1AC96B60", + "url": "https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-aarch64-arm-none-eabi.tar.xz", "exec_compatible_with": [ "@platforms//os:linux", "@platforms//cpu:aarch64" @@ -238,7 +241,7 @@ "version": "13.2.1", "sha256": "51d933f00578aa28016c5e3c84f94403274ea7915539f8e56c13e2196437d18f", "strip_prefix": "arm-gnu-toolchain-13.2.Rel1-mingw-w64-i686-arm-none-eabi", - "url": "https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-mingw-w64-i686-arm-none-eabi.zip?rev=93fda279901c4c0299e03e5c4899b51f&hash=A3C5FF788BE90810E121091C873E3532336C8D46", + "url": "https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-mingw-w64-i686-arm-none-eabi.zip", "exec_compatible_with": [ "@platforms//os:windows", "@platforms//cpu:x86_64" @@ -274,7 +277,7 @@ "version": "13.2.1", "sha256": "df0f4927a67d1fd366ff81e40bd8c385a9324fbdde60437a512d106215f257b3", "strip_prefix": "arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-linux-gnueabihf", - "url": "https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-linux-gnueabihf.tar.xz?rev=adb0c0238c934aeeaa12c09609c5e6fc&hash=68DA67DE12CBAD82A0FA4B75247E866155C93053", + "url": "https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-linux-gnueabihf.tar.xz", "patches": [ "@@//toolchain:patches/0001-Resolve-libc-relative-to-sysroot.patch" ], @@ -291,7 +294,7 @@ "version": "13.2.1", "sha256": "8ad384bb328bccc44396d85c8f8113b7b8c5e11bcfef322e77cda3ebe7baadb5", "strip_prefix": "arm-gnu-toolchain-13.2.Rel1-aarch64-arm-none-linux-gnueabihf", - "url": "https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-aarch64-arm-none-linux-gnueabihf.tar.xz?rev=fbdb67e76c8349e5ad27a7c40fb270c9&hash=8CD3EBFFDC5E211275B705F6F9BCC0F6F5B4A53E", + "url": "https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-aarch64-arm-none-linux-gnueabihf.tar.xz", "patches": [ "@@//toolchain:patches/0001-Resolve-libc-relative-to-sysroot.patch" ], @@ -308,7 +311,7 @@ "version": "13.2.1", "sha256": "047e72bcef8f7767691f36929a8c74ef66f717cf6264a31f48dd31bfb067f4c8", "strip_prefix": "arm-gnu-toolchain-13.2.Rel1-mingw-w64-i686-arm-none-linux-gnueabihf", - "url": "https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-mingw-w64-i686-arm-none-linux-gnueabihf.zip?rev=14b6dd20622a4beabb60a6ee41a4c141&hash=C1F9FA6DE8259B5ACA0211139F4304F2B942E489", + "url": "https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-mingw-w64-i686-arm-none-linux-gnueabihf.zip", "patches": [ "@@//toolchain:patches/0001-Resolve-libc-relative-to-sysroot.patch" ], @@ -443,7 +446,7 @@ "version": "13.2.1", "sha256": "12fcdf13a7430655229b20438a49e8566e26551ba08759922cdaf4695b0d4e23", "strip_prefix": "arm-gnu-toolchain-13.2.Rel1-x86_64-aarch64-none-linux-gnu", - "url": "https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-x86_64-aarch64-none-linux-gnu.tar.xz?rev=22c39fc25e5541818967b4ff5a09ef3e&hash=B9FEDC2947EB21151985C2DC534ECCEC", + "url": "https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-x86_64-aarch64-none-linux-gnu.tar.xz", "patches": [ "@@//toolchain:patches/0001-Resolve-libc-relative-to-sysroot-aarch64_none_linux_gnu.patch" ], @@ -460,7 +463,7 @@ "version": "13.2.1", "sha256": "ccca7e520adbc5deb36d53a2b373e28a0c7e21107c487d4f5fd9cc8e0dbf6a11", "strip_prefix": "arm-gnu-toolchain-13.2.Rel1-mingw-w64-i686-aarch64-none-linux-gnu", - "url": "https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-mingw-w64-i686-aarch64-none-linux-gnu.zip?rev=861fed530201460f8f58b10dca7bd431&hash=A040842727683903E8646B42A96A8B98", + "url": "https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-mingw-w64-i686-aarch64-none-linux-gnu.zip", "patches": [ "@@//toolchain:patches/0001-Resolve-libc-relative-to-sysroot-aarch64_none_linux_gnu.patch" ], @@ -472,6 +475,11 @@ } }, "recordedRepoMappingEntries": [ + [ + "", + "bazel_skylib", + "bazel_skylib+" + ], [ "", "bazel_tools", @@ -487,26 +495,6 @@ "toolchains_arm_gnu", "" ], - [ - "bazel_features+", - "bazel_features_globals", - "bazel_features++version_extension+bazel_features_globals" - ], - [ - "bazel_features+", - "bazel_features_version", - "bazel_features++version_extension+bazel_features_version" - ], - [ - "protobuf+", - "proto_bazel_features", - "bazel_features+" - ], - [ - "protobuf+", - "rules_cc", - "rules_cc+" - ], [ "rules_cc+", "bazel_tools", @@ -514,13 +502,18 @@ ], [ "rules_cc+", - "com_google_protobuf", - "protobuf+" + "cc_compatibility_proxy", + "rules_cc++compatibility_proxy+cc_compatibility_proxy" ], [ "rules_cc+", "rules_cc", "rules_cc+" + ], + [ + "rules_cc++compatibility_proxy+cc_compatibility_proxy", + "rules_cc", + "rules_cc+" ] ] } @@ -854,22 +847,6 @@ ] } }, - "@@platforms//host:extension.bzl%host_platform": { - "general": { - "bzlTransitiveDigest": "xelQcPZH8+tmuOHVjL9vDxMnnQNMlwj0SlvgoqBkm4U=", - "usagesDigest": "SeQiIN/f8/Qt9vYQk7qcXp4I4wJeEC0RnQDiaaJ4tb8=", - "recordedFileInputs": {}, - "recordedDirentsInputs": {}, - "envVariables": {}, - "generatedRepoSpecs": { - "host_platform": { - "repoRuleId": "@@platforms//host:extension.bzl%host_platform_repo", - "attributes": {} - } - }, - "recordedRepoMappingEntries": [] - } - }, "@@rules_java+//java:rules_java_deps.bzl%compatibility_proxy": { "general": { "bzlTransitiveDigest": "84xJEZ1jnXXwo8BXMprvBm++rRt4jsTu9liBxz0ivps=", diff --git a/examples/bzlmod/MODULE.bazel b/examples/bzlmod/MODULE.bazel index 6c89eb8..23e7865 100644 --- a/examples/bzlmod/MODULE.bazel +++ b/examples/bzlmod/MODULE.bazel @@ -5,8 +5,8 @@ module( version = "0.0.1", ) -bazel_dep(name = "platforms", version = "0.0.8") -bazel_dep(name = "rules_cc", version = "0.0.9") +bazel_dep(name = "platforms", version = "1.0.0") +bazel_dep(name = "rules_cc", version = "0.2.17") bazel_dep(name = "aspect_bazel_lib", version = "2.0.0") bazel_dep(name = "bazel_skylib", version = "1.5.0") bazel_dep(name = "toolchains_arm_gnu") diff --git a/examples/gcc_version/MODULE.bazel b/examples/gcc_version/MODULE.bazel index febdf02..92b9082 100644 --- a/examples/gcc_version/MODULE.bazel +++ b/examples/gcc_version/MODULE.bazel @@ -5,8 +5,8 @@ module( version = "0.0.1", ) -bazel_dep(name = "platforms", version = "0.0.8") -bazel_dep(name = "rules_cc", version = "0.0.9") +bazel_dep(name = "platforms", version = "1.0.0") +bazel_dep(name = "rules_cc", version = "0.2.17") bazel_dep(name = "aspect_bazel_lib", version = "2.0.0") bazel_dep(name = "bazel_skylib", version = "1.5.0") bazel_dep(name = "toolchains_arm_gnu") diff --git a/examples/linkmap/MODULE.bazel b/examples/linkmap/MODULE.bazel index 038d72c..01655d9 100644 --- a/examples/linkmap/MODULE.bazel +++ b/examples/linkmap/MODULE.bazel @@ -5,8 +5,8 @@ module( version = "0.0.1", ) -bazel_dep(name = "platforms", version = "0.0.8") -bazel_dep(name = "rules_cc", version = "0.0.9") +bazel_dep(name = "platforms", version = "1.0.0") +bazel_dep(name = "rules_cc", version = "0.2.17") bazel_dep(name = "aspect_bazel_lib", version = "2.0.0") bazel_dep(name = "bazel_skylib", version = "1.5.0") bazel_dep(name = "toolchains_arm_gnu") diff --git a/examples/raspberry_pi/MODULE.bazel b/examples/raspberry_pi/MODULE.bazel index 8474faf..c76d827 100644 --- a/examples/raspberry_pi/MODULE.bazel +++ b/examples/raspberry_pi/MODULE.bazel @@ -5,8 +5,8 @@ module( version = "0.0.1", ) -bazel_dep(name = "platforms", version = "0.0.8") -bazel_dep(name = "rules_cc", version = "0.0.9") +bazel_dep(name = "platforms", version = "1.0.0") +bazel_dep(name = "rules_cc", version = "0.2.17") bazel_dep(name = "aspect_bazel_lib", version = "2.0.0") bazel_dep(name = "bazel_skylib", version = "1.5.0") bazel_dep(name = "toolchains_arm_gnu") diff --git a/examples/workspace/WORKSPACE b/examples/workspace/WORKSPACE index 7109432..d211c9f 100644 --- a/examples/workspace/WORKSPACE +++ b/examples/workspace/WORKSPACE @@ -15,7 +15,7 @@ load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") git_repository( name = "rules_cc", - commit = "4a62c693309887664cb733245d1c74f17a992942", + commit = "2f2ba8095e9ebb89375bae0bcf08a0eeb9aead64", # 0.1.5 remote = "https://github.com/bazelbuild/rules_cc", ) diff --git a/test/basic_cas.json b/test/basic_cas.json index c26d815..f3517d5 100644 --- a/test/basic_cas.json +++ b/test/basic_cas.json @@ -1,161 +1,189 @@ { - "stores": { - "AC_MAIN_STORE": { - "memory": { - "eviction_policy": { - // 100mb. - "max_bytes": 100000000, - } - } + stores: [ + { + name: "AC_MAIN_STORE", + filesystem: { + content_path: "/tmp/nativelink/data-worker-test/content_path-ac", + temp_path: "/tmp/nativelink/data-worker-test/tmp_path-ac", + eviction_policy: { + // 1gb. + max_bytes: 1000000000, + }, + }, }, - "WORKER_FAST_SLOW_STORE": { - "fast_slow": { + { + name: "WORKER_FAST_SLOW_STORE", + fast_slow: { // "fast" must be a "filesystem" store because the worker uses it to make // hardlinks on disk to a directory where the jobs are running. - "fast": { - "filesystem": { - "content_path": "/tmp/nativelink/data-worker-test/content_path-cas", - "temp_path": "/tmp/nativelink/data-worker-test/tmp_path-cas", - "eviction_policy": { + fast: { + filesystem: { + content_path: "/tmp/nativelink/data-worker-test/content_path-cas", + temp_path: "/tmp/nativelink/data-worker-test/tmp_path-cas", + eviction_policy: { // 10gb. - "max_bytes": 10000000000, - } - } + max_bytes: 10000000000, + }, + }, }, - "slow": { + slow: { /// Discard data. /// This example usage has the CAS and the Worker live in the same place, /// so they share the same underlying CAS. Since workers require a fast_slow /// store, we use the fast store as our primary data store, and the slow store /// is just a noop, since there's no shared storage in this config. - "noop": {} - } - } - } - }, - "schedulers": { - "MAIN_SCHEDULER": { - "simple": { - "supported_platform_properties": { - "cpu_count": "minimum", - "memory_kb": "minimum", - "network_kbps": "minimum", - "disk_read_iops": "minimum", - "disk_read_bps": "minimum", - "disk_write_iops": "minimum", - "disk_write_bps": "minimum", - "shm_size": "minimum", - "gpu_count": "minimum", - "gpu_model": "exact", - "cpu_vendor": "exact", - "cpu_arch": "exact", - "cpu_model": "exact", - "kernel_version": "exact", - "OSFamily": "priority", - "container-image": "priority", - // Example of how to set which docker images are available and set - // them in the platform properties. - // "docker_image": "priority", - } - } - } - }, - "workers": [{ - "local": { - "worker_api_endpoint": { - "uri": "grpc://127.0.0.1:50061", - }, - "cas_fast_slow_store": "WORKER_FAST_SLOW_STORE", - "upload_action_result": { - "ac_store": "AC_MAIN_STORE", - }, - "work_directory": "/tmp/nativelink/work", - "platform_properties": { - "cpu_count": { - "values": ["16"], - }, - "memory_kb": { - "values": ["500000"], + noop: {}, }, - "network_kbps": { - "values": ["100000"], + }, + }, + ], + schedulers: [ + { + name: "MAIN_SCHEDULER", + simple: { + supported_platform_properties: { + cpu_count: "minimum", + memory_kb: "minimum", + network_kbps: "minimum", + disk_read_iops: "minimum", + disk_read_bps: "minimum", + disk_write_iops: "minimum", + disk_write_bps: "minimum", + shm_size: "minimum", + gpu_count: "minimum", + gpu_model: "exact", + cpu_vendor: "exact", + cpu_arch: "exact", + cpu_model: "exact", + kernel_version: "exact", + OSFamily: "priority", + "container-image": "priority", + "lre-rs": "priority", + ISA: "exact", }, - "cpu_arch": { - "values": ["x86_64"], + }, + }, + ], + workers: [ + { + local: { + worker_api_endpoint: { + uri: "grpc://127.0.0.1:50061", }, - "OSFamily": { - "values": [""] + cas_fast_slow_store: "WORKER_FAST_SLOW_STORE", + upload_action_result: { + ac_store: "AC_MAIN_STORE", }, - "container-image": { - "values": [""] + work_directory: "/tmp/nativelink/work", + platform_properties: { + cpu_count: { + values: [ + "16", + ], + }, + memory_kb: { + values: [ + "500000", + ], + }, + network_kbps: { + values: [ + "100000", + ], + }, + cpu_arch: { + values: [ + "x86_64", + ], + }, + OSFamily: { + values: [ + "", + ], + }, + "container-image": { + values: [ + "", + ], + }, + "lre-rs": { + values: [ + "", + ], + }, + ISA: { + values: [ + "x86-64", + ], + }, }, - // Example of how to set which docker images are available and set - // them in the platform properties. - // "docker_image": { - // "query_cmd": "docker images --format {{.Repository}}:{{.Tag}}", - // } - } - } - }], - "servers": [{ - "name": "public", - "listener": { - "http": { - "socket_address": "0.0.0.0:50051" - } - }, - "services": { - "cas": { - "main": { - "cas_store": "WORKER_FAST_SLOW_STORE" - } }, - "ac": { - "main": { - "ac_store": "AC_MAIN_STORE" - } - }, - "execution": { - "main": { - "cas_store": "WORKER_FAST_SLOW_STORE", - "scheduler": "MAIN_SCHEDULER", - } + }, + ], + servers: [ + { + name: "public", + listener: { + http: { + socket_address: "0.0.0.0:50051", + }, }, - "capabilities": { - "main": { - "remote_execution": { - "scheduler": "MAIN_SCHEDULER", - } - } + services: { + cas: [ + { + instance_name: "main", + cas_store: "WORKER_FAST_SLOW_STORE", + }, + ], + ac: [ + { + instance_name: "main", + ac_store: "AC_MAIN_STORE", + }, + ], + execution: [ + { + instance_name: "main", + cas_store: "WORKER_FAST_SLOW_STORE", + scheduler: "MAIN_SCHEDULER", + }, + ], + capabilities: [ + { + instance_name: "main", + remote_execution: { + scheduler: "MAIN_SCHEDULER", + }, + }, + ], + bytestream: { + cas_stores: { + main: "WORKER_FAST_SLOW_STORE", + }, + }, }, - "bytestream": { - "cas_stores": { - "main": "WORKER_FAST_SLOW_STORE", - } - } - } - }, { - "name": "private_workers_servers", - "listener": { - "http": { - "socket_address": "0.0.0.0:50061" - } }, - "services": { - "experimental_prometheus": { - "path": "/metrics" + { + name: "private_workers_servers", + listener: { + http: { + socket_address: "0.0.0.0:50061", + }, }, - // Note: This should be served on a different port, because it has - // a different permission set than the other services. - // In other words, this service is a backend api. The ones above - // are a frontend api. - "worker_api": { - "scheduler": "MAIN_SCHEDULER", + services: { + // Note: This should be served on a different port, because it has + // a different permission set than the other services. + // In other words, this service is a backend api. The ones above + // are a frontend api. + worker_api: { + scheduler: "MAIN_SCHEDULER", + }, + admin: {}, + health: {}, }, - "admin": {} - } - }], - "global": { - "max_open_files": 512 - } + }, + ], + global: { + max_open_files: 512, + }, } diff --git a/toolchain/config.bzl b/toolchain/config.bzl index 52e42a2..9a59952 100644 --- a/toolchain/config.bzl +++ b/toolchain/config.bzl @@ -1,5 +1,8 @@ load("@bazel_tools//tools/build_defs/cc:action_names.bzl", "ACTION_NAMES") load("@rules_cc//cc:cc_toolchain_config_lib.bzl", "action_config", "feature", "flag_group", "flag_set") +load("@rules_cc//cc/toolchains:cc_toolchain_config_info.bzl", "CcToolchainConfigInfo") +load("@rules_cc//cc/common:cc_info.bzl", "CcInfo") +load("@rules_cc//cc/common:cc_common.bzl", "cc_common") def _tool_path(bins, toolchain_prefix, tool_name): """Generate tool paths for GCC""" diff --git a/toolchain/transitions.bzl b/toolchain/transitions.bzl index b9089c8..24bac68 100644 --- a/toolchain/transitions.bzl +++ b/toolchain/transitions.bzl @@ -1,3 +1,5 @@ +load("@rules_cc//cc/common:cc_info.bzl", "CcInfo") + def _toolchain_transition_impl(settings, attr): return { "//command_line_option:extra_toolchains": [attr.toolchain],