[JIRA] (JENKINS-55001) Sandboxed System Groovy Scripts don't support multiple assignments (with Tuples)

1 view
Skip to first unread message

pibeitz@gmail.com (JIRA)

unread,
Dec 4, 2018, 5:02:03 AM12/4/18
to jenkinsc...@googlegroups.com
Pierre Beitz created an issue
 
Jenkins / Improvement JENKINS-55001
Sandboxed System Groovy Scripts don't support multiple assignments (with Tuples)
Issue Type: Improvement Improvement
Assignee: Andrew Bayer
Components: script-security-plugin
Created: 2018-12-04 10:01
Priority: Major Major
Reporter: Pierre Beitz

Use case

A sandoxed system script doesn't support multiple assignments (with Tuples):

def (a, b) = [1,2]
println a

Returns:

ERROR: Build step failed with exception 
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: 
General error during canonicalization: not supporting tuples yet
  • This is working in non sandboxed mode, but not in sandboxed mode.
  • Reproduced on the latest OSS LTS (2.138.3), with Groovy Plugin version 2.0 and Script Security Plugin version 1.49.

workaround

Do not use multiple assignments.

Note

It is supported in a Pipeline (as of workflow-cps 2.46, JENKINS-45575). It also works in non sandboxed mode.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

david.drum@scientificgames.com (JIRA)

unread,
Apr 7, 2020, 12:54:02 PM4/7/20
to jenkinsc...@googlegroups.com
David Drum commented on Improvement JENKINS-55001
 
Re: Sandboxed System Groovy Scripts don't support multiple assignments (with Tuples)

This also occurs when tabbing away from the Execute system Groovy script Build step when, I assume, Jenkins checks the script in a sandbox. It is possible to ignore the error, save the job configuration, and run the script successfully.

This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages