Skip to content

Commit

Permalink
Update to new buildbuddy-toolchain (#7826)
Browse files Browse the repository at this point in the history
- **update some toolchain and platform stuff**
- **add necessary rootDirs for new platform names**

---------

Co-authored-by: Son Luong Ngoc <[email protected]>
  • Loading branch information
tempoz and sluongng authored Nov 15, 2024
1 parent 8d72d8a commit b2391db
Show file tree
Hide file tree
Showing 9 changed files with 54 additions and 42 deletions.
26 changes: 24 additions & 2 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,3 @@ use_repo(
"busybox",
"busybox_linux_amd64",
)

register_toolchains(
"//toolchains:ubuntu_cc_toolchain",
)
8 changes: 4 additions & 4 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -559,7 +559,7 @@ http_file(
)

register_toolchains(
"//toolchains:ubuntu_cc_toolchain",
"@buildbuddy_toolchain//:ubuntu_cc_toolchain",
)

http_archive(
Expand Down
10 changes: 7 additions & 3 deletions WORKSPACE.bzlmod
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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",
)
6 changes: 3 additions & 3 deletions docs/rbe-github-actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
6 changes: 3 additions & 3 deletions docs/rbe-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
22 changes: 0 additions & 22 deletions toolchains/BUILD
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
8 changes: 7 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 6 additions & 0 deletions website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
];

/**
Expand Down

0 comments on commit b2391db

Please sign in to comment.