Command Line does not return 0 when successful

Please post all questions and comments regarding Help & Manual 7 here.

Moderators: Alexander Halser, Tim Green

ContiChris
Posts: 8
Joined: Wed Dec 21, 2016 11:36 am

Re: Command Line does not return 0 when successful

Unread post by ContiChris »

Hi Tim,
Still the same problem. The output with all the compiler messages to "on" looks like this:

Code: Select all

C:\Users>helpman D:\jenkins\myProject_help\myProject\myProject.hmxp /chm=D:\jenkins\myProject_help\output\chm\myProject_help.chm

C:\Users>#Help & Manual command line compiler version 7.3.3 build 4342
Compiling D:\jenkins\myProject_help\myProject\myProject.hmxp
[Info] Preparing topics
[Info] Preparing table of contents
[Info] Preparing project files
[Info] Preparing merged projects
[Info] Writing topics
[Info] Compilation of D:\jenkins\myProject_help\myProject\myProject.hmxp started 12/7/2017 1:28:47 PM
[Warning] Topic Design-Details references an undefined anchor: "#IO_STATUS" in topic Constants
[Compiler Results] Help compiler started: C:\Program Files (x86)\HTML Help Workshop\hhc.exe
[Info] Compiling help file
[Compiler Results] Microsoft HTML Help Compiler 4.74.8702  Compiling d:\jenkins\myProject_help\output\chm\myProject_help.chm   Compile time: 0 minutes,
0 seconds 54   Topics 275   Local links 0   Internet links 1   Graphic   Created d:\jenkins\myProject_help\output\chm\myProject_help.chm, 141,350 bytes
Compression decreased file by 194,645 bytes.
[Info] Compilation complete
mfg
Chris
Tim Frost
Posts: 319
Joined: Mon Nov 22, 2004 11:45 pm

Re: Command Line does not return 0 when successful

Unread post by Tim Frost »

Try fixing the warning. I find that my builds fail (which is what I need and expect) when I have unconnected links.
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Command Line does not return 0 when successful

Unread post by Tim Green »

Hi Chris,

The exit code is correct, this is your culprit:

Code: Select all

[Warning] Topic Design-Details references an undefined anchor: "#IO_STATUS" in topic Constants
Also note that entering anchors with upper case characters won't cause actual errors within the output, but they can confuse humans and lead to them creating external links that won't work. This is because all anchor IDs are downcased on publishing, so in the HTML your anchor will be #io_status. It's thus best to use only lower case.
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
Philippe
Posts: 7
Joined: Tue Nov 21, 2017 5:38 pm

Re: Command Line does not return 0 when successful

Unread post by Philippe »

Tim Green wrote:Hi Philippe,

If you're also getting this in the normal command console it would be helpful if you could send us a small demo project that reproduces the issue so that we can look into it. Pack everything in a zip and mail it to support AT ec-software.com (replace the AT with @) and we'll check it out. :)

Hi, I finally found the problem, it was actually related to user permissions. All is good now, but I have another question, which I will ask in a new thread.

Thanks for your help ! :)
ContiChris
Posts: 8
Joined: Wed Dec 21, 2016 11:36 am

Re: Command Line does not return 0 when successful

Unread post by ContiChris »

Hello again,
now I setup my project like I wanted but still problems with building from the command line and Jenkins.
On my build server the help file is generated even if the command line still doesn't get back to the prompt.

Code: Select all

C:\Users\uidu036s>helpman "D:\jenkins_rb00757\dust_help\DUST\DUST.hmxp" /chm=out.chm

C:\Users\uidu036s>#Help & Manual command line compiler version 7.3.3 build 4342
Compiling D:\jenkins_rb00757\dust_help\DUST\DUST.hmxp
[Info] Preparing topics
[Info] Preparing table of contents
[Info] Preparing project files
[Info] Preparing merged projects
[Info] Writing topics
[Info] Compilation of D:\jenkins_rb00757\dust_help\DUST\DUST.hmxp started 1/16/2018 3:18:32 PM
[Compiler Results] Help compiler started: C:\Program Files (x86)\HTML Help Workshop\hhc.exe
[Info] Compiling help file
[Compiler Results] Microsoft HTML Help Compiler 4.74.8702  Compiling d:\jenkins_rb00757\dust_help\DUST\out.chm   Compile time: 0 minutes, 0 seconds 63
   Topics 316   Local links 0   Internet links 1   Graphic   Created d:\jenkins_rb00757\dust_help\DUST\out.chm, 142,932 bytes Compression decreased fi
