diff --git a/.bazelrc b/.bazelrc index 70f6a31c702..69f5cfe848e 100644 --- a/.bazelrc +++ b/.bazelrc @@ -40,21 +40,41 @@ common:remote-shared --remote_timeout=600 common:remote-shared --remote_download_minimal common:remote-shared --jobs=100 common:remote-shared --verbose_failures -common:remote-shared --platforms=//platforms:linux_x86_64 -common:remote-shared --extra_execution_platforms=//platforms:linux_x86_64 + +common:target-linux-x86 --platforms=@buildbuddy_toolchain//:platform_linux_x86_64 +common:target-linux-x86 --extra_execution_platforms=@buildbuddy_toolchain//:platform_linux_x86_64 + +common:target-linux-arm64 --platforms=@buildbuddy_toolchain//:platform_linux_arm64 +common:target-linux-arm64 --extra_execution_platforms=@buildbuddy_toolchain//:platform_linux_arm64 # Build with --config=remote to use BuildBuddy RBE. common:remote --config=remote-shared +common:remote --config=target-linux-x86 common:remote --config=cache common:remote --remote_executor=grpcs://buildbuddy.buildbuddy.io +# Specify arch to do cross-platform builds on remote until the go toolchain can +# accomodate multiple execution platforms +common:remote-linux-arm64 --config=remote-shared +common:remote-linux-arm64 --config=target-linux-arm64 +common:remote-linux-arm64 --config=cache +common:remote-linux-arm64 --remote_executor=grpcs://buildbuddy.buildbuddy.io + # Build with --config=remote-dev to use BuildBuddy RBE. common:remote-dev --config=remote-shared +common:remote-dev --config=target-linux-x86 common:remote-dev --config=cache-dev common:remote-dev --remote_executor=grpcs://buildbuddy.buildbuddy.dev +# Specify arch to do cross-platform builds on remote-dev +common:remote-dev-linux-arm64 --config=remote-shared +common:remote-dev-linux-arm64 --config=target-linux-arm64 +common:remote-dev-linux-arm64 --config=cache-dev +common:remote-dev-linux-arm64 --remote_executor=grpcs://buildbuddy.buildbuddy.dev + # Build with --config=probers to use BuildBuddy RBE in the probers org. common:probers --config=remote-shared +common:probers --config=target-linux-x86 common:probers --bes_results_url=https://buildbuddy-probers-us-west1.buildbuddy.io/invocation/ common:probers --bes_backend=grpcs://buildbuddy-probers-us-west1.buildbuddy.io common:probers --remote_cache=grpcs://buildbuddy-probers-us-west1.buildbuddy.io @@ -65,6 +85,7 @@ common:probers --experimental_remote_cache_compression_threshold=100 # Build with --config=probers-dev to use BuildBuddy RBE in the probers org. common:probers-dev --config=remote-shared +common:probers-dev --config=target-linux-x86 common:probers-dev --bes_results_url=https://buildbuddy-probers.buildbuddy.dev/invocation/ common:probers-dev --bes_backend=grpcs://buildbuddy-probers.buildbuddy.dev common:probers-dev --remote_cache=grpcs://buildbuddy-probers.buildbuddy.dev @@ -144,6 +165,7 @@ common:deflake-go --test_arg=-test.failfast # Configuration used for Linux workflows common:linux-workflows --config=remote-shared +common:linux-workflows --config=target-linux-x86 common:linux-workflows --config=workflows common:linux-workflows --config=buildbuddy_remote_executor common:linux-workflows --build_metadata=TAGS=linux-workflow diff --git a/MODULE.bazel b/MODULE.bazel index b6b515d985c..87d9f6af39c 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -550,7 +550,3 @@ use_repo( "busybox", "busybox_linux_amd64", ) - -register_toolchains( - "//toolchains:ubuntu_cc_toolchain", -) diff --git a/WORKSPACE b/WORKSPACE index 8d32ecc0f80..1a5d242ee55 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -477,9 +477,9 @@ oci_pull( # Keep up-to-date with docs/rbe-setup.md and docs/rbe-github-actions.md http_archive( name = "io_buildbuddy_buildbuddy_toolchain", - sha256 = "baa9af1b9fcc96d18ac90a4dd68ebd2046c8beb76ed89aea9aabca30959ad30c", - strip_prefix = "buildbuddy-toolchain-287d6042ad151be92de03c83ef48747ba832c4e2", - urls = ["https://github.com/buildbuddy-io/buildbuddy-toolchain/archive/287d6042ad151be92de03c83ef48747ba832c4e2.tar.gz"], + sha256 = "7b9ce903bd0cbf21879c83e264ae9453e143377616935dc1825f7c8c1c2a9688", + strip_prefix = "buildbuddy-toolchain-285db08fc6785f0d051ecdcdf7f2910eb0459641", + urls = ["https://github.com/buildbuddy-io/buildbuddy-toolchain/archive/285db08fc6785f0d051ecdcdf7f2910eb0459641.tar.gz"], ) load("@io_buildbuddy_buildbuddy_toolchain//:deps.bzl", "buildbuddy_deps") @@ -559,7 +559,7 @@ http_file( ) register_toolchains( - "//toolchains:ubuntu_cc_toolchain", + "@buildbuddy_toolchain//:ubuntu_cc_toolchain", ) http_archive( diff --git a/WORKSPACE.bzlmod b/WORKSPACE.bzlmod index ce690f6b0eb..5c0d7e9f2ff 100644 --- a/WORKSPACE.bzlmod +++ b/WORKSPACE.bzlmod @@ -151,9 +151,9 @@ container_pull( # Keep up-to-date with docs/rbe-setup.md and docs/rbe-github-actions.md http_archive( name = "io_buildbuddy_buildbuddy_toolchain", - sha256 = "baa9af1b9fcc96d18ac90a4dd68ebd2046c8beb76ed89aea9aabca30959ad30c", - strip_prefix = "buildbuddy-toolchain-287d6042ad151be92de03c83ef48747ba832c4e2", - urls = ["https://github.com/buildbuddy-io/buildbuddy-toolchain/archive/287d6042ad151be92de03c83ef48747ba832c4e2.tar.gz"], + sha256 = "7b9ce903bd0cbf21879c83e264ae9453e143377616935dc1825f7c8c1c2a9688", + strip_prefix = "buildbuddy-toolchain-285db08fc6785f0d051ecdcdf7f2910eb0459641", + urls = ["https://github.com/buildbuddy-io/buildbuddy-toolchain/archive/285db08fc6785f0d051ecdcdf7f2910eb0459641.tar.gz"], ) load("@io_buildbuddy_buildbuddy_toolchain//:deps.bzl", "buildbuddy_deps") @@ -195,3 +195,7 @@ browser_repositories(chromium = True) load("@io_bazel_rules_webtesting//web:go_repositories.bzl", web_test_go_repositories = "go_repositories") web_test_go_repositories() + +register_toolchains( + "@buildbuddy_toolchain//:ubuntu_cc_toolchain", +) diff --git a/docs/rbe-github-actions.md b/docs/rbe-github-actions.md index 23f332ea468..fdf861e1968 100644 --- a/docs/rbe-github-actions.md +++ b/docs/rbe-github-actions.md @@ -107,9 +107,9 @@ And the following lines to your `WORKSPACE` file: ```python title="WORKSPACE" http_archive( name = "io_buildbuddy_buildbuddy_toolchain", - sha256 = "baa9af1b9fcc96d18ac90a4dd68ebd2046c8beb76ed89aea9aabca30959ad30c", - strip_prefix = "buildbuddy-toolchain-287d6042ad151be92de03c83ef48747ba832c4e2", - urls = ["https://github.com/buildbuddy-io/buildbuddy-toolchain/archive/287d6042ad151be92de03c83ef48747ba832c4e2.tar.gz"], + sha256 = "747dbf28cb8b8d27b2d909aa05e00691fe6d9d8a28026e359cc4943261687592", + strip_prefix = "buildbuddy-toolchain-702567fd8a561ec94a0e8e7fd8aa00bb15d87b4f", + urls = ["https://github.com/buildbuddy-io/buildbuddy-toolchain/archive/702567fd8a561ec94a0e8e7fd8aa00bb15d87b4f.tar.gz"], ) load("@io_buildbuddy_buildbuddy_toolchain//:deps.bzl", "buildbuddy_deps") diff --git a/docs/rbe-setup.md b/docs/rbe-setup.md index 2a01772f336..416e0d347e1 100644 --- a/docs/rbe-setup.md +++ b/docs/rbe-setup.md @@ -29,9 +29,9 @@ To get started with the BuildBuddy Toolchain, add the following lines to your `W ```python http_archive( name = "io_buildbuddy_buildbuddy_toolchain", - sha256 = "baa9af1b9fcc96d18ac90a4dd68ebd2046c8beb76ed89aea9aabca30959ad30c", - strip_prefix = "buildbuddy-toolchain-287d6042ad151be92de03c83ef48747ba832c4e2", - urls = ["https://github.com/buildbuddy-io/buildbuddy-toolchain/archive/287d6042ad151be92de03c83ef48747ba832c4e2.tar.gz"], + sha256 = "747dbf28cb8b8d27b2d909aa05e00691fe6d9d8a28026e359cc4943261687592", + strip_prefix = "buildbuddy-toolchain-702567fd8a561ec94a0e8e7fd8aa00bb15d87b4f", + urls = ["https://github.com/buildbuddy-io/buildbuddy-toolchain/archive/702567fd8a561ec94a0e8e7fd8aa00bb15d87b4f.tar.gz"], ) load("@io_buildbuddy_buildbuddy_toolchain//:deps.bzl", "buildbuddy_deps") diff --git a/toolchains/BUILD b/toolchains/BUILD index 0ea846f21ef..fed6913811b 100644 --- a/toolchains/BUILD +++ b/toolchains/BUILD @@ -1,25 +1,3 @@ -# A duplicate of @buildbuddy_toolchain//:ubuntu_cc_toolchain -# with correct cc_compiler constraint value. -# TODO(sluongng): upstream this to buildbuddy-toolchain -toolchain( - name = "ubuntu_cc_toolchain", - exec_compatible_with = [ - "@platforms//cpu:x86_64", - "@platforms//os:linux", - # This is not needed for the toolchain itself, - # but it helps us differentiate between the local platform and the remote RBE platform. - # - # For local builds, we do NOT want to use this toolchain as the gcc and glibc versions might differ. - "@bazel_tools//tools/cpp:gcc", - ], - target_compatible_with = [ - "@platforms//os:linux", - "@platforms//cpu:x86_64", - ], - toolchain = "@buildbuddy_toolchain//:ubuntu_local_cc_toolchain", - toolchain_type = "@bazel_tools//tools/cpp:toolchain_type", -) - constraint_setting( name = "use_musl", default_constraint_value = ":musl_off", diff --git a/tsconfig.json b/tsconfig.json index f9f3b0ff4f2..9a7bf4e7ca9 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -38,7 +38,13 @@ "bazel-out/macos_arm64-fastbuild/bin", "bazel-out/macos_arm64-opt/bin", "bazel-out/macos_x86_64-fastbuild/bin", - "bazel-out/macos_x86_64-opt/bin" + "bazel-out/macos_x86_64-opt/bin", + "bazel-out/platform_linux-fastbuild/bin", + "bazel-out/platform_linux-opt/bin", + "bazel-out/platform_linux_arm64-fastbuild/bin", + "bazel-out/platform_linux_arm64-opt/bin", + "bazel-out/platform_linux_x86_64-fastbuild/bin", + "bazel-out/platform_linux_x86_64-opt/bin" ] // Note: we intentionally don't set "baseUrl": "." in order to force import // module specifiers to be relative. diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index fd251980a89..72349fe469b 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -23,6 +23,12 @@ const configDirs = [ "bazel-out/macos_arm64-opt/bin", "bazel-out/macos_x86_64-fastbuild/bin", "bazel-out/macos_x86_64-opt/bin", + "bazel-out/platform_linux-fastbuild/bin", + "bazel-out/platform_linux-opt/bin", + "bazel-out/platform_linux_arm64-fastbuild/bin", + "bazel-out/platform_linux_arm64-opt/bin", + "bazel-out/platform_linux_x86_64-fastbuild/bin", + "bazel-out/platform_linux_x86_64-opt/bin", ]; /**