Quantcast

[JIRA] (JENKINS-15337) Conflict with Perforce and Jenkins using @ in workspace path

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-15337) Conflict with Perforce and Jenkins using @ in workspace path

JIRA noreply@jenkins-ci.org
Issue Type: Improvement Improvement
Affects Versions: current
Assignee: Unassigned
Components: perforce
Created: 27/Sep/12 2:54 PM
Description:

We use perforce as our SCM tool.

When multiple builds of the same JOB are run, Jenkins creates a workspace for each build (running job) with an '@n' appended (where n is a digit such as @2, @3, etc... ).

For example:
job1 - /Nodes/path/job
job2 - /Nodes/path/job@2
job3 - /Nodes/path/job@3
job4 - /Nodes/path/job@4

We use the Post-Build Task plugin to run a p4 commands (in a script) on any files where a compile error was introduced during the build.

The perforce command syntax uses '@' to specify specific versions of a file.
For example:
p4 annotate /the/path/to/my/file@45678

...The p4 command fails when the '@' is in the path:

p4 annotate /Nodes/path/job@4/the/path/to/my/file@45678

...Perforce tries to process /Nodes/path/job@4 only!

CODE
====
The location where the '@' is defined and used in the jenkins-core:

FILE: jenkins-core/src/main/javs/hudson/slaves/WorkspaceList.java

USED HERE
----------
> public synchronized Lease allocate(FilePath base, Object context) throws InterruptedException {
> for (int i=1; ; i++) { > FilePath candidate = i==1 ? base : base.withSuffix(COMBINATOR+i); > Entry e = inUse.get(candidate); > if(e!=null && !e.quick && e.context!=context) > continue; > return acquire(candidate,false,context); > }

DEFINED HERE
-------------
>private static final String COMBINATOR = System.getProperty(WorkspaceList.class.getName(),"@");
}

Environment: Any OS that can run the perforce p4 command.
Project: Jenkins
Labels: jenkins
Priority: Major Major
Reporter: Marek Gimza
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-15337) Conflict with Perforce and Jenkins using @ in workspace path

JIRA noreply@jenkins-ci.org
Rob Petti commented on Improvement JENKINS-15337

This sounds more like an issue with your script to me?

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-15337) Conflict with Perforce and Jenkins using @ in workspace path

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org
Rob Petti commented on Improvement JENKINS-15337

To clarify, you aren't properly escaping the path before passing it onto the perforce command line. The mapping is here:
http://www.perforce.com/perforce/r12.1/manuals/cmdref/o.fspecs.html

In your case, you will need to make your script replace @ in the path with %40. It will work properly then (or you can just reference the file using the relative path, rather than the absolute one).

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-15337) Conflict with Perforce and Jenkins using @ in workspace path

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org
Rob Petti resolved Improvement JENKINS-15337 as Not A Defect
Change By: Rob Petti (10/Oct/12 9:10 PM)
Status: Open Resolved
Resolution: Not A Defect
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Loading...