summaryrefslogtreecommitdiff
path: root/spec/support/builders.rb
diff options
context:
space:
mode:
authorBundlerbot <bot@bundler.io>2020-02-02 18:43:06 +0000
committerBundlerbot <bot@bundler.io>2020-02-02 18:43:06 +0000
commit203d02c3670083a95733afc1a9d7a870d1ae1c34 (patch)
treeaa7d8297c7cfec47636d4e942deed7aaa45868c3 /spec/support/builders.rb
parent88a2ccddb04c48f5181da3633443ff085c4f64c8 (diff)
parent2a53367358317f08947847a10364c2e2b2a744a0 (diff)
downloadbundler-203d02c3670083a95733afc1a9d7a870d1ae1c34.tar.gz
Merge #7614
7614: Workaround jruby issue r=deivid-rodriguez a=deivid-rodriguez <!-- Thanks so much for the contribution! If you're updating documentation, make sure you run `bin/rake man:build` and squash the result into your changes, so that all documentation formats are updated. To make reviewing this PR a bit easier, please fill out answers to the following questions. --> ### What was the end-user or developer problem that led to this PR? The problem is that if a Gemfile contains `:path` gem with a relative path, the bundler environment no longer works when the app is packaged as a `jar` with [warbler](https://github.com/jruby/warbler). ### What is your fix for the problem, implemented in this PR? <!-- Explain the fix being implemented. Include any diagnosis you run to determine the cause of the issue and your conclusions. If you considered other alternatives, explain why you end up choosing the current implementation --> Issue was introduced https://github.com/rubygems/bundler/commit/c7532ced89bbc8ddc7296c56391c1c3cc981c54a, since when `jruby` deals with urls of the form "uri:classloader", it has a weird inconsistency where `Pathname#expand_path` with an argument always returns `uri:classloader://` (double slash) as the canonical version of the path, while `Pathname#expand_path` without an argument always returns `uri:classloader/` (single slash) as the canonical version of it. ``` Pathname.new("uri:classloader://foo/bar").expand_path # => <Pathname:uri:classloader:/foo/bar> Pathname.new("uri:classloader:/foo/bar").expand_path # => <Pathname:uri:classloader:/foo/bar> Pathname.new("foo/bar").expand_path("uri:classloader://") # => <Pathname:uri:classloader://foo/bar> Pathname.new("foo/bar").expand_path("uri:classloader:/") # => <Pathname:uri:classloader://foo/bar> ``` That makes `Pathname#relative_path_from` (introduced with the offending commit) explode because we end up passing to different "uri:classloader" kind of paths to it. I believe this should be fixed in `jruby` be doing either or both of the following things: * Make `Pathname#expand_path` return consistent versions of "uri:classpath" paths. * Make `Pathname#relative_path_from` support different versions of "uri:classpath" paths, since they are both absolute paths after all. But I'm workarounding the issue in `bundler` by adding an extra `expand_path` call at an appropriate place to make sure that the URLs we pass to `Pathname#relative_path_from` have a consistent shape. Fixes #7598. NOTE: We currently don't have the ability to run a full test suite for every PR on jruby because it's too slow (#4796 attempted to improve that but it was never completed), and it doesn't even fully pass (#7603). As an alternative, I'm adding some realworld bare tests to be run under jruby, just to make sure common tasks like this one work. Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
Diffstat (limited to 'spec/support/builders.rb')
0 files changed, 0 insertions, 0 deletions