-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
[build] Reconcile Gemfile.lock in rb:pin with bundle lock, not bundle update #17772
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -187,8 +187,10 @@ task :lint do |_task, arguments| | |
| ) | ||
| end | ||
|
|
||
| desc 'Sync gem checksums from Gemfile.lock to MODULE.bazel (use force to re-download all)' | ||
| desc 'Reconcile Gemfile.lock and sync gem checksums to MODULE.bazel (use force to re-download all)' | ||
| task :pin, [:force] do |_task, arguments| | ||
| Bazel.execute('run', [], '//rb:bundle-lock') | ||
|
|
||
|
Comment on lines
+190
to
+193
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 1. Bundler runs twice in update rb:update runs //rb:bundle-update and then invokes rb:pin, which now always runs //rb:bundle-lock, causing an extra Bundler invocation on every update and potentially rewriting rb/Gemfile.lock a second time. This increases runtime and can introduce non-essential lockfile churn in the upgrade workflow. Agent Prompt
|
||
| gemfile_lock = 'rb/Gemfile.lock' | ||
| module_bazel = 'MODULE.bazel' | ||
| force = arguments[:force] == 'force' | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -35,5 +35,7 @@ | |
|
|
||
| FileUtils.mkdir_p(ENV["BUNDLE_PATH"]) | ||
|
|
||
| # The bundle subcommand (e.g. "lock" or "update") and any flags are supplied by | ||
| # the caller so a single script backs both //rb:bundle-lock and //rb:bundle-update. | ||
| ruby = RbConfig.ruby | ||
| exec ruby, "-S", "bundle", "update", *ARGV | ||
| exec ruby, "-S", "bundle", *ARGV | ||
|
Comment on lines
+38
to
+41
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 2. No bundle subcommand check rb/support/bundle.rb now forwards caller-supplied ARGV directly to bundle without validating a subcommand is present, so a misconfigured Bazel target or direct invocation can trigger Bundlerβs default/help behavior with unclear diagnostics. Adding a small guard makes failures deterministic and easier to debug. Agent Prompt
|
||
Uh oh!
There was an error while loading. Please reload this page.