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

Perforce plugin doesn't handle matrix axes names that contain a space

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Hi there,

      I'm using the Perforce plugin and I have got a matrix job called BuildJob1. In the Perforce plugin setup I've set "Client name format for slaves" to ${basename}-${nodename}.

      My User-defined axes for the matrix build are:

      CONFIG: Debug Release
      PLATFORM: "Any CPU" - note how I'm using quotes to handle the space.

      When BuildJob1 is triggered I get this:

      Using remote perforce client: BuildJob1_AssetGather-CONFIG-Debug-PLATFORM-Any CPU-PhyreBuild2

      Saving new client BuildJob1_AssetGather-CONFIG-Debug-PLATFORM-Any CPU-PhyreBuild2
      14:01:42 [Any CPU] $ "C:
      Program Files\\Perforce
      p4.exe" -s client -i
      14:01:42 Caught exception communicating with perforce. Error in client specification. Error detected at line 1. Wrong number of words for field 'Client'.
      14:01:42 For Command: C:
      Program Files\\Perforce
      p4.exe -s client -i
      14:01:42 With Data:
      14:01:42 ===================
      14:01:42 Client: BuildJob1_AssetGather-CONFIG-Debug-PLATFORM-Any CPU-PhyreBuild2
      14:01:42 Owner: jenkinsci
      14:01:42 Description: Created by jenkinsci.
      14:01:42 Root: c:\JCI\workspace\AssetGather\CONFIG\Debug\PLATFORM\Any CPU
      14:01:42 Options: noallwrite clobber nocompress unlocked nomodtime rmdir
      14:01:42 SubmitOptions: submitunchanged
      14:01:42 LineEnd: local
      14:01:42 View:

      As you can see the spaces are causing the problem. Creating a Perforce client spec with a space in the name is not valid.

      The Perforce plugin should be updated to replace the spaces in a client spec name with an underscore or hyphen or something. Could this be done please?

      I'm currently using Peforce plugin version 1.3.4

      Regards,
      Tom.

        Attachments

          Activity

          Hide
          tfields Thomas Fields added a comment -

          Hi

          I'm definitely specifying a view mapping because once I switch back to no space it works fine. My view mapping does contain a quoted path if that makes a difference at all?

          Regards
          Tom

          Show
          tfields Thomas Fields added a comment - Hi I'm definitely specifying a view mapping because once I switch back to no space it works fine. My view mapping does contain a quoted path if that makes a difference at all? Regards Tom
          Hide
          tfields Thomas Fields added a comment -

          And something else that just occurred to me is that I'm using $(JOB_NAME) in my view mapping.

          So my mapping is:

          //depot/project "//jenkins_$(JOB_NAME)/path with space"

          Cheers
          Tom

          Show
          tfields Thomas Fields added a comment - And something else that just occurred to me is that I'm using $(JOB_NAME) in my view mapping. So my mapping is: //depot/project "//jenkins_$(JOB_NAME)/path with space" Cheers Tom
          Hide
          rpetti Rob Petti added a comment -

          I tried that, and I still can't reproduce the problem... Try using 'workspace' instead of 'jenkins_$(JOB_NAME)'. It will automatically be replaced with the correct value.

          Show
          rpetti Rob Petti added a comment - I tried that, and I still can't reproduce the problem... Try using 'workspace' instead of 'jenkins_$(JOB_NAME)'. It will automatically be replaced with the correct value.
          Hide
          tfields Thomas Fields added a comment -

          Hi Rob,

          Using ${WORKSPACE} seemed to work.

          Cheers,
          Tom.

          Show
          tfields Thomas Fields added a comment - Hi Rob, Using ${WORKSPACE} seemed to work. Cheers, Tom.
          Hide
          rpetti Rob Petti added a comment -

          I would strongly advise against using ${WORKSPACE} since it gets replaced with the full path to the job workspace, and could give you unexpected results. No parameters are required in order to set the workspace name in the client specs itself, since it's designed to allow users to copy and paste specs with no modification. I suggest using a static value of some kind, such as 'workspace'.

           
          //depot/project/...  //workspace/... 
          

          If you really want to use a parameter, use ${P4CLIENT}. Though again, it just makes it more complicated than it should be.

          Show
          rpetti Rob Petti added a comment - I would strongly advise against using ${WORKSPACE} since it gets replaced with the full path to the job workspace, and could give you unexpected results. No parameters are required in order to set the workspace name in the client specs itself, since it's designed to allow users to copy and paste specs with no modification. I suggest using a static value of some kind, such as 'workspace'. //depot/project/... //workspace/... If you really want to use a parameter, use ${P4CLIENT}. Though again, it just makes it more complicated than it should be.

            People

            • Assignee:
              rpetti Rob Petti
              Reporter:
              tfields Thomas Fields
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: