Skip to content

Commit b2abc99

Browse files
chore: Down with WORKSPACE (#597)
This is a massive combined patch aimed at starting to address a whole pile of WORKSPACE related techdebt and migration pain points. Major points: - Delete the `WORKSPACE` file - Delete `WORKSPACE` supporting private files - Retain `WORKSPACE` supporting `py/repositories.bzl` for now; will drop in future 2.0 release - Synchronize how we're configuring Rust and the crossbuild toolchain(s) with the Aspect CLI, other projects As future items we can go through and consider bumping dependencies ### Changes are visible to end-users: no ### Test plan - This is the test plan ### Remaining items - [x] Eliminate dev proto dependencies - [x] Drop source build Gazelle for prebuilt - [x] Get local tests to green - [x] Inline out `include()` statements which block subrepo/e2e tests (cf. bazelbuild/bazel#27137) - [x] Update the release generation flow to discard all the dev dependencies and retain only the desired prod MODULE.bazel content - [x] Test the release artifact generation flow; ensure release artifact naming expectations are preserved ### Future work Need to come back to the e2e tests which were removed. Under bzlmod the e2e tests are quite expensive due to sysroot and LLVM setup, to the point of being prohibitive (~10min of setup for 0.5s of test). However we did give up some coverage there. --------- Co-authored-by: aspect-marvin[bot] <[email protected]>
1 parent 0d58f76 commit b2abc99

File tree

188 files changed

+10820
-9349
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

188 files changed

+10820
-9349
lines changed

.aspect/workflows/config.yaml

Lines changed: 11 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,9 @@
22

33
# This list is maintained by tools/e2e/sync.py
44
workspaces:
5-
# SYNC: e2e
6-
# {{{
75
- .
8-
- e2e/cross-repo-610
9-
- e2e/interpreter-version-541
10-
- e2e/repository-rule-deps
11-
- e2e/smoke
12-
- e2e/system-interpreter
6+
- e2e
137
- examples/uv_pip_compile
14-
# }}}
158

169
tasks:
1710
# TODO(arrdem): Rosetta doesn't like HEAD version strings seemingly
@@ -24,37 +17,23 @@ tasks:
2417
# rm .bazelversion
2518
# echo "USE_BAZEL_VERSION=last_green" > .bazeliskrc
2619

27-
# TODO(arrdem): Bazel 8+ dropped the original PyInfo etc. which the ancient
28-
# rules_python we have on the WORKSPACE side isn't ready for yet. Once we kill
29-
# off WORKSPACE we can flip these back on but practically this is blocked on
30-
# getting that change in.
31-
#
32-
# - test:
33-
# name: test-os:linux-bzl:latest
34-
# queue: aspect-large
35-
# hooks:
36-
# - type: before_task
37-
# command: |
38-
# rm .bazelversion
39-
# echo "USE_BAZEL_VERSION=latest" > .bazeliskrc
40-
41-
# - test:
42-
# name: test-os:linux-bzl:8
43-
# queue: aspect-large
44-
# hooks:
45-
# - type: before_task
46-
# command: |
47-
# rm .bazelversion
48-
# echo "USE_BAZEL_VERSION=8.2.1" > .bazeliskrc
20+
- test:
21+
name: test-os:linux-bzl:latest
22+
queue: aspect-large
23+
hooks:
24+
- type: before_task
25+
command: |
26+
rm .bazelversion
27+
echo "USE_BAZEL_VERSION=latest" > .bazeliskrc
4928
5029
- test:
51-
name: test-os:linux-bzl:7
30+
name: test-os:linux-bzl:8
5231
queue: aspect-large
5332
hooks:
5433
- type: before_task
5534
command: |
5635
rm .bazelversion
57-
echo "USE_BAZEL_VERSION=7.6.1" > .bazeliskrc
36+
echo "USE_BAZEL_VERSION=8.4.0" > .bazeliskrc
5837
5938
- finalization:
6039
queue: aspect-small

.bazelrc

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,41 @@
1-
# Bazel settings that apply to this repository.
2-
# Take care to document any settings that you expect users to apply.
3-
# Settings that apply only to CI are in .github/workflows/ci.bazelrc
1+
import %workspace%/bazel/defaults.bazelrc
42

5-
test --test_output=errors
3+
common --enable_bzlmod
4+
5+
# Ignore slow manual and release targets
6+
# Prevents materializing crossbuild
7+
build --build_tag_filters=-manual,-release
8+
test --test_tag_filters=-manual,-release
69

7-
# TODO(alex): enable
8-
common --noenable_bzlmod
9-
# For very recent bazel we have to set this explicitly
10-
common --enable_workspace
10+
test --test_output=errors
1111

1212
# Define value used by tests
1313
build --define=SOME_VAR=SOME_VALUE
1414

15-
common --features=-libtool
15+
#common --features=-libtool
1616
common --incompatible_enable_cc_toolchain_resolution
17+
18+
# TODO(bzlmod): Don't break proto
1719
common --per_file_copt=external/.*protobuf.*@--PROTOBUF_WAS_NOT_SUPPOSED_TO_BE_BUILT
1820
common --host_per_file_copt=external/.*protobuf.*@--PROTOBUF_WAS_NOT_SUPPOSED_TO_BE_BUILT
1921

20-
# Use local rules_python
21-
# Enable with --config=dev
22-
common:dev --override_repository=rules_python=~/workspace/rules_python
23-
# No external runfiles
24-
common --nolegacy_external_runfiles
22+
# Don't try and auto detect the cc toolchain, as we use our own gcc toolchains.
23+
common --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
24+
common --incompatible_enable_cc_toolchain_resolution
25+
26+
# Don't link against libunwind on macos as it causes linking failures (https://github.com/bazel-contrib/toolchains_llvm/pull/346)
27+
common:macos --@toolchains_llvm//toolchain/config:libunwind=False
28+
29+
common:ci --toolchain_resolution_debug='@@bazel_tools//tools/cpp:toolchain_type'
30+
31+
common:release --build_tag_filters=release
32+
common:release --stamp
33+
common:release --compilation_mode=opt
34+
common:release --@rules_rust//rust/settings:lto=fat
2535

26-
# Don’t want to push a rules author to update their deps if not needed.
27-
# https://bazel.build/reference/command-line-reference#flag--check_direct_dependencies
28-
# https://bazelbuild.slack.com/archives/C014RARENH0/p1691158021917459?thread_ts=1691156601.420349&cid=C014RARENH0
29-
common --check_direct_dependencies=off
36+
# Speed up local development by using the non-hermetic CPP toolchain.
37+
common:nollvm --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=0
38+
common:nollvm --noincompatible_enable_cc_toolchain_resolution
3039

3140
# Load any settings specific to the current user.
3241
# .bazelrc.user should appear in .gitignore so that settings are not shared with team members

.bazelversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
7.6.1
1+
8.4.0
22
# The first line of this file is used by Bazelisk and Bazel to be sure
33
# the right version of Bazel is used to build and test this repo.
44
# This also defines which version is used on CI.

0 commit comments

Comments
 (0)