bug fix: remove duplicate 3rdparty jars in the bundle

Review Request #3412 - Created Feb. 2, 2016 and submitted

Information
Peiyu Wang
pants
2876
Reviewers
pants-reviews
kwlzn, nhoward_tw, patricklaw, stuhood, zundel

https://rbcommons.com/s/twitter/r/3329/ introduced classpath_util.classpath_by_targets

Among classpath grouped by target (3rdparty dependencies) duplicates are not
removed. So we see for example same guava library have more than one symlink
created. This results typically 10%-20% increase in size.

An example:

tw-mbp-peiyu:source peiyu$ ls -l dist/buildstats-package-dist-bundle/libs/|grep 3rdparty|grep guava
lrwxrwx---  1 peiyu  staff   95 Jan 20 13:53 3rdparty.jvm.cascading.cascading-local-4.jar -> /Users/peiyu/workspace/source/.pants.d/ivy/jars/com.google.guava/guava/bundles/guava-16.0.1.jar
lrwxrwx---  1 peiyu  staff   95 Jan 20 13:53 3rdparty.jvm.com.github.spullara.mustache.java.java-1.jar -> /Users/peiyu/workspace/source/.pants.d/ivy/jars/com.google.guava/guava/bundles/guava-16.0.1.jar
lrwxrwx---  1 peiyu  staff   95 Jan 20 13:53 3rdparty.jvm.com.google.guava.guava-0.jar -> /Users/peiyu/workspace/source/.pants.d/ivy/jars/com.google.guava/guava/bundles/guava-16.0.1.jar
lrwxrwx---  1 peiyu  staff   95 Jan 20 13:53 3rdparty.jvm.com.google.inject.extensions.guice-assistedinject-3.jar -> /Users/peiyu/workspace/source/.pants.d/ivy/jars/com.google.guava/guava/bundles/guava-16.0.1.jar
lrwxrwx---  1 peiyu  staff   95 Jan 20 13:53 3rdparty.jvm.com.google.inject.extensions.guice-multibindings-3.jar -> /Users/peiyu/workspace/source/.pants.d/ivy/jars/com.google.guava/guava/bundles/guava-16.0.1.jar
lrwxrwx---  1 peiyu  staff   95 Jan 20 13:53 3rdparty.jvm.com.google.inject.guice-2.jar -> /Users/peiyu/workspace/source/.pants.d/ivy/jars/com.google.guava/guava/bundles/guava-16.0.1.jar
lrwxrwx---  1 peiyu  staff   95 Jan 20 13:53 3rdparty.jvm.net.codingwell.scala-guice-2.jar -> /Users/peiyu/workspace/source/.pants.d/ivy/jars/com.google.guava/guava/bundles/guava-16.0.1.jar

This review removes duplicated jars.

Note: classpath.txt should still contain all the dependencies for the target.
No need to 'dedup' because they are used by intellij.

Note: this review is limited to bug fix. Next time when we remove the
use_target_id flag, will probably do more cleanups since the logic is getting
complicated.

https://travis-ci.org/peiyuwang/pants/builds/106558822 passed

Issues

  • 0
  • 1
  • 0
  • 1
Description From Last Updated
Yi Cheng
Yi Cheng
Nick Howard (Twitter)
Peiyu Wang
Nick Howard (Twitter)
Stu Hood
Peiyu Wang
Peiyu Wang
Review request changed

Status: Closed (submitted)

Change Summary:

Submitted as d68e83a23489a2d9b7af645eb7199443f7c8c90c

Loading...