Skip to content

Commit 1453d55

Browse files
Mizuxcopybara-github
authored andcommitted
deep rework (mostly ci and build system)
# Bazel * rework .bazelrc PiperOrigin-RevId: 822526928
1 parent ba91614 commit 1453d55

File tree

2 files changed

+63
-15
lines changed

2 files changed

+63
-15
lines changed

.bazelrc

Lines changed: 56 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,41 @@
11
# Enable logging rc options.
22
common --announce_rc
33

4-
# Enable verbose failures for testing only.
5-
build --verbose_failures
4+
###############################################################################
5+
# Global options for building Pybind11_Abseil.
6+
###############################################################################
67

7-
# Set the default Apple platform to macOS.
8-
build --apple_platform_type=macos
8+
# Fix the python version
9+
build --@rules_python//python/config_settings:python_version=3.12
10+
11+
###############################################################################
12+
# Per plaform options
13+
###############################################################################
914

10-
# Abseil requires C++14 at minimum.
15+
# By default, build with various extra flags per platform.
1116
build --enable_platform_specific_config
17+
18+
###############################################################################
19+
# Options for Linux.
20+
###############################################################################
21+
1222
build:linux --cxxopt=-std=c++17 --host_cxxopt=-std=c++17
23+
24+
###############################################################################
25+
# Options for macOS.
26+
###############################################################################
27+
28+
# Sets the default Apple platform to macOS.
29+
build --apple_platform_type=macos
30+
build:macos --features=-supports_dynamic_linker
1331
build:macos --cxxopt=-std=c++17 --host_cxxopt=-std=c++17
32+
# build:macos --cxxopt=-Wno-dangling-field --host_cxxopt=-Wno-dangling-field
1433
build:macos --cxxopt=-mmacos-version-min=10.15 --host_cxxopt=-mmacos-version-min=10.15
34+
35+
###############################################################################
36+
# Options for Windows.
37+
###############################################################################
38+
1539
build:windows --cxxopt=/std:c++17 --host_cxxopt=/std:c++17
1640

1741
# Enable the runfiles symlink tree on Windows. This makes it possible to build
@@ -21,9 +45,32 @@ build:windows --cxxopt=/std:c++17 --host_cxxopt=/std:c++17
2145
startup --windows_enable_symlinks
2246
build:windows --enable_runfiles
2347

24-
# Enable logging error output.
25-
test --test_output=errors
26-
test --test_summary=detailed
48+
###############################################################################
49+
# Options for continuous integration.
50+
###############################################################################
51+
52+
# All build options also apply to test as described by the "Option precedence"
53+
# section in https://bazel.build/run/bazelrc#bazelrc-syntax-semantics.
54+
55+
# Note for anybody considering using --compilation_mode=opt in CI, it builds
56+
# most files twice, one PIC version for shared libraries in tests, and one
57+
# non-PIC version for binaries.
58+
build:ci --copt=-O1
59+
60+
# Show as many errors as possible.
61+
build:ci --keep_going
62+
63+
# Show test errors.
64+
test:ci --test_output=errors
65+
66+
# Skip tests that are too large to run on CI.
67+
test:ci --test_tag_filters=-noci
68+
69+
# Print information only about tests executed
70+
test:ci --test_summary=short
2771

28-
# https://bazel.build/configure/best-practices#bazelrc-file
72+
###############################################################################
73+
# Put user-specific options in user.bazelrc
74+
# See https://bazel.build/configure/best-practices#bazelrc-file
75+
################################################################################
2976
try-import %workspace%/user.bazelrc

MODULE.bazel

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,25 @@ module(
66
# Only direct dependencies need to be listed below.
77
# Please keep the versions in sync with the versions in the WORKSPACE file.
88
# see https://registry.bazel.build/
9-
bazel_dep(name = "bazel_skylib", version = "1.7.1")
9+
bazel_dep(name = "bazel_skylib", version = "1.8.2")
10+
bazel_dep(name = "platforms", version = "1.0.0")
11+
bazel_dep(name = "rules_cc", version = "0.2.9")
12+
bazel_dep(name = "rules_python", version = "1.6.3")
1013
bazel_dep(name = "abseil-cpp", version = "20240722.1", repo_name = "com_google_absl")
11-
bazel_dep(name = "platforms", version = "0.0.10")
12-
bazel_dep(name = "rules_cc", version = "0.1.1")
13-
bazel_dep(name = "rules_python", version = "0.40.0")
14-
bazel_dep(name = "pybind11_bazel", version = "2.13.6")
14+
bazel_dep(name = "pybind11_bazel", version = "3.0.0")
1515

1616
#### DEV ONLY DEPENDENCIES BELOW HERE ####
1717

1818
SUPPORTED_PYTHON_VERSIONS = [
19+
"3.13",
1920
"3.12",
2021
"3.11",
2122
"3.10",
2223
"3.9",
2324
"3.8",
2425
]
2526

26-
DEFAULT_PYTHON = "3.11"
27+
DEFAULT_PYTHON = "3.12"
2728

2829
python = use_extension("@rules_python//python/extensions:python.bzl", "python", dev_dependency = True)
2930

0 commit comments

Comments
 (0)