Skip to content

Commit

Permalink
Generate gitignored bazelrc with version-specific flags
Browse files Browse the repository at this point in the history
  • Loading branch information
BalestraPatrick committed Jan 9, 2023
1 parent 39f1ac7 commit 718391c
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
# Symlink to `$DEVELOPER_DIR/Toolchains/XcodeDefault.xctoolchain/usr/lib`
**/*.xcodeproj/rules_xcodeproj/lib

generated.bazelrc
user.bazelrc
3 changes: 3 additions & 0 deletions bazel_6.bazelrc
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
build:cache --experimental_remote_build_event_upload=minimal

# Enable bzlmod under Bazel 6.
common --experimental_enable_bzlmod
3 changes: 3 additions & 0 deletions examples/integration/.bazelrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Import parent workspace settings
import %workspace%/../../shared.bazelrc

# This example doesn't support bzlmod yet.
common --noexperimental_enable_bzlmod

# Exercise the extra flags feature

build:rules_xcodeproj --@com_github_buildbuddy_io_rules_xcodeproj//xcodeproj:extra_common_flags='--verbose_failures'
Expand Down
3 changes: 3 additions & 0 deletions examples/sanitizers/.bazelrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Import parent workspace settings
import %workspace%/../../shared.bazelrc

# This example doesn't support bzlmod yet.
common --noexperimental_enable_bzlmod

# Use a user.bazelrc if it exists
try-import %workspace%/user.bazelrc
3 changes: 3 additions & 0 deletions shared.bazelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Import Bazel version-specific bazelrc.
import %workspace%/generated.bazelrc

build --incompatible_disallow_empty_glob
build --experimental_convenience_symlinks=ignore
build --features=swift.use_global_module_cache
Expand Down
4 changes: 3 additions & 1 deletion tools/bazel
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ else
readonly bazel_version_bazelrc="$root_dir/bazel_6.bazelrc"
fi

exec "$BAZEL_REAL" "--bazelrc=$bazel_version_bazelrc" "$@"
echo "import $bazel_version_bazelrc" > "generated.bazelrc"

exec "$BAZEL_REAL" "$@"

0 comments on commit 718391c

Please sign in to comment.