Skip to content

Commit

Permalink
Allow using MODULE.bazel.lock files to speed up crate_universe tests
Browse files Browse the repository at this point in the history
  • Loading branch information
UebelAndre committed Feb 4, 2025
1 parent c9f69c1 commit 482a689
Show file tree
Hide file tree
Showing 3 changed files with 16,377 additions and 18 deletions.
37 changes: 22 additions & 15 deletions .bazelci/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ default_windows_no_runfiles_targets: &default_windows_no_runfiles_targets
- "-//tools/runfiles/..."
# Runfiles used by the test only.
- "-//test/empty_suite:deps_test"
crate_universe_example_shell_commands: &crate_universe_example_shell_commands
- rm MODULE.bazel.lock
crate_universe_example_rbe_shell_commands: &crate_universe_example_shell_commands
- rm MODULE.bazel.lock
- sed -i 's/^# load("@bazel_ci_rules/load("@bazel_ci_rules/' WORKSPACE.bazel
- sed -i 's/^# rbe_preconfig/rbe_preconfig/' WORKSPACE.bazel
crate_universe_vendor_example_targets: &crate_universe_vendor_example_targets
- "//vendor_external:crates_vendor"
- "//vendor_local_manifests:crates_vendor"
Expand Down Expand Up @@ -435,6 +441,7 @@ tasks:
name: Crate Universe Examples
platform: ubuntu2004
working_directory: examples/crate_universe
shell_commands: *crate_universe_example_shell_commands
run_targets: *crate_universe_vendor_example_targets
build_targets:
- "//..."
Expand All @@ -445,9 +452,7 @@ tasks:
name: Crate Universe Examples
platform: rbe_ubuntu2004
working_directory: examples/crate_universe
shell_commands:
- sed -i 's/^# load("@bazel_ci_rules/load("@bazel_ci_rules/' WORKSPACE.bazel
- sed -i 's/^# rbe_preconfig/rbe_preconfig/' WORKSPACE.bazel
shell_commands: *crate_universe_example_rbe_shell_commands
run_targets: *crate_universe_vendor_example_targets
build_targets:
- "--"
Expand All @@ -464,12 +469,25 @@ tasks:
name: Crate Universe Examples
platform: macos_arm64
working_directory: examples/crate_universe
shell_commands: *crate_universe_example_shell_commands
run_targets: *crate_universe_vendor_example_targets
build_flags: *aspects_flags
build_targets:
- "//..."
test_targets:
- "//..."
build_flags: *aspects_flags
# See https://github.com/bazelbuild/rules_rust/issues/2186 about re-enabling these.
# crate_universe_examples_windows:
# name: Crate Universe Examples
# platform: windows
# working_directory: examples/crate_universe
# shell_commands: *crate_universe_example_shell_commands
# run_targets: *crate_universe_vendor_example_targets
# build_flags: *aspects_flags
# build_targets:
# - "//..."
# test_targets:
# - "//..."
crate_universe_local_path_external:
name: Crate Universe Local Path External
platform: ubuntu2004
Expand Down Expand Up @@ -498,17 +516,6 @@ tasks:
working_directory: examples/crate_universe_local_path
run_targets:
- "//:vendor_edit_test_in_tree"
# See https://github.com/bazelbuild/rules_rust/issues/2186 about re-enabling these.
# crate_universe_examples_windows:
# name: Crate Universe Examples
# platform: windows
# working_directory: examples/crate_universe
# run_targets: *crate_universe_vendor_example_targets
# build_flags: *aspects_flags
# build_targets:
# - "//..."
# test_targets:
# - "//..."
cc_common_link_ubuntu2004:
name: Build via cc_common.link
platform: ubuntu2004
Expand Down
3 changes: 0 additions & 3 deletions examples/crate_universe/.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ build --incompatible_merge_fixed_and_default_shell_env
# A configuration for disabling bzlmod.
common:no-bzlmod --noenable_bzlmod --enable_workspace

# Disable the bzlmod lockfile, so we don't accidentally commit MODULE.bazel.lock
common --lockfile_mode=off

###############################################################################
## Custom user flags
##
Expand Down
Loading

0 comments on commit 482a689

Please sign in to comment.