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

Only include gems in bundled or default #6619

Merged
merged 1 commit into from Mar 15, 2021

Conversation

headius
Copy link
Member

@headius headius commented Mar 15, 2021

Fixes #6618

@headius headius added this to the JRuby 9.2.17.0 milestone Mar 15, 2021
@headius
Copy link
Member Author

headius commented Mar 15, 2021

I tested this by diffing the contents of the build jruby-stdlib jar as follows:

[] ~/projects/jruby-9.2/jrubyfixed $ cd ../jrubybroke

[] ~/projects/jruby-9.2/jrubybroke $ !jar
jar tf lib/target/jruby-stdlib-9.2.17.0-SNAPSHOT.jar | sort > stdlibjar.txt

[] ~/projects/jruby-9.2/jrubybroke $ cd ../jrubyfixed

[] ~/projects/jruby-9.2/jrubyfixed $ jar tf lib/target/jruby-stdlib-9.2.17.0-SNAPSHOT.jar | sort > stdlibjar.txt

[] ~/projects/jruby-9.2/jrubyfixed $ diff -u stdlibjar.txt ../jrubybroke/stdlibjar.txt 

[] ~/projects/jruby-9.2/jrubyfixed $

As unbelievable as it seems, apparently my change introduced no diffs into this jar.

Testing against a local dev build will include other bits like bin/* that are not from the bundled or default gems, but the gem dir contents should be the same.

@headius
Copy link
Member Author

headius commented Mar 15, 2021

Verification locally seems to indicate that this is working properly.

I changed the **/* gem home glob to instead be more specific about the gem names and versions to include:

  • specifications/default/* to include specifications for all default gems
  • all_gems.map {|name,version| "specifications/#{name}-#{version}*"} to include specifications for bundled gems
  • all_gems.map {|name,version| "gems/#{name}-#{version}*/**/*"} to include gem dirs for bundled and default gems
  • all_gems.map {|name,version| "cache/#{name}-#{version}*"} to include cached gem files for bundled and default gems

Diff of a deployed 9.2.17.0 tarball vs a 9.2.16.0 shows the same diffs as in #6609:

$ diff -qr jruby-9.2.16.0/ jruby-9.2.17.0/
Only in jruby-9.2.17.0/bin: install_doc
Only in jruby-9.2.17.0/bin: install_doc.bat
Files jruby-9.2.16.0/bin/jruby and jruby-9.2.17.0/bin/jruby differ
Files jruby-9.2.16.0/bin/jruby.bash and jruby-9.2.17.0/bin/jruby.bash differ
Only in jruby-9.2.17.0/bin: lock_jars
Only in jruby-9.2.17.0/bin: lock_jars.bat
Only in jruby-9.2.17.0/bin: racc
Only in jruby-9.2.17.0/bin: racc.bat
Files jruby-9.2.16.0/lib/jruby.jar and jruby-9.2.17.0/lib/jruby.jar differ
Only in jruby-9.2.16.0/lib/ruby/gems/shared/gems: fileutils-1.1.0
Only in jruby-9.2.17.0/lib/ruby/gems/shared/gems: racc-1.5.2-java
Only in jruby-9.2.16.0/lib/ruby/gems/shared/gems: webrick-1.6.1
Files jruby-9.2.16.0/lib/ruby/stdlib/org/yaml/snakeyaml/1.26/snakeyaml-1.26.jar and jruby-9.2.17.0/lib/ruby/stdlib/org/yaml/snakeyaml/1.26/snakeyaml-1.26.jar differ
Files jruby-9.2.16.0/lib/ruby/stdlib/org/yaml/snakeyaml/maven-metadata-local.xml and jruby-9.2.17.0/lib/ruby/stdlib/org/yaml/snakeyaml/maven-metadata-local.xml differ

Note that the bin/jruby and bin/jruby.bash scripts differ due to #6615.

@headius headius requested a review from enebo March 15, 2021 21:53
@headius headius merged commit d17567e into jruby:jruby-9.2 Mar 15, 2021
@headius headius deleted the narrow_included_gems branch March 15, 2021 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant