Record the compile classpath used to compile jvm targets.

Review Request #3576 — Created March 16, 2016 and submitted

gmalmquist
pants
gmalmquist/compile-classpath-records
3050
pants-reviews
benjyw, nhoward_tw, stuhood, zundel
This change makes `jvm_compile` write text files storing the
classpath for each jvm target it compiles to:

    .pants.d/compile/zinc/<sha>/<target.id>/<sha>/classes/compile_classpath/<target.id>.txt

Since these files are written to the classes/ directory, they end
up being bundled into jvm binaries. This can be useful to determine
how an artifact was built after the fact.

This behavior is enabled by default, and can be disabled with:

    --no-compile-zinc-capture-classpath

Added tests to tests/python/pants_test/backend/jvm/tasks/jvm_compile/java/test_zinc_compile_integration.py.

CI went green here: https://travis-ci.org/pantsbuild/pants/builds/116469638
CI went green here: https://travis-ci.org/pantsbuild/pants/builds/116666267

  • 0
  • 0
  • 2
  • 0
  • 2
Description From Last Updated
  1. I'd like an assertion about the contents of the classpath file in the existence assertion, but other than that LGTM!

  2. Could you add an assertion about the contents of the file here?

  3. 
      
  1. 
      
  2. This is a little awkward, what about:

    path = os.path.join(outdir, 'compile_classpath', '{}.txt'.format(target.id))
    
  3. If we ever change anything about target ids, this is going to break. I'd prefer we use some kind of library function for this.

  4. 
      
  1. 
      
  2. src/python/pants/build_graph/target.py (Diff revision 2)
     
     

    This is still divorced from id(). It would be great to link the two implementations together.

    1. No it isn't? I changed id() to just return the result of this method.

    2. so you did, sorry about that.

  3. 
      
  1. Ship It!
  2. 
      
Review request changed

Status: Closed (submitted)

Change Summary:

In commit ff02fbdfe1047ef6356255834b906a7c753589bf. Thanks Nick & Eric!

  1. Ship It!
  2. 
      
Loading...