Don't create directory entries in the isolated context jar

Review Request #2775 - Created Sept. 4, 2015 and submitted

Stu Hood
gmalmquist, jsirois
  • Creating directory entries in the isolated context jar causes directory entries in classes_by_target... but we don't need directory entries for jars containing classfiles.

Validated that the resulting jar did not have double slashes:

rm -Rf blah ; yes | ./pants --config-override=pants.ini.isolated clean-all publish.jar --force --no-dryrun --local=blah --named-snapshot=blah src/scala/sbt/inc/::

John Sirois
Stu Hood
Stu Hood
Review request changed

Status: Closed (submitted)

Change Summary:

Merged as 1bff7c0d1bc76b0d8fd0364070b0a41e38390934

John Sirois
One post-facto correction to the "but we don't need directory entries for jars containing classfiles" - this is not true for at least one case I no longer have at hand.  There was a Twitter internal bug that forced the python jar creation code (came before the current call out to JarTool code), that failed when directory entries were not present.  You should be able to find the internal RB or jira via git log over src/python/twitter/pants/java in the old science repo history, but there should be a change that introduced adding '/' ending entries and hopefully that RB or jira explains the case.  This may or may not still be a problem, but I'm guessing it is for some uses of classpaths in which case pants should be producing classpath jars with directory entries.
  1. Yea, I encountered this one as well. It was related to resources in jars though (ie, getResource("/xyz/") expecting non-null) rather than classfiles.