Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow using MODULE.bazel.lock files to speed up crate_universe tests #3236

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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_rbe_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
6 changes: 3 additions & 3 deletions examples/crate_universe/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -616,9 +616,9 @@ use_repo(
"crates_vendor_pkgs__tracing-0.1.41",
"crates_vendor_pkgs__tracing-subscriber-0.3.19",
"cvm",
"cvm__tempfile-3.15.0",
"cvm__tokio-1.43.0",
"cvm__tokio-test-0.4.4",
"cvm__tempfile-3.3.0",
"cvm__tokio-1.17.0",
"cvm__tokio-test-0.4.2",
)

###############################################################################
Expand Down
16,297 changes: 16,297 additions & 0 deletions examples/crate_universe/MODULE.bazel.lock

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion examples/crate_universe/vendor_local_manifests/crates/defs.bzl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading