[p4perl] Problem using P4->FetchClient() (CALL#2151058)

Scott Lavender Scott.Lavender at visiprise.com
Thu Sep 18 11:44:47 PDT 2008

Attached test script run as both users.

Using Perforce Client Workspace "build_ProdTest" ...

TEST: $client is a HASH reference, HASH(0x2a0a81c).
TEST: that has 11 keys.
TEST: Root => D:\P4Views\build_ProdTest
TEST: Options => noallwrite noclobber nocompress unlocked nomodtime
TEST: View => ARRAY(0x2a0a8a0)
TEST: Owner => build
TEST: LineEnd => local
TEST: Update => 2008/09/18 09:15:38
TEST: Client => build_ProdTest
TEST: Description => Created by build.

TEST: SubmitOptions => submitunchanged
TEST: Access => 2008/09/18 14:39:35

Using Perforce Client Workspace "build_ProdTest" ...

TEST: $client is a  reference, .
TEST: that has 0 keys.

-----Original Message-----
From: Harold MacKiernan [mailto:support at perforce.com] 
Sent: Thursday, September 18, 2008 2:09 PM
To: Scott Lavender; p4perl at perforce.com
Subject: Re: Problem using P4->FetchClient() (CALL#2151058)

Hello Scott:

I suspect some part of the Perforce environment is not set correctly
for 'DOMAIN2\User2'.  You can confirm what values are in force, and
how they are set (via evironment, registry, P4CONFIG file) by using 'p4
set' from the command line:

  1) Log in as DOMAIN2\User2
  2) From a Command Prompt, issue:

     p4 set

  3) The output will be something like the following:
     P4PORT= (set)
     P4USER=hmackiernan (set -s)
     P4CLIENT=hmackiernan_client (config)

Values marked 'set' were set in the registry for the current user via
'p4 set'.  Values marked 'set -s' were set for _all_ users via 'p4 set
-s'.  Values marked 'config' are set in a configuration file and
values not otherwise marked are set via environment variables.

You can use a configuration file in lieu of relying on environment
variables to set P4PORT/P4USER/P4CLIENT for your build script. P4Perl
will look for this file (Based on the value of 'P4CONFIG') to find its
Perforce environment settings:

  1) Create a file called 'p4config.txt' with the values you want for
     your build script in the same format as above, e.g.:


  2) Save the file in the same location as the build script. 

  3) Set the registry value of 'P4CONFIG' for all users 'p4config.txt'
     by issuing: 

       p4 set -s P4CONFIG=p4config.txt

I hope that's helpful to you, but if you are still having difficulty
or if you have further questions, please let me know and I'll be happy
to assist you further.  In that case, would you please include:

  - the output of 'p4 info'
  - your version of P4Perl:
      perl -e "use P4;print P4::Identify();
  - your build script (if you wouldn't mind) so that I can see where
    else it might be tripping up

Thanks very much, and Best Regards,


On Thu Sep 18 10:01:07 PDT 2008 Adam Morriss <support at perforce.com>
> Hi Scott.
> > We have a production build system that is working as expected. As a
> > of the build process, we have a Perl front-end script that sets up
> > client workspace by adding the branch to be built and synching the
> > workspace before the build processing is launched. Test code
> > added shows that the value returned from the call to p4->FetchClient
> > correct.
> <snip>

Harold MacKiernan
Perforce Software 
Technical Support
support at perforce.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: p4test.pl
Type: application/octet-stream
Size: 588 bytes
Desc: p4test.pl
URL: <http://maillist.perforce.com/pipermail/p4perl/attachments/20080918/55380b3b/attachment-0001.obj>

More information about the p4perl mailing list