Implement a synthetic jar that sets Class-Path to bypass ARG_MAX limit

Review Request #2672 - Created Aug. 21, 2015 and submitted

Information
Peiyu Wang
pants
peiyu/1988
1988, 2116
3812b1d...
Reviewers
pants-reviews
areitz, fkorotkov, jsirois, nhoward_tw, qma, stuhood

This will replace previous -cp long list of jars with a synthetic jar that include just one manifest file which sets classpath.

See https://docs.oracle.com/javase/7/docs/technotes/guides/extensions/spec.html#bundled

An example:

tw-mbp-peiyu:source peiyu$ unzip -q -c /var/folders/z8/hfw3c_sj25b2t3wmnlfq3kjm0000gn/T/tmpEoF_ax.jar META-INF/MANIFEST.MF|head
Class-Path: /Users/peiyu/workspace/source/.pants.d/bootstrap/bootstrap
 -jvm-tools/tool_cache/shaded_jars/org.pantsbuild.tools.junit.ConsoleR
 unner-c6805c19c0fc7c417f8bc40a79e63b2a5288ac58.jar /Users/peiyu/works
 pace/source/.pants.d/compile/jvm/zinc/jars/1c60e6c695b4.jar /Users/pe
 iyu/.ivy2/limiter/cache/org.easymock/easymock/jars/easymock-3.2.jar /
 Users/peiyu/.ivy2/limiter/cache/org.objenesis/objenesis/jars/objenesi
 s-1.3.jar /Users/peiyu/.ivy2/limiter/cache/cglib/cglib-nodep/jars/cgl
 ib-nodep-2.2.2.jar /Users/peiyu/.ivy2/limiter/cache/org.easymock/easy
 mockclassextension/jars/easymockclassextension-3.2.jar /Users/peiyu/.
 ivy2/limiter/cache/com.google.guava/guava/bundles/guava-16.0.1.jar /U

Note the slash '/' after resource directory names is required, without '/' are jar files

https://travis-ci.org/peiyuwang/pants/builds/76583366

Tested on some large twitter monorepo targets.

Issues

  • 1
  • 3
  • 0
  • 4
Description From Last Updated
Elsewhere in the codebase, JarTool has been used for this: it natively supports manifest entries, so it would be good ... Stu Hood Stu Hood
Stu Hood
Peiyu Wang
Andy Reitz
John Sirois
Peiyu Wang
Peiyu Wang
John Sirois
Peiyu Wang
John Sirois
Peiyu Wang
John Sirois
Peiyu Wang
Peiyu Wang
John Sirois
John Sirois
Peiyu Wang
Review request changed

Status: Closed (submitted)

Loading...