le by 208,535 bytes.
[Info] Compilation complete


Via Jenkins it does nothing. I only get a error with error code 1.

Code: Select all

14:05:40 [dust_help] Running batch script
14:05:40 
14:05:40 D:\jenkins_rb00757\dust_help>helpman "D:\jenkins_rb00757\dust_help\DUST\DUST.hmxp" /chm=out.chm 
[Pipeline] }
[Pipeline] // stage
[Pipeline] echo
14:05:41 ----------------------------------------------------------------------------------------------------
14:05:41 ----------------------------------------------------------------------------------------------------
14:05:41 ----------------------------------------------------------------------------------------------------
[Pipeline] }
[Pipeline] // ws
[Pipeline] }
[Pipeline] // timestamps
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: script returned exit code 1
Finished: FAILURE
Has anybody an idea what is going wrong here. I have more Jenkins pipelines that run batch commands and all of them are working, only HM bugs me.

--
Chris
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Command Line does not return 0 when successful

Unread post by Tim Green »

Hi Chris,
Has anybody an idea what is going wrong here. I have more Jenkins pipelines that run batch commands and all of them are working, only HM bugs me.
Have you activated all comments and a log so that you can see what HM 's CLI is complaining about?
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
ContiChris
Posts: 8
Joined: Wed Dec 21, 2016 11:36 am

Re: Command Line does not return 0 when successful

Unread post by ContiChris »

...that is also an additional problem.
I activated all of the comments in HM but I don't get any message via Jenkins.
I do the same with msbuild but here I get a lot of messages.
I absolutely have no idea why that is not working with HM. Maybe I first have to try hhc.exe and look if that is generating some messages.

--
Chris
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Command Line does not return 0 when successful

Unread post by Tim Green »

Hi Chris,

Sorry, but then I'm afraid we can't help you. Your only option there is to use a build system that does accept/display console messages correctly. Unfortunately, our developers say they don't currently have time to spend a few hours debugging one that doesn't. :?
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
ContiChris
Posts: 8
Joined: Wed Dec 21, 2016 11:36 am

Re: Command Line does not return 0 when successful

Unread post by ContiChris »

Hi Tim,
i think the problem is not on the build system. I changed the "helpman"-command to "hhc.exe". Also this generates a lot of messages.
And isn't it essential to work properly on a common build system like Jenkins?
ContiChris
Posts: 8
Joined: Wed Dec 21, 2016 11:36 am

Re: Command Line does not return 0 when successful

Unread post by ContiChris »

Additional attempt:
I built the chm with "/keeptemp"-option locally on my build server. Then I changed my Jenkins script so that it uses the HTML Help Workshop tool "hhc.exe" with the temporary generated "output.hhp". That works fine even if hhc.exe returns also with an exit code of 1 (but internet says that seems to be a problem of hhc). I also get some build messages on my Jenkins console output.
So, i think HM console does something wrong.
By the way, creating a PDF via Jenkins also doesn't work. The same behaviour.
Tim Frost
Posts: 319
Joined: Mon Nov 22, 2004 11:45 pm

Re: Command Line does not return 0 when successful

Unread post by Tim Frost »

I don't know whether you are aware that Windows normally directs program output in both the stdout and stderr files to the console. Some programs write log output to one of these, and some to the other. So if you see console output from one program and not from the other in your build system it is perhaps because you have configured it to log only one of these files, and without eliminating this issue it cannot be concluded that one of the programs "doesn't work".

I had never heard of Jenkins other than in this thread, and having had a quick look at the documentation and all its Windows-alien concepts I can see why I would never want to use it! But there are many Stack Overflow postings on the subject of mixing stdout and stderr in Jenkins which may help you, even if Jenkins does not natively use these names. It seems clear that the cause of the problem is that the process exit code is seen as 1, so until you can get your build system to display the log which I and everyone else always seem to see written by Helpman.exe, you will not know what in your Jenkins script is causing this error exit. Much earlier in this thread I had an issue with the exit code, but the cause was quickly resolved after seeing the log output.
Post Reply