Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] General Discussion

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 02-04-2004, 09:27 AM
shafjac shafjac is online now
Registered User
 
Join Date: 02-04-2004
Posts: 8
Question Log corruption?

It appears that one of the steps in my build process is corrupting my log file. The manifestation of this corruption is that this step does not get completely logged, and all the XML in the document before this step is deleted.

In this case, I have it running as the first step in my build process. It is a "Set Macro" action, the name of the macro is "BUILDFOLDER" and the value for it is the following:
Code:
["%BUILDROOT%\" & Year(Now) & "-" & vbld_PadLeft(CStr(Month(Now)), 2, "0") & "-" & vbld_PadLeft(CStr(Day(Now)), 2, "0") & " " & vbld_PadLeft(CStr(Hour(Now)), 2, "0") & vbld_PadLeft(CStr(Minute(now)), 2, "0")]
The beginning of my log file output is:
Code:
[ BLANK LINE ]
<status code='0'>Completed</status>
</step>
There's no XML declaration, no <log> element, no start <step> tag, nothing before that.

This becomes a big problem when I try to transform the XML document via HTML because the parser can't load it and thus can't transform it.

I've tried moving this step further along in the build process, and when I do that, it still deletes all the text above it in the log file. I've also tried logging to a text file instead of an XML file, and it still doesn't log this step (I'd really prefer XML anyway). I've tried turning off logging for this step (using Logging.bld as an example), and that doesn't seem to do anything.

Does anyone have any ideas?
Reply With Quote
  #2  
Old 02-04-2004, 10:19 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,013
It sounds like the log file is getting changed during the build. Can you provide a simple repro case? Please send

1) The info from Help | About | Install Info
2) The contents of the file listed at Tools | File Locations | Application Options
3) A .bld file that demonstrates the problem.

Thanks.
Reply With Quote
  #3  
Old 02-04-2004, 10:34 AM
shafjac shafjac is online now
Registered User
 
Join Date: 02-04-2004
Posts: 8
Thanks for the quick response. Here's my info:

Quote:
1) The info from Help | About | Install Info
Visual Build Professional 5.2
Evaluation Version: 53 uses remaining
Windows Version: 5.1.2600.1.0
Install path: C:\Program Files\VisBuildPro
cmax20u.dll version 2.1.0.21
SftTree_IX86_U_45.dll version 4.5a
unins000.exe version 51.9.0.0
VisBuildBld.dll version 5.2.0.2
VisBuildCmd.exe version 5.2.0.4
VisBuildCore.dll version 5.2.0.3
VisBuildDotNET.dll version 5.2.0.5
VisBuildExt.dll version 5.2.0.5
VisBuildLog.dll version 5.2.0.4
VisBuildMisc.dll version 5.2.0.3
VisBuildMS.dll version 5.2.0.2
VisBuildNet.dll version 5.2.0.3
VisBuildPro.exe version 5.2.0.6
VisBuildSvr.dll version 5.2.0.4

Quote:
2) The contents of the file listed at Tools | File Locations | Application Options
<?xml version='1.0'?>
<configuration>
<option name='CaseSensitiveBuildRuleComparisons'>0</option>
<option name='DefaultScriptEngine'>VBScript</option>
<option name='DelLogFileOnBuild'>1</option>
<option name='DelTempMacrosAfterBuild'>1</option>
<option name='EnvVarsInSystemMacros'>1</option>
<option name='LogDefaultStepProperty'>0</option>
<option name='LogFilename'>C:\Documents and Settings\All Users\Application Data\Kinook Software\Visual Build Professional\VisBuildPro.log</option>
<option name='LogFormat'>XML</option>
<option name='NestBuildRules'>1</option>
<option name='NestIncludeInBuild'>1</option>
<option name='PersistBuildStatus'>0</option>
<option name='ReevaluateAllBuildRules'>0</option>
<option name='SetProjectDirectory'>0</option>
<option name='StripLogLinefeedChar'>0</option>
</configuration>

Quote:
3) A .bld file that demonstrates the problem.
See attached.
Attached Files
File Type: bld logcorruption.bld (4.3 KB, 830 views)
Reply With Quote
  #4  
Old 02-04-2004, 12:44 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,013
The first step of the project sets the BUILDFOLDER macro, which is referenced by the project LOGFILE macro (%BUILDFOLDER%\BuildLog.xml), so the log file is getting changed by that step. With XML logging, you can't change the log file during a build, since that will leave you with two partial XML documents.

You safely can change the log file before the build starts in the project's vbld_BuildStarting event. The attached modified sample demonstrates this (to view the code, go to View | Script Editor | Project tab). The sample stores the macro as a temporary macro (which overrides the project macro) rather than a project macro so that the project does not get modified (which would result in the GUI prompting to save changes at the end of the build).

The Logging FAQ http://www.kinook.com/Forum/forumdisplay.php?forumid=15 also has information that may be helpful.
Attached Files
File Type: bld logcorruption2.bld (4.9 KB, 794 views)
Reply With Quote
  #5  
Old 02-04-2004, 03:24 PM
shafjac shafjac is online now
Registered User
 
Join Date: 02-04-2004
Posts: 8
Thanks!

Beautiful! I added your pre-build script, and that fixed the problem.

Thanks for the prompt resolution.
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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 06:12 PM.


Copyright © 1999-2023 Kinook Software, Inc.