1
votes

I have a build.xml that compiles and tests some scala code. Running the ant task from the command line produces the desired result, however when TeamCity runs it, all sorts of weirdness happens, including the following:

Checking for changes [15:35:02]Publishing internal artifacts [15:35:02]Clearing temporary directory: /opt/TeamCity/buildAgent/temp/buildTmp [15:35:02]Checkout directory: /opt/TeamCity/buildAgent/work/d80416000445458a [15:35:02]Updating sources: server side checkout [15:35:03]Step 1/1: Unit Tests (Ant) (3s) [15:35:03][Step 1/1] Starting: /usr/lib/jvm/java-7-oracle/jre/bin/java -Dagent.home.dir=/opt/TeamCity/buildAgent -Dagent.name=Default Agent -Dagent.ownPort=9090 -Dagent.work.dir=/opt/TeamCity/buildAgent/work -Dant.home=/usr/share/ant -Dbuild.number=18 -Dbuild.vcs.number=640c1de055a395d24227ae9edb45df085bed6b14 -Dbuild.vcs.number.1=640c1de055a395d24227ae9edb45df085bed6b14 -Dbuild.vcs.number.TestingDemo_GitBitbucketOrgBinarygiantTestingdemoGitRefsHeadsMaster=640c1de055a395d24227ae9edb45df085bed6b14 -Djava.io.tmpdir=/opt/TeamCity/buildAgent/temp/buildTmp -Dteamcity.agent.cpuBenchmark=570 -Dteamcity.agent.dotnet.agent_url=http://localhost:9090/RPC2 -Dteamcity.agent.dotnet.build_id=18 -Dteamcity.auth.password=ao0IEeHYnor3kuDxE93mXSEiAANWd3Y4 -Dteamcity.auth.userId=TeamCityBuildId=18 -Dteamcity.build.changedFiles.file=/opt/TeamCity/buildAgent/temp/buildTmp/changedFiles648007365561156996.txt -Dteamcity.build.checkoutDir=/opt/TeamCity/buildAgent/work/d80416000445458a -Dteamcity.build.id=18 -Dteamcity.build.properties.file=/opt/TeamCity/buildAgent/temp/buildTmp/teamcity.build4342271452757354958.properties -Dteamcity.build.tempDir=/opt/TeamCity/buildAgent/temp/buildTmp -Dteamcity.build.workingDir=/opt/TeamCity/buildAgent/work/d80416000445458a -Dteamcity.buildConfName=runTests -Dteamcity.buildType.id=TestingDemo_RunTests -Dteamcity.configuration.properties.file=/opt/TeamCity/buildAgent/temp/buildTmp/teamcity.config8282155595117054162.properties -Dteamcity.projectName=TestingDemo -Dteamcity.runner.properties.file=/opt/TeamCity/buildAgent/temp/buildTmp/teamcity.runner8434162286646669877.properties -Dteamcity.runtime.props.file=/opt/TeamCity/buildAgent/temp/agentTmp/ant1290368989221761450runtime -Dteamcity.tests.recentlyFailedTests.file=/opt/TeamCity/buildAgent/temp/buildTmp/testsToRunFirst3580939489665315320.txt -Dteamcity.version=8.0.5 (build 27692) -classpath /usr/share/java/ant-launcher-1.8.2.jar org.apache.tools.ant.launch.Launcher -lib /opt/TeamCity/buildAgent/plugins/antPlugin/ant-runtime.jar:/opt/TeamCity/buildAgent/lib/runtime-util.jar -listener jetbrains.buildServer.agent.ant.AgentBuildListener -buildfile /opt/TeamCity/buildAgent/work/d80416000445458a/build.xml tests [15:35:03][Step 1/1] in directory: /opt/TeamCity/buildAgent/work/d80416000445458a [15:35:05][Step 1/1] init (1s) [15:35:05][init] taskdef [15:35:06] [taskdef] java.lang.VerifyError: Bad type on operand stack Exception Details:
Location: scala/tools/ant/Scalac.writeSettings$1(Lscala/tools/nsc/Settings;Lscala/collection/immutable/List;)Ljava/io/File; @75: invokevirtual Reason: Type 'scala/collection/immutable/List' (current frame, stack[0]) is not assignable to 'scala/collection/AbstractIterable' Current Frame: bci: @75 flags: { } locals: { 'scala/tools/ant/Scalac', 'scala/tools/nsc/Settings', 'scala/collection/immutable/List', top, top, 'scala/collection/immutable/List', 'java/io/File', 'java/io/PrintWriter' } stack: { 'scala/collection/immutable/List' } Bytecode: 0000000: 1304 d013 04d2 b804 d63a 0619 06b6 04d9 0000010: bb04 db59 bb04 dd59 bb04 df59 1906 b704 0000020: e1b7 04e4 b704 e53a 072b b604 e9bb 04eb 0000030: 592a 1907 b704 eeb9 04f3 0200 2c3a 0519 0000040: 05b9 04f6 0100 9a00 2a19 05b6 04f9 4e2d 0000050: c002 733a 0419 072a 1904 b602 a9b6 04fb 0000060: b604 fe19 05b6 0503 c001 3b3a 05a7 ffd2 0000070: 1907 b605 0619 06b0 3a08 1907 b605 0619 0000080: 08bf Exception Handler Table: bci [41, 112] => handler: 120 Stackmap Table: full_frame(@63,{Object[#2],Object[#685],Object[#315],Top,Top,Object[#315],Object[#627],Object[#1243]},{}) same_frame(@112) full_frame(@120,{Object[#2],Object[#685],Object[#315],Top,Top,Top,Object[#627],Object[#1243]},{Object[#75]}) [15:35:06][Step 1/1] Process exited with code 1 [15:35:06][Step 1/1] Ant output [15:35:06][Ant output] Stackmap Table: [15:35:06][Ant output]
full_frame(@63,{Object[#2],Object[#685],Object[#315],Top,Top,Object[#315],Object[#627],Object[#1243]},{}) [15:35:06][Ant output] same_frame(@112) [15:35:06][Ant output]
full_frame(@120,{Object[#2],Object[#685],Object[#315],Top,Top,Top,Object[#627],Object[#1243]},{Object[#75]}) [15:35:06][Ant output] [15:35:06][Ant output] at java.lang.Class.forName0(Native Method) [15:35:06][Ant output] at java.lang.Class.forName(Class.java:270) [15:35:06][Ant output] at org.apache.tools.ant.taskdefs.Definer.addDefinition(Definer.java:594) [15:35:06][Ant output] at org.apache.tools.ant.taskdefs.Definer.execute(Definer.java:239) [15:35:06][Ant output] at org.apache.tools.ant.taskdefs.Antlib.execute(Antlib.java:177) [15:35:06][Ant output] at org.apache.tools.ant.taskdefs.Definer.loadAntlib(Definer.java:443) [15:35:06][Ant output] at org.apache.tools.ant.taskdefs.Definer.execute(Definer.java:292) [15:35:06][Ant output] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291) [15:35:06][Ant output] at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source) [15:35:06][Ant output] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [15:35:06][Ant output] at java.lang.reflect.Method.invoke(Method.java:606) [15:35:06][Ant output] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) [15:35:06][Ant output] at org.apache.tools.ant.Task.perform(Task.java:348) [15:35:06][Ant output] at org.apache.tools.ant.Target.execute(Target.java:390) [15:35:06][Ant output] at org.apache.tools.ant.Target.performTasks(Target.java:411) [15:35:06][Ant output] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399) [15:35:06][Ant output] at org.apache.tools.ant.Project.executeTarget(Project.java:1368) [15:35:06][Ant output] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) [15:35:06][Ant output] at org.apache.tools.ant.Project.executeTargets(Project.java:1251) [15:35:06][Ant output] at org.apache.tools.ant.Main.runBuild(Main.java:809) [15:35:06][Ant output] at org.apache.tools.ant.Main.startAnt(Main.java:217) [15:35:06][Ant output] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280) [15:35:06][Ant output] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109) [15:35:06][Ant output] [15:35:06][Ant output] Total time: 2 seconds [15:35:06][Step 1/1] Step Unit Tests (Ant) failed [15:35:06]Publishing internal artifacts [15:35:06]Build finished

1

1 Answers

0
votes

Apparently, this is a JDK compiler bug #8006684

I just hit a similar problem in my Scala project:

Exception in thread "main" java.lang.RuntimeException: Exception in Application start method
    at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:894)
    at com.sun.javafx.application.LauncherImpl.access$000(LauncherImpl.java:56)
    at com.sun.javafx.application.LauncherImpl$1.run(LauncherImpl.java:158)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.VerifyError: Bad type on operand stack
Exception Details:
  Location:
    db/DB.string$1(Ljava/lang/String;)Ljava/lang/String; @107: invokespecial
  Reason:
    Type 'java/lang/String' (current frame, stack[3]) is not assignable to 'db/DB'
  Current Frame:
    bci: @107
    flags: { }
    locals: { 'java/lang/String', 'java/lang/String', integer }
    stack: { 'scala/collection/Iterator', uninitialized 102, uninitialized 102, 'java/lang/String' }
  Bytecode:
    0000000: 129d 2a4c 59c7 000b 572b c600 0da7 000e
    0000010: 2bb6 014f 9900 072a a700 60b2 0154 b200
    0000020: 7e2a b601 5703 b601 5b3d 1caa 0000 0011
    0000030: 0000 0001 0000 0001 0000 0015 2aa7 003b
    0000040: bb01 5d59 b200 7ebb 015d 59b2 007e 2ab6
    0000050: 0157 b701 5e04 b601 61c0 0099 b601 57b7
    0000060: 015e 05b6 0165 bb01 6759 2ab7 016a b901
    0000070: 6e02 00b9 0171 0100 b0                 
  Stackmap Table:
    full_frame(@16,{Object[#153],Object[#153]},{Object[#153]})
    same_frame(@23)
    same_frame(@27)
    append_frame(@60,Integer)
    same_frame(@64)
    full_frame(@120,{Object[#153],Object[#153]},{Object[#153]})

    at global.State$.<init>(State.scala:14)
...