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

Use original Bundler binstub from RubyGems to avoid version argument issues #2987

Merged
merged 1 commit into from
Jan 6, 2025

Conversation

vinistock
Copy link
Member

@vinistock vinistock commented Dec 13, 2024

Motivation

Closes #2862 and #2731 (comment)

Clearly, adding the Bundler version to the command causes trouble for people using binstubs in certain configurations.

I think I found a way to continue specifying the version, which guarantees that RubyGems will eagerly activate the right specification, while at the same time avoiding those issues.

Implementation

The idea is to invoke the original Bundler binstub generated by RubyGems directly. That way, even if there's a custom binstub, we avoid invoking it and use the default one (which accepts the version).

Automated Tests

Managed to write a test that fails before this fix.

Manual tests

  1. Create an executable file bin/bundle
  2. Add this code to the executable
#!/usr/bin/env ruby
raise "This should not be called"
  1. Add the bin directory to your PATH temporary: export PATH ./bin:$PATH
  2. Verify that booting the LSP does not fail exe/ruby-lsp

Copy link
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@vinistock vinistock added bugfix This PR will fix an existing bug server This pull request should be included in the server gem's release notes labels Dec 13, 2024 — with Graphite App
@vinistock vinistock marked this pull request as ready for review December 13, 2024 21:00
@vinistock vinistock requested a review from a team as a code owner December 13, 2024 21:00
@vinistock vinistock force-pushed the 12-13-stop_appending_bundler_version_to_command branch from a2aed7d to d27b530 Compare December 13, 2024 21:56
@vinistock vinistock changed the title Stop appending Bundler version to command Use original Bundler binstub from RubyGems to avoid version argument issues Dec 13, 2024
@vinistock vinistock force-pushed the 12-13-stop_appending_bundler_version_to_command branch 2 times, most recently from b32d9d4 to da831eb Compare December 16, 2024 14:44
@vinistock vinistock force-pushed the 12-13-stop_appending_bundler_version_to_command branch from da831eb to 37ad22c Compare January 2, 2025 19:40
@vinistock vinistock merged commit 5ae8e77 into main Jan 6, 2025
43 checks passed
@vinistock vinistock deleted the 12-13-stop_appending_bundler_version_to_command branch January 6, 2025 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix This PR will fix an existing bug server This pull request should be included in the server gem's release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bundle: "Could not find command" error
2 participants