Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] General Discussion
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1  
Old 03-01-2004, 06:53 AM
VBPbetaTest VBPbetaTest is online now
Registered User
 
Join Date: 11-18-2003
Posts: 8
Output - Wrong order of returned lines using 'Run Program' to launch Perl scripts

To do some treatments in ClearCase 3.2.1 Patch 3 & 5, I have to execute my commands in perl by launching "ccperl.exe myscript.prl".

So to launch these treatments automatically by Visual Build Pro, I use 'Run Program' action with the command "ccperl.exe myscript.prl".

Everything is ok concerning the result of the treatment.

The only problem I have is in the log:
if I use in my perl script, the 'print' command (like "print my comment") and after the 'system' command to do something, "my comment" will appear at the end of the log, after the description of the 'system' command.

So if I want to do this presentation:

Print ----------------------------------
Print Name of my program
Print Date – Time
Print Parameters
Print ----------------------------------
System('cleartool.exe DoMySomethingInClearCase')
Print End of the treatment – Time

I will read in the log:

Result of System('cleartool.exe DoMySomethingInClearCase') which could be thousands of lines
Print ----------------------------------
Print Name of my program
Print Date – Time
Print Parameters
Print ----------------------------------
Print End of the treatment - Time

Or (it depends of the number of lines of the result)

Part 1 of the result of System('cleartool.exe DoMySomethingInClearCase') which could be thousands of lines
Print ----------------------------------
Print Name of my program
Print Date – Time
Part 2 of the result of System('cleartool.exe DoMySomethingInClearCase') which could be thousands of lines
Print Parameters
Part 3 of the result of System('cleartool.exe DoMySomethingInClearCase') which could be thousands of lines
Print ----------------------------------
Print End of the treatment - Time

Is someone has any idea???

"Le petit frenchy"
NB: Sorry for my english ;o)
Reply With Quote
  #2  
Old 03-02-2004, 10:49 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
The Run Program action captures and logs stdout/stderr from a process in the same order as it is written, so it appears that the order of output you are experiencing is an effect of ccperl.exe.
Reply With Quote
  #3  
Old 03-02-2004, 10:55 AM
VBPbetaTest VBPbetaTest is online now
Registered User
 
Join Date: 11-18-2003
Posts: 8
But when I launch directly from DOS prompt "ccperl.exe myscript.prl", the result on the screen is ok.

Print ----------------------------------
Print Name of my program
Print Date – Time
Print Parameters
Print ----------------------------------
System('cleartool.exe DoMySomethingInClearCase')
Print End of the treatment – Time

Could the stdout captured by 'Run Program' action be different from the one of the DOS prompt?

Thanks for your help
Reply With Quote
  #4  
Old 03-02-2004, 11:10 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
What happens if you use a Run Program command of

%DOSCMD% ccperl.exe myscript.prl
Reply With Quote
  #5  
Old 03-02-2004, 11:27 AM
VBPbetaTest VBPbetaTest is online now
Registered User
 
Join Date: 11-18-2003
Posts: 8
Unhappy

Unfortunately, the result is still upside down.

I join you the log.

Anyway, thanks a lot for your support.
Attached Files
File Type: txt ccperl_log_build.txt (6.3 KB, 1981 views)
Reply With Quote
  #6  
Old 03-02-2004, 11:57 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
I wouldn't expect VBP to capture output in a different order, but apparently it does in this case. What is ccperl.exe? Is it part of ClearCase? If so, it will be difficult for us to debug since we don't have ClearCase here. Are you able to reproduce with something other than ccperl.exe that we would have access to?
Reply With Quote
  #7  
Old 03-02-2004, 01:04 PM
VBPbetaTest VBPbetaTest is online now
Registered User
 
Join Date: 11-18-2003
Posts: 8
I haven't found another program with similar behaviour, so I do for you a test package (zip send by email cause too big ;o).

files in :
- ccperl.exe
- ccperl4.exe
- ccperlglob.exe
- libatriaperl100.dll
- test_log_build.prl
- test_log_build.bld

You don't need to register anything; just let unzip in "C:\Program Files\ccperl"


Then, in DOS prompt, type "ccperl test_log_build.prl".
You should obtain:

--- Beginning of the process at: 18:58
create the file...
start the copy...
1 fichier(s) copié(s).
start the reading at: 18:58
content of the copied file:
-> the file is Test ccperl
--- End of the process at: 18:58


After, execute the project "test_log_build.bld"
You should obtain:

18:59
1 fichier(s) copi‚(s).
18:59
18:59
--- Beginning of the process at: create the file...
start the copy...
start the reading at: content of the copied file:
-> the file is Test ccperl
--- End of the process at:

Thanks for your help
Reply With Quote
  #8  
Old 03-02-2004, 02:07 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
It appears that ccperl.exe does something very non-standard (and possibly just plain wrong) when generating its output, because redirecting to a file from a Command Prompt (which I thought might be a good workaround):

ccperl test_log_build.prl >out.txt

also results in the incorrect output ordering. If you can find a way to get that to work, then you could use

%DOSCMD% ccperl test_log_build.prl >%TEMP%\out.txt

in the Run Program step, configuring it to read output from that file instead of stdout.
Reply With Quote
  #9  
Old 03-09-2004, 10:29 AM
VBPbetaTest VBPbetaTest is online now
Registered User
 
Join Date: 11-18-2003
Posts: 8
You're right!
ccperl seems to manage the dos prompt differently for the 'print' statement (

The only way I found is to replace all my

Print "my message";

by

System("cmd /c echo my message");

Really strange??!!

Anyway, thanks a lot for your support.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -5. The time now is 10:46 PM.


Copyright © 1999-2023 Kinook Software, Inc.