Skip to content

refactor: Bazelrc presets: Almost always use common #1095

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 30, 2025

Conversation

hofbi
Copy link
Contributor

@hofbi hofbi commented May 30, 2025

Best practice seems to be to almost always use common(reminding me to C++'s AAA rule). Using common ensures that build, fetch, and query use the same flags and is easier for users since there is one recommended way to do it.

With bazelbuild/bazel#18609, Bazel does not fail in case a flag does not belong to a common, so there is no harm in using common for Bazel 6.3+. Because of this, bazel6.bazelrc does not use common.

I kept all test flags as is for now, but we can also make them common if we want, either here or as follow up PR.

@alexeagle alexeagle requested a review from fmeum May 30, 2025 13:08
@fmeum fmeum merged commit f048405 into bazel-contrib:main May 30, 2025
31 checks passed
@hofbi hofbi deleted the bazelrc-presets-common branch May 30, 2025 17:57
@hofbi
Copy link
Contributor Author

hofbi commented Jun 2, 2025

@fmeum What are your thoughts on doing the same for test, e.g. all test becomes common in the bazelrc presets? Do you see any issues/potential harm in doing this? E.g., would setting

test --experimental_fetch_all_coverage_outputs
to common cause coverage output downloads also for bazel build calls?

@fmeum
Copy link
Member

fmeum commented Jun 2, 2025

I am not aware of any downside and there is even a minor upside: Before Bazel 9, --test_env invalidates build commands and thus shouldn't be set on test.

@hofbi
Copy link
Contributor Author

hofbi commented Jun 2, 2025

I am not aware of any downside and there is even a minor upside: Before Bazel 9, --test_env invalidates build commands and thus shouldn't be set on test.

#1099 does it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants