Skip to content

Commit 42f694f

Browse files
CU-2083 Update bazel
Amp-Thread-ID: https://ampcode.com/threads/T-019c6657-a9f1-73f8-97a1-b65a00132fb0 Co-authored-by: Amp <amp@ampcode.com>
1 parent c0c8142 commit 42f694f

22 files changed

+131
-132
lines changed

.aspect/workflows/config.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
queue: aspect-devx-service
3+
bazel:
4+
rcfiles:
5+
- ".aspect/bazelrc/ci.bazelrc"
6+
7+
tasks:
8+
- build:
9+
targets:
10+
- //...
11+
bazel:
12+
flags:
13+
- "--config=ci"
14+
- test:
15+
targets:
16+
- //test
17+
bazel:
18+
flags:
19+
- "--config=ci"
20+
- finalization:
21+

.bazelrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
try-import %workspace%/ci.bazelrc
22
try-import %workspace%/buildbuddy.bazelrc
33

4+
# Disable bzlmod since this project uses WORKSPACE
5+
# Docs: https://bazel.build/external/migration#disable-bzlmod
6+
common --noenable_bzlmod
7+
48
# Import Aspect bazelrc presets
59
import %workspace%/.aspect/bazelrc/bazel6.bazelrc
610
import %workspace%/.aspect/bazelrc/convenience.bazelrc
@@ -46,6 +50,7 @@ build --per_file_copt="external/llvm-project/.*@-Wno-deprecated-anon-enum-enum-c
4650
build --per_file_copt="external/llvm-project/.*@-Wno-ambiguous-reversed-operator" # C++20 warning
4751
build --per_file_copt="external/com_google_protobuf/.*@-Wno-deprecated-declarations" # sprintf on macOS
4852
build --per_file_copt="external/com_google_protobuf/.*@-Wno-unused-function"
53+
build --per_file_copt="external/com_google_protobuf/.*@-Wno-missing-field-initializers"
4954

5055
build:asserts --copt="-DFORCE_DEBUG=1"
5156
build:asserts --copt="-DLLVM_ENABLE_ASSERTIONS=1"

.bazelversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6.1.2
1+
7.5.0

.buildkite/pipeline.yaml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
$schema: "http://json.schemastore.org/buildkite"
22
steps:
3-
- label: ":bazel: Build and Test"
3+
- label: ":lint-roller: Lint"
4+
key: lint
45
agents:
5-
queue: bazel
6-
key: build
6+
queue: aspect-small-ubuntu-lts
77
command: |
88
./tools/reformat.sh
99
if ! git diff --quiet; then
@@ -17,8 +17,9 @@ steps:
1717
1818
./tools/lint.sh
1919
20-
# DO NOT remove --config=ci as that turns on sanitizers.
21-
bazel --bazelrc=.bazelrc --bazelrc=.aspect/bazelrc/ci.bazelrc build //... --config=ci
22-
23-
# Don't use //... as that will also try to update snapshots
24-
bazel --bazelrc=.bazelrc --bazelrc=.aspect/bazelrc/ci.bazelrc test //test --config=ci
20+
- key: aspect-workflows-upload
21+
label: ":aspect: Setup Aspect Workflows"
22+
commands: |
23+
rosetta steps | buildkite-agent pipeline upload
24+
agents:
25+
queue: aspect-small-ubuntu-lts

.github/actionlint.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
self-hosted-runner:
33
# Labels of self-hosted runner in array of strings.
44
labels:
5-
- ubuntu-22.04-32core-graph-team-amd64
6-
- ubuntu-22.04-32core-graph-team-arm64
5+
- ubuntu-24.04-32core-graph-team-amd64
6+
- ubuntu-24.04-32core-graph-team-arm64

.github/workflows/release-docker.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515
fail-fast: false
1616
matrix:
1717
include:
18-
- os: ubuntu-22.04-32core-graph-team-amd64
18+
- os: ubuntu-24.04-32core-graph-team-amd64
1919
platform: linux/amd64
2020
binary-name: scip-clang-x86_64-linux
21-
- os: ubuntu-22.04-32core-graph-team-arm64
21+
- os: ubuntu-24.04-32core-graph-team-arm64
2222
platform: linux/arm64
2323
binary-name: scip-clang-arm64-linux
2424
runs-on: ${{ matrix.os }}

.github/workflows/release.yml

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,14 @@ jobs:
2020
strategy:
2121
matrix:
2222
include:
23-
- platform: "ubuntu-22.04"
24-
container: "gcc:9.5.0-buster"
23+
- platform: "ubuntu-24.04-32core-graph-team-amd64"
2524
config: "dev"
26-
- platform: "ubuntu-22.04"
27-
container: "gcc:9.5.0-buster"
25+
- platform: "ubuntu-24.04-32core-graph-team-amd64"
2826
config: "release"
2927
# macOS 14 => arm64
3028
- platform: "macos-14"
31-
container: ""
3229
config: "release"
3330
runs-on: ${{ matrix.platform }}
34-
container: ${{ matrix.container }}
3531
env:
3632
TAG: ${{ github.event.ref }}
3733
permissions:
@@ -53,12 +49,10 @@ jobs:
5349
NEW_VERSION="${TAG_LIKE/v/}" ./tools/version_check.sh
5450
- name: "🐍 Install Bazelisk"
5551
run: |
56-
if ! command -v bazelisk; then
57-
if [ "$RUNNER_OS" == "Windows" ]; then
58-
choco install bazelisk
59-
elif [ "$RUNNER_OS" == "Linux" ]; then
60-
curl -L https://github.com/bazelbuild/bazelisk/releases/download/v1.16.0/bazelisk-linux-amd64 > /usr/local/bin/bazel
61-
chmod +x /usr/local/bin/bazel
52+
if ! command -v bazelisk && ! command -v bazel; then
53+
if [ "$RUNNER_OS" == "Linux" ]; then
54+
sudo curl -L https://github.com/bazelbuild/bazelisk/releases/download/v1.16.0/bazelisk-linux-amd64 -o /usr/local/bin/bazel
55+
sudo chmod +x /usr/local/bin/bazel
6256
else
6357
sudo npm install -g @bazel/bazelisk
6458
fi
@@ -72,10 +66,6 @@ jobs:
7266
create_credentials_file: true
7367
- name: "🚧 Build scip-clang"
7468
run: |
75-
# Stop Windows from converting the // to /
76-
# https://github.com/bazelbuild/bazel/commit/866ecc8c3d5e0b899e3f0c9c6b2265f16daae842
77-
# https://stackoverflow.com/a/34386471
78-
export MSYS2_ARG_CONV_EXCL="*"
7969
if [ "$RUNNER_OS" == "macOS" ]; then
8070
export BAZEL_MEM="13G"
8171
else # if [ "$RUNNER_OS" == "Linux" ]; then
@@ -129,7 +119,9 @@ jobs:
129119
name: "Create release"
130120
if: github.event_name != 'workflow_dispatch' || inputs.create_release
131121
needs: build-and-upload-artifacts
132-
runs-on: "ubuntu-22.04"
122+
runs-on: "ubuntu-24.04"
123+
permissions:
124+
contents: write
133125
steps:
134126
- uses: actions/checkout@v4
135127
- name: "📝 Create Release"

WORKSPACE

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,27 @@ load("//:fetch_deps.bzl", "fetch_direct_dependencies")
1414
fetch_direct_dependencies()
1515

1616
# Setup the toolchain before setting up other dependencies
17+
# Note: bazel_toolchain_dependencies() brings in rules_cc 0.2.14
1718
load("@toolchains_llvm//toolchain:deps.bzl", "bazel_toolchain_dependencies")
1819

1920
bazel_toolchain_dependencies()
2021

22+
# bazel_features needs its deps called explicitly
23+
load("@bazel_features//:deps.bzl", "bazel_features_deps")
24+
25+
bazel_features_deps()
26+
27+
# Set up cc_compatibility_proxy for rules_cc 0.2.14+ in WORKSPACE mode
28+
load("@rules_cc//cc:extensions.bzl", "compatibility_proxy_repo")
29+
30+
compatibility_proxy_repo()
31+
2132
load("//:setup_llvm.bzl", "setup_llvm_toolchain")
2233

2334
setup_llvm_toolchain(name = "llvm_toolchain")
2435

25-
load("@llvm_toolchain//:toolchains.bzl", "llvm_register_toolchains")
2636
load("@rules_python//python:repositories.bzl", "py_repositories", "python_register_toolchains")
37+
load("@llvm_toolchain//:toolchains.bzl", "llvm_register_toolchains")
2738

2839
llvm_register_toolchains()
2940

docs/Development.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,13 @@ Run `./tools/reformat.sh` to reformat code and config files.
9797

9898
## IDE integration
9999

100-
Run `./tools/regenerate-compdb.sh` to generate a compilation database
100+
Run `./tools/regenerate-compile-commands.sh` to generate a compilation database
101101
at the root of the repository. It will be automatically
102102
picked up by clangd-based editor extensions (you may
103103
need to reload the editor).
104104

105+
Alternatively, run `bazel run //tools:refresh_compile_commands` directly.
106+
105107
## Debugging
106108

107109
### Stacktraces

fetch_deps.bzl

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file")
22

33
_BAZEL_SKYLIB_VERSION = "1.3.0"
4-
_PLATFORMS_COMMIT = "3fbc687756043fb58a407c2ea8c944bc2fe1d922" # 2022 Nov 10
5-
_BAZEL_TOOLCHAIN_VERSION = "0.10.3"
4+
_PLATFORMS_VERSION = "1.0.0" # Updated from 2022 commit for visionos support
5+
_BAZEL_TOOLCHAIN_VERSION = "1.6.0"
66
_RULES_BOOST_COMMIT = "00b9b9ecb9b43564de44ea0b10e22b29dcf84d79"
77
_LLVM_COMMIT = "e0f3110b854a476c16cce7b44472cd7838d344e9" # Keep in sync with Version.h
8-
_ABSL_COMMIT = "4ffaea74c1f5408e0757547a1ca0518ad43fa9f1"
8+
_ABSL_VERSION = "20240722.0"
99
_CXXOPTS_VERSION = "3.0.0"
1010
_RAPIDJSON_COMMIT = "a98e99992bd633a2736cc41f96ec85ef0c50e44d"
1111
_WYHASH_COMMIT = "ea3b25e1aef55d90f707c3a292eeb9162e2615d8"
12-
_SPDLOG_COMMIT = "edc51df1bdad8667b628999394a1e7c4dc6f3658"
13-
_PROTOBUF_VERSION = "3.21.12"
12+
_SPDLOG_COMMIT = "486b55554f11c9cccc913e11a87085b2a91f706f" # v1.16.0
13+
_PROTOBUF_VERSION = "25.3"
1414
_SCIP_COMMIT = "aa0e511dcfefbacc3b96dcc2fe2abd9894416b1e"
1515
_UTFCPP_VERSION = "4.0.5"
1616
# ^ When bumping this version, check if any new fields are introduced
@@ -22,7 +22,7 @@ _UTFCPP_VERSION = "4.0.5"
2222
# See https://github.com/google/perfetto/issues/271#issuecomment-1527691232
2323
_PERFETTO_VERSION = "33.1" # Keep in sync with docs/Development.md
2424
_DOCTEST_VERSION = "2.4.9"
25-
_DTL_VERSION = "1.20"
25+
_DTL_VERSION = "1.21"
2626
_RULES_PYTHON_VERSION = "0.18.1"
2727

2828
def fetch_direct_dependencies():
@@ -37,17 +37,19 @@ def fetch_direct_dependencies():
3737

3838
http_archive(
3939
name = "platforms",
40-
sha256 = "b4a3b45dc4202e2b3e34e3bc49d2b5b37295fc23ea58d88fb9e01f3642ad9b55",
41-
strip_prefix = "platforms-%s" % _PLATFORMS_COMMIT,
42-
urls = ["https://github.com/bazelbuild/platforms/archive/%s.zip" % _PLATFORMS_COMMIT],
40+
sha256 = "3384eb1c30762704fbe38e440204e114154086c8fc8a8c2e3e28441028c019a8",
41+
urls = [
42+
"https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/{0}/platforms-{0}.tar.gz".format(_PLATFORMS_VERSION),
43+
"https://github.com/bazelbuild/platforms/releases/download/{0}/platforms-{0}.tar.gz".format(_PLATFORMS_VERSION),
44+
],
4345
)
4446

4547
http_archive(
4648
name = "toolchains_llvm",
47-
sha256 = "b7cd301ef7b0ece28d20d3e778697a5e3b81828393150bed04838c0c52963a01",
48-
strip_prefix = "toolchains_llvm-%s" % _BAZEL_TOOLCHAIN_VERSION,
49+
sha256 = "2b298a1d7ea99679f5edf8af09367363e64cb9fbc46e0b7c1b1ba2b1b1b51058",
50+
strip_prefix = "toolchains_llvm-v%s" % _BAZEL_TOOLCHAIN_VERSION,
4951
canonical_id = _BAZEL_TOOLCHAIN_VERSION,
50-
url = "https://github.com/grailbio/bazel-toolchain/releases/download/{0}/toolchains_llvm-{0}.tar.gz".format(_BAZEL_TOOLCHAIN_VERSION),
52+
url = "https://github.com/bazel-contrib/toolchains_llvm/releases/download/v{0}/toolchains_llvm-v{0}.tar.gz".format(_BAZEL_TOOLCHAIN_VERSION),
5153
)
5254

5355
http_archive(
@@ -59,11 +61,12 @@ def fetch_direct_dependencies():
5961
],
6062
)
6163

64+
_HEDRON_COMMIT = "abb61a688167623088f8768cc9264798df6a9d10"
6265
http_archive(
63-
name = "com_grail_bazel_compdb",
64-
sha256 = "d32835b26dd35aad8fd0ba0d712265df6565a3ad860d39e4c01ad41059ea7eda",
65-
strip_prefix = "bazel-compilation-database-0.5.2",
66-
urls = ["https://github.com/grailbio/bazel-compilation-database/archive/0.5.2.tar.gz"],
66+
name = "hedron_compile_commands",
67+
sha256 = "1b08abffbfbe89f6dbee6a5b33753792e8004f6a36f37c0f72115bec86e68724",
68+
url = "https://github.com/hedronvision/bazel-compile-commands-extractor/archive/%s.tar.gz" % _HEDRON_COMMIT,
69+
strip_prefix = "bazel-compile-commands-extractor-%s" % _HEDRON_COMMIT,
6770
)
6871

6972
http_archive(
@@ -79,14 +82,14 @@ def fetch_direct_dependencies():
7982
# Keep the name 'zlib' so that Protobuf doesn't pull in another copy.
8083
#
8184
# https://sourcegraph.com/github.com/protocolbuffers/protobuf/-/blob/protobuf_deps.bzl?L48-58
85+
# Using zlib 1.3.1 to fix macro conflicts with macOS headers in zlib 1.2.11
8286
http_archive(
8387
name = "zlib",
8488
build_file = "@scip_clang//third_party:zlib.BUILD",
85-
sha256 = "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1",
86-
strip_prefix = "zlib-1.2.11",
89+
sha256 = "17e88863f3600672ab49182f217281b6fc4d3c762bde361935e436a95214d05c",
90+
strip_prefix = "zlib-1.3.1",
8791
urls = [
88-
"https://mirror.bazel.build/zlib.net/zlib-1.2.11.tar.gz",
89-
"https://zlib.net/zlib-1.2.11.tar.gz",
92+
"https://github.com/madler/zlib/archive/refs/tags/v1.3.1.tar.gz",
9093
],
9194
)
9295

@@ -110,7 +113,7 @@ def fetch_direct_dependencies():
110113

111114
http_archive(
112115
name = "com_google_protobuf",
113-
sha256 = "f7042d540c969b00db92e8e1066a9b8099c8379c33f40f360eb9e1d98a36ca26",
116+
sha256 = "5156b22536feaa88cf95503153a6b2cd67cc80f20f1218f154b84a12c288a220",
114117
urls = ["https://github.com/protocolbuffers/protobuf/archive/v%s.zip" % _PROTOBUF_VERSION],
115118
strip_prefix = "protobuf-%s" % _PROTOBUF_VERSION,
116119
)
@@ -129,11 +132,9 @@ def fetch_direct_dependencies():
129132
# https://sourcegraph.com/github.com/protocolbuffers/protobuf/-/blob/protobuf_deps.bzl?L39-46
130133
http_archive(
131134
name = "com_google_absl",
132-
sha256 = "fee8ec623d8bbf0ecb9563a8e08ae319d1ca9fdf8c1c84384520a6992f571659",
133-
strip_prefix = "abseil-cpp-%s" % _ABSL_COMMIT,
134-
urls = ["https://github.com/abseil/abseil-cpp/archive/%s.zip" % _ABSL_COMMIT],
135-
patch_args = ["-p1"],
136-
patches = ["//third_party:abseil.patch"],
135+
sha256 = "95e90be7c3643e658670e0dd3c1b27092349c34b632c6e795686355f67eca89f",
136+
strip_prefix = "abseil-cpp-%s" % _ABSL_VERSION,
137+
urls = ["https://github.com/abseil/abseil-cpp/archive/%s.zip" % _ABSL_VERSION],
137138
)
138139

139140
# Abseil also has a flags/argument parsing library, but let's
@@ -165,7 +166,7 @@ def fetch_direct_dependencies():
165166
# NOTE: fmt also comes through spdlog, we don't have an explicit dep on fmt.
166167
http_archive(
167168
name = "spdlog",
168-
sha256 = "93a270dd7ec8fa672eb4feaef443dc14a4a9edc7b59aea998ae5da6cbf7b7119",
169+
sha256 = "d2fef585c9879dd239dc498e2e8a1e22982b3ed67b2d14e78622b7ef25bdfdfa",
169170
build_file = "@scip_clang//third_party:spdlog.BUILD",
170171
strip_prefix = "spdlog-%s" % _SPDLOG_COMMIT,
171172
urls = ["https://github.com/gabime/spdlog/archive/%s.tar.gz" % _SPDLOG_COMMIT],
@@ -180,7 +181,7 @@ def fetch_direct_dependencies():
180181

181182
http_archive(
182183
name = "dtl",
183-
sha256 = "579f81bca88f4b9760a59d99c5a95bd8dd5dc2f20f33f1f9b5f64cb08979f54d",
184+
sha256 = "90ed2dbf4e6d687737fe25f118bbcb6aed778cecc3f2115d191a032bf8643dbd",
184185
build_file = "@scip_clang//third_party:dtl.BUILD",
185186
strip_prefix = "dtl-%s" % _DTL_VERSION,
186187
urls = ["https://github.com/cubicdaiya/dtl/archive/v%s.tar.gz" % _DTL_VERSION],

0 commit comments

Comments
 (0)