Skip to content
Open
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
9 changes: 6 additions & 3 deletions .github/workflows/bazel-ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@ on:
# discovery, the lock inventory, the Ruby crawler (it says which lock
# Bundler loads), the upstream restore of `rollback`, the stale-install
# guard that those commands end with, the vendored backend
# (vendor/gem.rs), and the refusal of vendored mode beside a hub that
# reads the lock (vendor/bazel_hub.rs), which vendor/refusals.rs hands
# to every command.
# (vendor/gem.rs, and vendor/gem/ for the gem it commits for a hub),
# and the refusal of vendored mode beside a hub that reads the lock
# (vendor/bazel_hub.rs), which vendor/refusals.rs hands to every
# command.
# Last, the VEX code: `vex/` of the core, the files of the `vex`
# command, and `bazel/` of the core, which reads the workspace files and
# decides whether Bazel builds what was patched. Every flow holds the
Expand Down Expand Up @@ -73,6 +74,7 @@ on:
- 'crates/socket-patch-core/src/patch/redirect/upstream/gem.rs'
- 'crates/*/src/**/gem_refresh.rs'
- 'crates/socket-patch-core/src/vendor/gem.rs'
- 'crates/socket-patch-core/src/vendor/gem/**'
- 'crates/socket-patch-core/src/vendor/bazel_hub.rs'
- 'crates/socket-patch-core/src/vendor/refusals.rs'
- 'crates/socket-patch-core/src/bazel/**'
Expand Down Expand Up @@ -101,6 +103,7 @@ on:
- 'crates/socket-patch-core/src/patch/redirect/upstream/gem.rs'
- 'crates/*/src/**/gem_refresh.rs'
- 'crates/socket-patch-core/src/vendor/gem.rs'
- 'crates/socket-patch-core/src/vendor/gem/**'
- 'crates/socket-patch-core/src/vendor/bazel_hub.rs'
- 'crates/socket-patch-core/src/vendor/refusals.rs'
- 'crates/socket-patch-core/src/bazel/**'
Expand Down
10 changes: 6 additions & 4 deletions crates/socket-patch-cli/CLI_CONTRACT.md

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions crates/socket-patch-cli/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -435,8 +435,10 @@ pub struct GlobalArgs {
/// (`vendor_pypi_bazel_hub`, `vendor_gem_bazel_hub`), which builds
/// nothing from a lock that names a copy under `.socket/vendor`. Pass
/// it when the build does find the copy, or does not take the
/// project's packages from that lock. Other subcommands accept it
/// silently.
/// project's packages from that lock. Without it a gem is committed
/// for a rules_ruby hub as an archive that the hub builds, where
/// that is known to build; with it every gem is vendored by its
/// path. Other subcommands accept it silently.
#[arg(
help_heading = GLOBAL_OPTIONS,
long = "allow-vendored-in-bazel",
Expand Down
17 changes: 16 additions & 1 deletion crates/socket-patch-cli/src/commands/vendor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4797,7 +4797,16 @@ fn print_vendor_closing(
.iter()
.filter(|f| flavor_install_command(f).is_some())
.all(|f| JVM_TOOLS.contains(&f.as_str()));
let reinstall = if jvm_only {
// A gem committed for a rules_ruby hub is installed by the Bazel
// build alone: Bundler by itself fails on its source, which the
// warning of the run says.
let advisory = socket_patch_core::vendor::gem::BAZEL_FILE_SOURCE;
let for_bazel = |e: &&PatchEvent| e.error_code.as_deref() == Some(advisory);
let for_bazel = env.events.iter().filter(for_bazel).count();
let only_for_bazel = for_bazel > 0 && for_bazel == env.summary.applied as usize;
let reinstall = if only_for_bazel {
"Build with Bazel, which installs the committed gems".to_string()
} else if jvm_only {
let cmds: Vec<String> = installs.iter().map(|c| format!("`{c}`")).collect();
// The block of a hub is in a file of the checkout's own.
let how = match installs == [HUB_BUILD] {
Expand All @@ -4815,6 +4824,12 @@ fn print_vendor_closing(
format!("Run {} to update the installed tree", cmds.join(" and "))
};
let mut extra = Vec::new();
if for_bazel > 0 && !only_for_bazel {
extra.push(
"Build with Bazel as well: it alone installs the gems committed for its hub."
.to_string(),
);
}
if wired_flavors.contains("bun") && common.cwd.join("bun.lockb").exists() {
extra.push(
"For binary Bun workspaces, also commit the workspace members' \
Expand Down
Loading
Loading