upgrade travis ci to use jdk 8

Review Request #4127 — Created July 30, 2016 and submitted

wisechengyi
pants
3735, 3741
pants-reviews
benjyw, jsirois, kwlzn, nhoward_tw, patricklaw, stuhood, zundel

Following the suggestion from https://github.com/travis-ci/travis-ci/issues/6371#issuecomment-235755718, use the new image then invoke jdk_switcher for set JAVA_HOME to jdk8.

Changes include:
1. use python 2.7.11 because the built in python 2.7.10 in the trusty image is compiled with 2 byte unicode, and cffi wheels are built with 4 byte unicode. https://github.com/travis-ci/travis-ci/issues/5107#issuecomment-204623681
2. explicitly requires cffi as lmdb conditionally requires it. https://github.com/dw/py-lmdb/blob/master/setup.py#L124-L140
3. add --jvm-platform-default-platform=java6 to some tests for backwards compatibility.

https://travis-ci.org/pantsbuild/pants/builds/148593322

ZU
  1. 
      
  2. Why are you removing this? Are you saying that pants will no longer work with the 1.6 JDK at all?

    If openjdk doesn't work, you can specify an explicit list and ordering of JDK distributions pants should use

    [jvm-distributions]
    paths: {
        "mac os x": ["/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home", "/Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home"],
        "linux": ["/usr/java/jdk1.8.0_92", "/usr/java/jdk1.7.0_80"],
      }
    

    So if travis has oracle 1.6 installed somewhere you should be able to tell pants to prefer it.

    1. jdk6 still works, at least i've tried that on my local linux box.

      will try specifying oraclejdk6 on travis.

    2. restored the test case.
      added oracle-jdk6-installer and explicitly remove the builtin openjdk6 from the image.

  3. 
      
WI
WI
ZU
  1. Ship It!
    1. I see I gave this a ship-it. What I did not realize at the time is that this change made pants incompatible with out BUILD system because we run junit-runner under the java 7 JVM.

  2. 
      
ST
  1. Thanks for doing this!

  2. .travis.yml (Diff revision 3)
     
     
     
     
     

    This comment is no longer accurate I think? Which means we won't use the docker-based build?

  3. .travis.yml (Diff revision 3)
     
     
     

    Should be able to do this by limiting the distributions that are used instead? IE:

    [jvm-distributions]
    minimum_version: 1.7.0
    

    ...would that eliminate the need to sudo too?

    1. Specifying 1.7 would affect some cases where java6 is needed (Eric's comment).

      Bad openjdk6 will be used if not explicitly deleted, or specified on distribution path (former approach chosen in this case)
      so sudo is needed to remove the bad JDKs and to invoke jdk_switcher.

      Added comments to reflect the use of sudo

  4. 
      
WI
ST
  1. Thanks!

  2. 
      
WI
Review request changed

Status: Closed (submitted)

Change Summary:

95a07b953988fe6604fed192ba2dc61e92183998 thanks!

ZU
  1. Just a note: adding the cffi dep has made it more difficult for me to make a release and distribute pants. It adds in a binary dependency on libffi and we don't have libffi installed on our CI machines or builder.

    1. See https://rbcommons.com/s/twitter/r/4314/

    2. sorry, wrong RB

  2. 
      
Loading...