Exit code for madbuild.exe?

This forum is for all Flare related Tips and Tricks.
Have a tip or trick you use while working in Flare? Share it here.
Post Reply
chi111y
Jr. Propeller Head
Posts: 3
Joined: Mon Jul 26, 2010 10:54 am

Exit code for madbuild.exe?

Post by chi111y »

Hi,

My Hudson CI server runs a madbuild.exe batch job each night to build updated documentation. Unfortunately, I haven't been able to find any information about whether madbuild.exe returns a non-zero exit code if an error occurs. Usually this would be done on Windows by setting the %ERRORLEVEL% environment variable...

Without being able to check the exit code, I can't easily check if the build has failed.

Does anyone know if madbuild.exe supports this?

Will
chi111y
Jr. Propeller Head
Posts: 3
Joined: Mon Jul 26, 2010 10:54 am

Re: Exit code for madbuild.exe?

Post by chi111y »

Since no one replied, I sent a request to tech support and got this answer:
Thank you for contacting MadCap Technical Support.

Unfortunately madbuild currently does not support this feature. I've submitted a enhancement request to the developers regarding this issue. In the future, please reference this request with the number 37353. If this enhancement is implemented, we'll send you an e-mail mentioning this reference number.
SteveS
Senior Propellus Maximus
Posts: 2087
Joined: Tue Mar 07, 2006 5:06 pm
Location: Adelaide, far side of the world ( 34°56'0.78\"S 138°46'44.28\"E).
Contact:

Re: Exit code for madbuild.exe?

Post by SteveS »

Hi chi111y,

Welcome to the forums.

That being the case can you use your batch file as a wrapper for madbuild and do some form of test from within the .bat to confirm it has run correctly?
Image
Steve
Life's too short for bad coffee, bad chocolate, and bad red wine.
Madcap Guru
Sr. Propeller Head
Posts: 238
Joined: Tue Mar 17, 2009 10:41 pm

Re: Exit code for madbuild.exe?

Post by Madcap Guru »

There has been alkot of requests for that in the past, and the more people who request it the better the chance it will be added in the future,
Rick Ferrell
____________________________

Former Flare and Robohelp Support
Image
kwshaw1
Jr. Propeller Head
Posts: 4
Joined: Mon Dec 06, 2010 4:23 pm

Re: Exit code for madbuild.exe?

Post by kwshaw1 »

Anyone know if this issue has been addressed in Flare v7?
Greenland
Propeller Head
Posts: 11
Joined: Fri Oct 05, 2007 7:44 am

Re: Exit code for madbuild.exe?

Post by Greenland »

I've just made the test, and I'm quite disapointed that it still doesn't. Exit code seems to always equal 0.

Also, the madbuild.exe command will now automatically publish the generated documentation if a publishing target is specified in the project, and there is no option to prevent this (we were publishing with our own software beacause the MadCap publishing is actually not removing stale files properly).

It would be really nice to a have a command line builder that is able to return a status code, as we have currently no way of knowing if a documentation have been properly built or not.
NorthEast
Master Propellus Maximus
Posts: 6359
Joined: Mon Mar 05, 2007 8:33 am

Re: Exit code for madbuild.exe?

Post by NorthEast »

Greenland wrote:Also, the madbuild.exe command will now automatically publish the generated documentation if a publishing target is specified in the project, and there is no option to prevent this (we were publishing with our own software beacause the MadCap publishing is actually not removing stale files properly).
There is an option to prevent it publishing; on the target's Publishing tab, remove the tick from the Publish box for the destination(s).

This behaviour hasn't changed in v7, it works the same in v6.
Greenland
Propeller Head
Posts: 11
Joined: Fri Oct 05, 2007 7:44 am

Re: Exit code for madbuild.exe?

Post by Greenland »

Thanks fo the answer Dave. Indeed this option exists, but I wanted to be able to publish targets when building manually while not publishing them when batch building our project. However, we have changed our batches to adapt to this new behavior (also, we never used v6 of Flare, but went directly from v5 to v7, which is maybe why there are more diffrence for us to adjust to)
NorthEast
Master Propellus Maximus
Posts: 6359
Joined: Mon Mar 05, 2007 8:33 am

Re: Exit code for madbuild.exe?

Post by NorthEast »

Greenland wrote:Thanks fo the answer Dave. Indeed this option exists, but I wanted to be able to publish targets when building manually while not publishing them when batch building our project.
That shouldn't be a problem, as an individual target's publish setting is independent of what you set up in a batch target.

If you set a destination on the target's Publishing tab, it will be published if you do a command line build of the target (madbuild -target YourTarget).

However, if you include that target in a batch target, then the target isn't automatically published when you run the batch target (madbuild -batch YourBatchTarget); it will only be published if you have set it to publish in the batch target settings.
JGreen
Jr. Propeller Head
Posts: 1
Joined: Tue Jun 21, 2011 8:51 pm

Re: Exit code for madbuild.exe?

Post by JGreen »

Seriously guys, having a command line tool that knows of warnings and errors (as evidenced by the console output) but returns success (exit code 0) is amateurish in the extreme.

If your internal developers can't scatter some return x statements through the code it'd have to be cheap to outsource it somewhere.
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Exit code for madbuild.exe?

Post by LTinker68 »

JGreen wrote:If your internal developers can't scatter some return x statements through the code it'd have to be cheap to outsource it somewhere.
This is a peer-to-peer forum, not a support forum, so they're not our developers. You can submit a bug report at http://www.madcapsoftware.com/bugs/submit.aspx.

Welcome to the forums, though.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
chi111y
Jr. Propeller Head
Posts: 3
Joined: Mon Jul 26, 2010 10:54 am

Re: Exit code for madbuild.exe?

Post by chi111y »

Hurrah! madbuild.exe version 8 finally supports this feature! (Didn't get an email as promised though :P )

http://webhelp.madcapsoftware.com/flare ... d_Line.htm

My experience is that it's not completely bug-free however: contrary to what the docs in the link above mention, a successful build doesn't automatically set ERRORLEVEL to 0 - it simply leaves it at the value it was previously. It's therefore necessary to explicitly set ERRORLEVEL to 0 before madbuild is run.

To be honest, I don't know what *would* trigger a build failure. I tried removing a linked source file, and while the log shows an error ("Missing linked source file...") the ERRORLEVEL still remains unset. I'm going to check with MadCap support and see what the deal is. There's not much user value in having an error code if the only error it reports is an invalid license... :?
pvz
Propeller Head
Posts: 18
Joined: Wed Mar 05, 2008 3:27 pm
Location: Seattle

Re: Exit code for madbuild.exe?

Post by pvz »

Hoping to help someone else (and avoid an unnecessary feature request to Madcap), the v9 documentation includes a (more) complete list of error codes listed under the "ErrorLevel global variable" dropdown:

http://webhelp.madcapsoftware.com/flare ... d_Line.htm


common codes
0 = Success - No problems
1 = One or more Target Builds failed – One or more of the targets failed to compile
2 = One or more Publish Targets failed – One or more of the targets failed to compile
3 = Build completed with compiler warnings
4 = Compiler reported errors
5 = Failed to process one or more project import files
6 = Failed to load topic
7 = Missing linked file
other codes
-1 = Application error – Something critical has forced Flare to close
1000 = Zero arguments passed in
1001 = Show Help
2000 = Unlicensed Flare
2001 = Flare not activated
2002 = Invalid license activation code
2003 = License expired
2004 = Evaluation expired
2005 = Trial expired
2006 = Project does not exist
2007 = Batch file does not exist
Carsten Pedersen
Propeller Head
Posts: 95
Joined: Wed Feb 08, 2006 1:11 am

Re: Exit code for madbuild.exe?

Post by Carsten Pedersen »

More about the error code, or ERRORLEVEL.

Now in MadCap Flare v11 you have the Batch Target feature. How does the %ERRORLEVEL% act in this situation?

I, and probably also others, just want an indication if there are any errors or not. In larger project it is very difficult to avoid getting
a ton of warnings, but we aim at getting no errors :-)

-cpede
ChoccieMuffin
Senior Propellus Maximus
Posts: 2630
Joined: Wed Apr 14, 2010 8:01 am
Location: Surrey, UK

Re: Exit code for madbuild.exe?

Post by ChoccieMuffin »

Carsten, thank you so much for bringing this up, it's at a perfect time! I don't have any answers to the question but I wait with baited breath for one of the gurus to point me in the right direction.

:-)
Started as a newbie with Flare 6.1, now using Flare 2023.
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
Zanderxo
Propeller Head
Posts: 32
Joined: Mon Mar 09, 2015 5:28 pm

Re: Exit code for madbuild.exe?

Post by Zanderxo »

I am receiving an ExitCode of 2010 (and no output). What does this mean?
Also, it would be nice to have more information about each of the ExitCodes. Does this information exist somewhere?
Post Reply