Skip to content

Commit

Permalink
bazel: disable sandboxing and avoid stamping
Browse files Browse the repository at this point in the history
- Sandboxing on MacOS have measurable overhead. See
  bazelbuild/bazel#8230; it comes from
  symlinks being much slower to create. This commit disables sandboxing
  on local builds (still present in CI) to hopefully speed up builds.
  - If this proves to be buggy for whatever reason, we could opt out of
    sandboxing for go package compiles specifically using
    --strategy=GoCompilePkg=local.
  - In the future if we want local sandboxing, we could explore
    sandboxfs: https://bazel.build/docs/sandboxing
- When used with a remote build cache, these stamps (despite being marked
  as volatile), induce an unnecessary golink step when switching back
  and forth between branches. See bazelbuild/bazel#10075. Opting out
  here shaves a few precious seconds if the previously built binary is
  already available.

Release note: None
  • Loading branch information
irfansharif committed Apr 4, 2022
1 parent 5b4a7b0 commit ad24997
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ build:devdarwinx86_64 --config=dev
build:dev --stamp --workspace_status_command=./build/bazelutil/stamp.sh
build:dev --action_env=PATH
build:dev --host_action_env=PATH
build:dev --spawn_strategy=local --strategy=Genrule=sandboxed
build:dev --nostamp

try-import %workspace%/.bazelrc.user

Expand Down

0 comments on commit ad24997

Please sign in to comment.