Kinook Software Forum

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

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 12-06-2003, 08:18 PM
Rich Peters Rich Peters is online now
Registered User
 
Join Date: 11-20-2003
Location: Discovery Bay
Posts: 7
Unhappy Setting Ignore Failure for all subroutine steps

I am trying to set the ignore failure property for all the steps in a script. I got the code below from you some time ago.
It sets ignore for the project steps, but not the subroutine steps. The net effect is that the build stops if there is an error, which is what I am trying to prevent:

here is the script, which I have in a step at the top of the bld file:

Option Explicit

Dim objSteps, idx

Set objSteps = Project.Steps(vbldStepMain)
' set all projects steps except first one to
' ignore failure
For idx = 1 To objSteps.Count-1
objSteps(idx).IgnoreFailure = True
Next

Set objSteps = Project.Steps(vbldStepSubroutine)
' set all projects subroutine steps to ignore failure
For idx = 0 To objSteps.Count-1
objSteps(idx).IgnoreFailure = True
Next
Reply With Quote
  #2  
Old 12-06-2003, 10:58 PM
kevina kevina is online now
Registered User
 
Join Date: 03-27-2003
Posts: 825
That code works for me...

That is some interesting code, I tested it, and it seems to work fine for me.

BTW, the Ignore Fail check box doesn't get updated in the grid, but the value is updated to True with this script for all Project Steps and Subroutine Steps (perhaps you wanted all Global Subroutine Steps to be flagged as well??).

If that is what you need, add this script code:

Set objSteps = Project.Steps(vbldStepGlobalSubroutine)
' set all projects subroutine steps to ignore failure
For idx = 0 To objSteps.Count-1
objSteps(idx).IgnoreFailure = True
Next

If that isn't what you needed, how exactly isn't it working for you?

Kevin
Reply With Quote
  #3  
Old 12-06-2003, 11:04 PM
Rich Peters Rich Peters is online now
Registered User
 
Join Date: 11-20-2003
Location: Discovery Bay
Posts: 7
Hmmm, how do you know it gets updated internally? What I see is with this macro having been run, If I get a VC.NET build error it stops the visual build process. I dont really care about the checkbox being updated visually as long as I can get the build to keep chugging along

thanks
rich
Reply With Quote
  #4  
Old 12-06-2003, 11:54 PM
kevina kevina is online now
Registered User
 
Join Date: 03-27-2003
Posts: 825
How I verified internal state change...

Here is the bld file I used to test the script code (all steps after the first will always fail [division by 0]).

Are you conditionally doing this step (marking all steps as Ignore Fail)? If not, why not just mark them Ignore Fail, remove the script step, save the build, and eliminate the need for this script code?

Kevin
Attached Files
File Type: bld setallignorefail.bld (1.9 KB, 1644 views)
Reply With Quote
  #5  
Old 12-07-2003, 12:41 AM
Rich Peters Rich Peters is online now
Registered User
 
Join Date: 11-20-2003
Location: Discovery Bay
Posts: 7
Aha,

but is fails when the project step is a subroutine call.

I have modified your sample.

Check it out.
Attached Files
File Type: bld setallignorefail.bld (2.7 KB, 1651 views)
Reply With Quote
  #6  
Old 12-07-2003, 03:07 PM
kevina kevina is online now
Registered User
 
Join Date: 03-27-2003
Posts: 825
It seemed to work for me...

I ran your modified script, and it seemd to work for me.

Here is the output I received:

Building project step 'Set Ignore Fail for all steps (including children)'...
Building project step 'Main Fail Step'...
Error at Line 2, Column 1 (Division by zero)
Building project step 'Child Fail Step'...
Error at Line 2, Column 1 (Division by zero)
Building project step 'Child Subroutine TEst'...
Building subroutine step 'Fail Subroutine'...
Error at Line 2, Column 1 (Division by zero)
Building project step 'Grandchild Fail Step'...
Error at Line 2, Column 1 (Division by zero)
Building project step 'Child Fail Step'...
Error at Line 2, Column 1 (Division by zero)
Building project step 'Grandchild Fail Step'...
Error at Line 2, Column 1 (Division by zero)
Building project step 'Grandchild Fail Step'...
Error at Line 2, Column 1 (Division by zero)
Build successfully completed.

It stepped thru all the steps (including the subroutine) without stopping...

BTW, I am using the latest version (5.1) available... What version are you using (I don't believe there were any changes recently that would affect this, however).

Kevin
Reply With Quote
  #7  
Old 12-08-2003, 10:57 AM
Rich Peters Rich Peters is online now
Registered User
 
Join Date: 11-20-2003
Location: Discovery Bay
Posts: 7
I got the test case to work as well. I closed and reopened the project, to get a correct setting for the ignore failure flag. Then I unclicked all and re-ran and it works.

However, I am still having a problem with my real project file. I applied the same treatment.
When I run it with ignore fail set, a step that executes another sub-project never completes. The log window for the subproject says build is complete, but it never shuts down the project file, and the calling project is in a wait state for it. any ideas about this one?
Reply With Quote
  #8  
Old 12-08-2003, 03:53 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
Need more details...

Ok, so it appears we have ruled out the script code marking a build's steps for Ignore Fail = True.

The issue at hand, then, is that a build is invoking another build, which is completing but not returning to the main build?

Is the subBuild setting it's steps to Ignore Fail = True? Is a step 'failing' there but not continuing? You say you see in the log window that the build is complete, but it never shuts down the 'project file'. First I assume you are running both these builds in the GUI (not from a command line). When you say 'project file' are you refering to the Visual Build Pro GUI or a project that you are compiling?

Please provide a little more detail on what is going wrong so we can narrow this down to a single problem... Or, ideally, can you create 2 small sample build scripts that reproduce the same error condition? That would be most helpful.

Kevin
Reply With Quote
  #9  
Old 12-10-2003, 11:24 AM
Rich Peters Rich Peters is online now
Registered User
 
Join Date: 11-20-2003
Location: Discovery Bay
Posts: 7
I've tried to narrow down a similar case with the test project, but it just doesnt fail. My real life project still fails. here is the output:

subproject doesnt close (the leave gui window open is not checked for the caller) and the master project is waiting forever.

output:


===============subproject
Build started at Dec 10 2003 12:40 AM
Building Release: Release 1
Error: -1016


Build finished at Dec 10 2003 12:40 AM

Process completed with exit code 1
Build successfully completed.

===============project
Building project step 'Build Micro-Magic Products'...
Building project step 'Build VC.NET MFC Toolset'...
Building project step 'VC.NET MFC Dlls'...
"C:\Program Files\VisBuildPro\VisBuildPro.exe" FORCE_REBUILD=1 IGNORE_FAILURE=Yes /s /b G:\scsiplus-mfc-4.0.bld
Reply With Quote
  #10  
Old 12-10-2003, 05:03 PM
kevina kevina is online now
Registered User
 
Join Date: 03-27-2003
Posts: 825
Try Console App mode...

Unfortunately, we have not been able to reproduce this error...

Would you be able to test running the secondary build in Console App mode? Obviously if you need to view the running sub-build during execution than this isn't an option.

Having this info will help pinpoint the location of this error condition a bit more...

Kevin
Reply With Quote
  #11  
Old 12-10-2003, 06:47 PM
Rich Peters Rich Peters is online now
Registered User
 
Join Date: 11-20-2003
Location: Discovery Bay
Posts: 7
The problem doesnt occur in the cmd line mode, so at least there is a workaround
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 07:57 AM.


Copyright © 1999-2023 Kinook Software, Inc.