-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Make standalone bin load path relative to Bundler.root rather than CWD. #4264
Conversation
Issue #4144 |
Please add a spec for whatever it is you're fixing? |
@@ -130,12 +130,13 @@ def generate_bundler_executable_stubs(spec, options = {}) | |||
def generate_standalone_bundler_executable_stubs(spec) | |||
# double-assignment to avoid warnings about variables that will be used by ERB | |||
bin_path = Bundler.bin_path | |||
standalone_full_path = Pathname(File.join(Bundler.root, Bundler.settings[:path])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using File.join
isn't necessary, since Bundler.root
is already a Pathname
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, pushed a change for that.
fea9d71
to
f05c21a
Compare
@segiddins I'll try to come up with something. The bug appears to be exposed while using multiple jobs (threads) and isn't consistent. I could probably force the issue with mocks, but I'm not sure how good of a test that is. |
@@ -4,6 +4,7 @@ inherit_from: | |||
AllCops: | |||
TargetRubyVersion: 1.9 | |||
Exclude: | |||
- bundle/**/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this change should be unecessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I didn't intend to add it, though without it, trying to develop just using the rake tasks:
rake rubocop
<snip>
241 files inspected, 9403 offenses detected
7 errors occurred:
An error occurred while Performance/RedundantBlockCall cop was inspecting /Users/glenn.pratt/Code/bundler/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/nulllogger.rb.
An error occurred while Performance/RedundantBlockCall cop was inspecting /Users/glenn.pratt/Code/bundler/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/nulllogger.rb.
An error occurred while Performance/RedundantBlockCall cop was inspecting /Users/glenn.pratt/Code/bundler/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/nulllogger.rb.
An error occurred while Performance/RedundantBlockCall cop was inspecting /Users/glenn.pratt/Code/bundler/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/nulllogger.rb.
An error occurred while Performance/RedundantBlockCall cop was inspecting /Users/glenn.pratt/Code/bundler/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/nulllogger.rb.
An error occurred while Performance/RedundantBlockCall cop was inspecting /Users/glenn.pratt/Code/bundler/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/nulllogger.rb.
An error occurred while Performance/RedundantBlockCall cop was inspecting /Users/glenn.pratt/Code/bundler/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/nulllogger.rb.
Errors are usually caused by RuboCop bugs.
Please, report your problems to RuboCop's issue tracker.
Mention the following information in the issue report:
0.36.0 (using Parser 2.3.0.1, running on ruby 2.2.3 x86_64-darwin14)
RuboCop failed!
Make sure to use |
@segiddins same result with |
In that case, just |
We can't merge this until test coverage is added and the rubocop config change is backed out, sorry. |
No problem, I'm doing that now. |
439b6a9
to
61f7392
Compare
@segiddins I created a simple test though it doesn't fail with fake local gems anyway. It does fail using Rubygems and multiple jobs about 1/8th of the time. |
@glennpratt you can |
@segiddins well, I tried that but it exposed an apparently different bug ( |
On master, running from the subdirectory bob results in:
The binstubs also don't work:
So, I'm not exactly sure the correct behavior, but I can put a pending test in and a todo. |
61f7392
to
00390fe
Compare
@segiddins updated. |
end | ||
end | ||
|
||
describe 'with --binstubs run in a subdirectory' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
double quotes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
00390fe
to
1571c52
Compare
@homu r+ Thanks, @glennpratt ! |
📌 Commit 1571c52 has been approved by |
…ddins Make standalone bin load path relative to Bundler.root rather than CWD. See #4144
☀️ Test successful - status |
Create standalone bundler/setup.rb at a consistent path. While chasing a threading / chdir bug in #4264, I discovered `bundler/setup.rb` isn't written to a proper directory when run in a subdirectory and binstubs don't work (#4264 (comment)). This changes that so `bundler/setup.rb` is written relative to `Bundler.root` instead of `cwd` and expands test coverage a bit.
See #4144