diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2022-05-27 20:46:42 +0200 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2022-05-30 17:42:39 +0900 |
commit | ea31c5bcd1bc1a019a6aee2b3f3b16813d7ff96d (patch) | |
tree | 9a1ef608de38fbfa75e47adfa5264105ae13fd30 /spec/bundler/support | |
parent | 0d7d8f3777b4521b2e83d81c0f830941bfba7b9c (diff) |
[rubygems/rubygems] Fix crash when installing gems with symlinks
If BUNDLE_PATH is configured to a symlinked path, installing gems with
symlinks would crash with an error like this:
```
Gem::Package::SymlinkError: installing symlink 'man/man0/README.markdown' pointing to parent path /usr/home/stevewi/srv/mail/lib/tools/.vendor/ruby/3.1.0/gems/binman-5.1.0/README.markdown of /srv/mail/lib/tools/.vendor/ruby/3.1.0/gems/binman-5.1.0 is not allowed
```
This commit fixes the problem by changing the bundle path to be the
realpath of the configured value, right after we're sure the path has
been created.
https://github.com/rubygems/rubygems/commit/3cd3dd142a
Diffstat (limited to 'spec/bundler/support')
-rw-r--r-- | spec/bundler/support/builders.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/spec/bundler/support/builders.rb b/spec/bundler/support/builders.rb index aca31638ac..91f0106d7d 100644 --- a/spec/bundler/support/builders.rb +++ b/spec/bundler/support/builders.rb @@ -484,7 +484,7 @@ module Spec end @spec.authors = ["no one"] - @spec.files = @files.keys + @spec.files += @files.keys case options[:gemspec] when false @@ -589,7 +589,8 @@ module Spec class GemBuilder < LibBuilder def _build(opts) - lib_path = super(opts.merge(:path => @context.tmp(".tmp/#{@spec.full_name}"), :no_default => opts[:no_default])) + lib_path = opts[:lib_path] || @context.tmp(".tmp/#{@spec.full_name}") + lib_path = super(opts.merge(:path => lib_path, :no_default => opts[:no_default])) destination = opts[:path] || _default_path FileUtils.mkdir_p(lib_path.join(destination)) |