warbler icon indicating copy to clipboard operation
warbler copied to clipboard

Duplicate files with Gem dependency using `:path`

Open fzakaria opened this issue 5 years ago • 7 comments

I've been using warbler to build a gem where one of the dependencies are :path => to a local gem

gem "some-gem", :path => "./gems/some-gem"

I've noticed that warbler is including the built gem in a gem directory within the JAR & the source directory itself (./gems/some-gem) from the :path variable

Not a big deal but it causes 2x files to be included for size/bloat

fzakaria avatar Jan 17 '20 16:01 fzakaria

Nevermind previous comment if it came through, I did not notice you did file it with Warbler.

Yes, this would be a good fix!

headius avatar Jan 20 '20 21:01 headius

@headius do you need a repro project ? I think it's pretty straightforward in explanation --

If you also point me to some good hunches for files & I can take a look.

fzakaria avatar Jan 21 '20 17:01 fzakaria

A repro would be helpful, sure! Not sure when I will circle back to this but any assistance you provide will help others contribute.

headius avatar Jan 21 '20 17:01 headius

@headius you can use the same repro https://github.com/fzakaria/warbler-bundler-jruby-failure that I've linked in https://github.com/jruby/jruby/issues/6045

After building the JAR you can just execute jar -tf to see the duplicate files.

jar -tf warbler-example.jar | grep demo 

gems/demo-1.0/
gems/demo-1.0/Gemfile
gems/demo-1.0/Gemfile.lock
gems/demo-1.0/README.md
gems/demo-1.0/demo.gemspec
gems/demo-1.0/lib/
gems/demo-1.0/lib/demo.rb
specifications/demo-1.0.gemspec
warbler-example/ruby-gems/demo/
warbler-example/ruby-gems/demo/Gemfile
warbler-example/ruby-gems/demo/Gemfile.lock
warbler-example/ruby-gems/demo/README.md
warbler-example/ruby-gems/demo/demo.gemspec
warbler-example/ruby-gems/demo/lib/
warbler-example/ruby-gems/demo/lib/demo.rb

fzakaria avatar Jan 27 '20 05:01 fzakaria

@fzakaria Thank you!

headius avatar Feb 10 '20 16:02 headius

I assume this isn't resolved by my fix for jruby/jruby#6045 but I have not yet looked into it.

headius avatar May 22 '20 23:05 headius

My intuition says no; since I still see this issue even with the Bundler workaround introduced to circumvent the expand_path bug.

fzakaria avatar May 23 '20 01:05 fzakaria