-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy path.bazelrc
More file actions
96 lines (79 loc) · 3.65 KB
/
Copy path.bazelrc
File metadata and controls
96 lines (79 loc) · 3.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
# Allow the Bazel server to check directory sources for changes. Ensures that the Bazel server
# notices when a directory changes, if you have a directory listed in the srcs of some target.
# Recommended when using
# [copy_directory](https://github.com/aspect-build/bazel-lib/blob/main/docs/copy_directory.md) and
# [rules_js](https://github.com/aspect-build/rules_js) since npm package are source directories
# inputs to copy_directory actions.
# Docs: https://bazel.build/reference/command-line-reference#flag--host_jvm_args
startup --host_jvm_args=-DBAZEL_TRACK_SOURCE_DIRECTORIES=1
# Performance optimizations
build --show_timestamps
build --reuse_sandbox_directories
build --nolegacy_external_runfiles
build --http_max_parallel_downloads=16
build --remote_download_outputs=minimal
build --noexperimental_check_external_repository_files
fetch --noexperimental_check_external_repository_files
query --noexperimental_check_external_repository_files
# Correctness settings
build --sandbox_default_allow_network=false
build --incompatible_default_to_explicit_init_py
# Suppress compiler warnings from external dependencies (e.g. protobuf)
build --per_file_copt=external/.*@-w
build --host_per_file_copt=external/.*@-w
# Disable pipstar (cross-platform wheel resolution) to reduce analysis-phase memory
build --repo_env=RULES_PYTHON_ENABLE_PIPSTAR=0
# Config to stamp the version info on the Python Library wheel when creating distribution
build:stamp_py_wheel --stamp
build:stamp_py_wheel --workspace_status_command=src/lib/distribution/stamp.sh
# Print test errors
test --test_output=errors
# MyPy Type Checking
test --aspects @osmo_workspace//bzl/mypy:mypy.bzl%mypy_aspect --test_keep_going
test --output_groups=+mypy
# ============================================================================
# CI Configuration for GitHub Actions (Bazel 8.0 optimized)
# ============================================================================
# Use with: bazel test --config=ci ...
# Environment: Docker container, 4 CPUs, 8GB RAM, Docker-in-Docker
# Resource Management (critical for containerized CI)
build:ci --local_resources=cpu=4
build:ci --local_resources=memory=6144
build:ci --jobs=4
# Worker Optimization (Bazel 8.0+)
build:ci --worker_max_instances=2
build:ci --worker_multiplex
# JVM Memory Limit (startup options can't be config-specific, applied globally for CI environments)
startup --host_jvm_args=-Xmx4g
# Remote Cache Optimization
build:ci --remote_cache_async
build:ci --remote_upload_local_results
# CI-Specific Settings
build:ci --verbose_failures
build:ci --noshow_progress
# Memory Optimization (safe for CI since each run is fresh)
build:ci --discard_analysis_cache
build:ci --notrack_incremental_state
build:ci --nokeep_state_after_build
# Testcontainers Environment
build:ci --test_env=DOCKER_HOST=tcp://docker:2375
build:ci --test_env=TESTCONTAINERS_HOST_OVERRIDE=docker
# Coverage: use with `bazel coverage`
coverage --combined_report=lcov
coverage --test_tag_filters=-nocoverage
coverage --build_tests_only