Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-71147

IllegalArgumentException: Unknown os.arch building core on Linux aarch64 or s390x

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • core
    • Linux arm
    • 2.405

      After the 2.402 release we are seeing an error when building on arm.

      [ERROR] Step 'eclipse groovy formatter' found problem in 'Jenkinsfile':
      
      Caused by: java.lang.IllegalArgumentException: Unknown os.arch aarch64'. 

       

      logs added as an attachment

       

      I had a quick peak at the differences this release https://github.com/jenkinsci/jenkins/compare/jenkins-2.401...jenkins-2.402

       

      I looked like the related plugin version may have change https://github.com/jenkinsci/jenkins/compare/jenkins-2.401...jenkins-2.402#diff-9c5fb3d1b7e3b0f54bc5c4182965c4fe1f9023d449017cece3005d3f90e8e4d8R361 also some changes to the Jenkinsfile.  Not sure if related but figured I'd mention.  

       

      I wonder if this is related to our build environment or could affect anyone building on arm?

       

      For reference we are reverting the merge from our build https://github.com/wolfi-dev/os/pull/1583 note: we don't build CI on arm because of the terrible performance, which is why we are reverting a merge.

       

       

          [JENKINS-71147] IllegalArgumentException: Unknown os.arch building core on Linux aarch64 or s390x

          To clarify, this is building the latest Jenkins release from source on arm, not building with Jenkins on arm.

          James Rawlings added a comment - To clarify, this is building the latest Jenkins release from source on arm, not building with Jenkins on arm.

          Mark Waite added a comment - - edited

          Thanks for the report. I see a similar message when I attempt to build Jenkins core on s390x. It appears that the com.diffplug.common.swt.os.OS.calculateNative method throws an illegal argument exception when it does not recognize the architecture.

          The stack trace that I see is:

          Caused by: java.lang.IllegalArgumentException: Unknown os.arch s390x'.
              at com.diffplug.common.swt.os.OS.calculateNative (OS.java:147)
              at com.diffplug.common.swt.os.OS.detectPlatform (OS.java:113)
              at com.diffplug.common.swt.os.OS.detectPlatform (OS.java:120)
          

          I believe the failure is specific to the groovy formatter, since I can compile and format the git client plugin Java code without the groovy formatter. When I add the groovy formatter to the git client plugin pom file, it fails in the same way.

          It seems that the eclipse groovy formatter has specific knowledge of platforms that it supports, and Linux aarch64 and Linux s390x are not on its list of supported platforms.

          If I remove the groovy formatter from the root pom file, it compiles on s390x just fine. I assume the same for aarch64.

                     <antlr4>
                       <antlr4Formatter />
                     </antlr4>
          -          <groovy>
          -            <includes>
          -              <include>Jenkinsfile</include>
          -              <include>licenseCompleter.groovy</include>
          -            </includes>
          -            <greclipse>
          -              <file>config/greclipse.properties</file>
          -            </greclipse>
          -          </groovy>
                     <java combine.self="override">
                       <endWithNewline />
                       <importOrder />
          

          Mark Waite added a comment - - edited Thanks for the report. I see a similar message when I attempt to build Jenkins core on s390x. It appears that the com.diffplug.common.swt.os.OS.calculateNative method throws an illegal argument exception when it does not recognize the architecture. The stack trace that I see is: Caused by: java.lang.IllegalArgumentException: Unknown os.arch s390x'. at com.diffplug.common.swt.os.OS.calculateNative (OS.java:147) at com.diffplug.common.swt.os.OS.detectPlatform (OS.java:113) at com.diffplug.common.swt.os.OS.detectPlatform (OS.java:120) I believe the failure is specific to the groovy formatter, since I can compile and format the git client plugin Java code without the groovy formatter. When I add the groovy formatter to the git client plugin pom file, it fails in the same way. It seems that the eclipse groovy formatter has specific knowledge of platforms that it supports, and Linux aarch64 and Linux s390x are not on its list of supported platforms. If I remove the groovy formatter from the root pom file, it compiles on s390x just fine. I assume the same for aarch64. <antlr4> <antlr4Formatter /> </antlr4> - <groovy> - <includes> - <include>Jenkinsfile</include> - <include>licenseCompleter.groovy</include> - </includes> - <greclipse> - <file>config/greclipse.properties</file> - </greclipse> - </groovy> <java combine.self="override"> <endWithNewline /> <importOrder />

          Mark Waite added a comment -

          https://github.com/jenkinsci/jenkins/pull/7834 introduced automated formatting of the Jenkinsfile. I'm sure that basil will have a recommendation on how to handle it.

          Mark Waite added a comment - https://github.com/jenkinsci/jenkins/pull/7834 introduced automated formatting of the Jenkinsfile. I'm sure that basil will have a recommendation on how to handle it.

          Basil Crow added a comment -

          So file a ticket with Spotless and disable Spotless in the meantime on that platform with -Dspotless.check.skip.

          Basil Crow added a comment - So file a ticket with Spotless and disable Spotless in the meantime on that platform with -Dspotless.check.skip .

          James Rawlings added a comment - Raised https://github.com/diffplug/durian-swt/issues/20

          Thanks both for the responses - hey markewaite

          James Rawlings added a comment - Thanks both for the responses - hey markewaite

          Jesse Glick added a comment -

          Proposed in https://github.com/jenkinsci/jenkins/pull/7975 though for a different reason.

          Jesse Glick added a comment - Proposed in https://github.com/jenkinsci/jenkins/pull/7975 though for a different reason.

            vlatombe Vincent Latombe
            rawlingsj James Rawlings
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: