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

Declarative pipeline restricted in code size

    Details

    • Similar Issues:

      Description

      When working with a declarative pipeline script, we run into an error "Method Code too large".

      This seems to happen when the code between 'pipeline{}' is more than a specific size. 

       

      I'm creating this issue for this component following the suggestion of Jesse Glick at the issue 37984

      I've attached a declarative pipeline script that reproduces the issue. 

       

       

        Attachments

          Issue Links

            Activity

            Hide
            eplodn1 efo plo added a comment -

            Thanks Wim Gaethofs. I only wonder why this one is Major while the original has been a Blocker.

            Show
            eplodn1 efo plo added a comment - Thanks Wim Gaethofs . I only wonder why this one is Major while the original has been a Blocker.
            Hide
            bitwiseman Liam Newman added a comment -

            This PR will address this issue for scripts that do not use "def" variables before the "pipeline {}" block.  

            https://github.com/jenkinsci/pipeline-model-definition-plugin/pull/355

            Your example uses defs so it would still not be fixed.  Still, this is progress. 

             

            Show
            bitwiseman Liam Newman added a comment - This PR will address this issue for scripts that do not use "def" variables before the "pipeline {}" block.   https://github.com/jenkinsci/pipeline-model-definition-plugin/pull/355 Your example uses defs so it would still not be fixed.  Still, this is progress.   
            Hide
            wim Wim Gaethofs added a comment -

            Thanks for looking into this issue.  I'm glad to hear there is progress in fixing the issue. 

            Show
            wim Wim Gaethofs added a comment - Thanks for looking into this issue.  I'm glad to hear there is progress in fixing the issue. 
            Hide
            bitwiseman Liam Newman added a comment - - edited

            There is partial fix for this in v1.4.0.  Due to the extent to which it change how pipelines are executed it is turned off by default.  It can be turned on by setting a JVM property (either on the command-line or in Jenkins script console):

            org.jenkinsci.plugins.pipeline.modeldefinition.parser.RuntimeASTTransformer.SCRIPT_SPLITTING_TRANSFORMATION=true  

            As noted, this still works to some extent for pipelines using `def` variables, but not as well. 

             Please give it a try and provide feedback.  

            Show
            bitwiseman Liam Newman added a comment - - edited There is partial fix for this in v1.4.0.  Due to the extent to which it change how pipelines are executed it is turned off by default.  It can be turned on by setting a JVM property (either on the command-line or in Jenkins script console): org.jenkinsci.plugins.pipeline.modeldefinition.parser.RuntimeASTTransformer.SCRIPT_SPLITTING_TRANSFORMATION=true   As noted, this still works to some extent for pipelines using `def` variables, but not as well.   Please give it a try and provide feedback.  
            Hide
            eplodn1 efo plo added a comment -

            Thanks Liam Newman.

            With your fix, can the attachment be compiled and run?

            Show
            eplodn1 efo plo added a comment - Thanks Liam Newman . With your fix, can the attachment be compiled and run?
            Hide
            bitwiseman Liam Newman added a comment -

            efo plo

            Yes, even with the "def" variables, it was able to run the example without encountering "method too large". 

            Show
            bitwiseman Liam Newman added a comment - efo plo Yes, even with the "def" variables, it was able to run the example without encountering "method too large". 

              People

              • Assignee:
                bitwiseman Liam Newman
                Reporter:
                wim Wim Gaethofs
              • Votes:
                8 Vote for this issue
                Watchers:
                11 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: