bazel-lib/.aspect/bazelrc
ajwerner 7d901b7d9b
fix(bazelrc): move flag to bazel6.bazelrc (#959)
This flag became a no-op in Bazel 7 (see [here][0]) and then was removed in
Bazel 8 (see [here][1]).

Fixes #958

[0]: c88f374246
[1]: 17ee62e91d
2024-10-08 11:35:51 -07:00
..
local chore: bump to Bazel 7.1.2 (#842) 2024-05-13 21:28:28 -07:00
.gitignore chore: align ci patterns (#843) 2024-05-13 23:51:10 -07:00
BUILD.bazel feat: add write_aspect_bazelrc_presets macro (#370) 2023-02-17 14:34:06 -08:00
README.md chore: update git urls (#926) 2024-09-17 17:05:35 -07:00
automatic_updates.md feat: add write_aspect_bazelrc_presets macro (#370) 2023-02-17 14:34:06 -08:00
bazel6.bazelrc fix(bazelrc): move flag to bazel6.bazelrc (#959) 2024-10-08 11:35:51 -07:00
bazel7.bazelrc chore: turn off bzlmod misguided warning (#901) 2024-08-14 10:41:50 -07:00
ci.bazelrc presets: remove eternal test_timeout_filtering (#758) 2024-02-16 13:56:38 -08:00
convenience.bazelrc fix(typos): Fix almost all typos with hook (#884) 2024-07-31 10:09:17 -04:00
correctness.bazelrc chore: update git urls (#926) 2024-09-17 17:05:35 -07:00
debug.bazelrc feat: make bazel-lib the source-of-truth for Aspect recommended bazelrc settings (#369) 2023-02-16 16:59:21 -08:00
intro.md feat: add write_aspect_bazelrc_presets macro (#370) 2023-02-17 14:34:06 -08:00
java.bazelrc feat(presets): java bazelrc options (#947) 2024-10-04 15:34:34 +00:00
javascript.bazelrc chore: add bazel test support to javascript --config=debug preset (#825) 2024-04-25 16:33:16 -07:00
performance.bazelrc fix(bazelrc): move flag to bazel6.bazelrc (#959) 2024-10-08 11:35:51 -07:00
usage.md chore: update git urls (#926) 2024-09-17 17:05:35 -07:00

README.md

Aspect bazelrc presets

The .bazelrc files found here are the source-of-truth for our recommended Bazel presets.

They are mirrored on our docsite at https://docs.aspect.build/guides/bazelrc.

Using Aspect bazelrc presets in your project

The .bazelrc file can get large, fast. Some settings don't apply everywhere - some options are appropriate only on CI, and some vary depending on the version of Bazel you use or languages used.

Bazel rc files can contain import statements, which allow you to organize the content better.

To use these presets in your project, simply vendor the *.bazelrc files from https://github.com/bazel-contrib/bazel-lib/tree/main/.aspect/bazelrc into the .aspect/bazelrc folder in your repository and import them in your .bazelrc file.

For example,

# Import Aspect bazelrc presets
import %workspace%/.aspect/bazelrc/bazel6.bazelrc
import %workspace%/.aspect/bazelrc/convenience.bazelrc
import %workspace%/.aspect/bazelrc/correctness.bazelrc
import %workspace%/.aspect/bazelrc/debug.bazelrc
import %workspace%/.aspect/bazelrc/javascript.bazelrc
import %workspace%/.aspect/bazelrc/performance.bazelrc

### YOUR PROJECT SPECIFIC OPTIONS GO HERE ###

# Load any settings & overrides specific to the current user from `.aspect/bazelrc/user.bazelrc`.
# This file should appear in `.gitignore` so that settings are not shared with team members. This
# should be last statement in this config so the user configuration is able to overwrite flags from
# this file. See https://bazel.build/configure/best-practices#bazelrc-file.
try-import %workspace%/.aspect/bazelrc/user.bazelrc

Automatic updates

A convenient way to automatically keep your vendored copy up-to-date is to use the write_aspect_bazelrc_presets rule in .aspect/bazelrc/BUILD.bazel:

"Aspect bazelrc presets; see https://docs.aspect.build/guides/bazelrc"

load("@aspect_bazel_lib//lib:bazelrc_presets.bzl", "write_aspect_bazelrc_presets")

write_aspect_bazelrc_presets(name = "update_aspect_bazelrc_presets")

When @aspect_bazel_lib is upgraded in your WORKSPACE.bazel or your MODULE.bazel file, a diff_test stamped out by write_aspect_bazelrc_presets will fail if your vendored copy is out-of-date and print the Bazel command to run to update it. For example, bazel run //.aspect/bazelrc:update_aspect_bazelrc_presets.

See the bazelrc example in our bazel-examples repository for a working example.