Author Topic: Non-interactive building with Code::Blocks  (Read 6402 times)

Offline paavo512

  • Single posting newcomer
  • *
  • Posts: 8
Non-interactive building with Code::Blocks
« on: April 16, 2013, 02:32:15 pm »
Hi,

Is there any way to force C::B to run in a non-interactive way, like a --non-interactive command line option (which is not there) or something like that, so there would be no dialog boxes, ever? I'm asking as we are using it in nightly builds on Linux, on headless servers and there is nobody watching the screen or clicking the OK buttons. It appears it sometimes wants to display some random dialogs, like "Another program instance is currently running" or some crash report window or something (it is also crashing really often, but this is another topic). It would be much preferable if it just dumped the error message to stderr and exited with an error code.

TIA
Paavo

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Non-interactive building with Code::Blocks
« Reply #1 on: April 16, 2013, 05:27:00 pm »
There is or was a console build somewhere in SVN for Linux users with your problem.

Try looking for branch codeblocks_console.

Tim S.
« Last Edit: April 16, 2013, 05:28:35 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline paavo512

  • Single posting newcomer
  • *
  • Posts: 8
Re: Non-interactive building with Code::Blocks
« Reply #2 on: April 17, 2013, 12:43:24 pm »

Thanks for the response, I will try it out. First tests show that at least the "Another program instance is currently running" dialog box is still present. Maybe I can hack the code myself to deal with this.

Cheers
Paavo

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Non-interactive building with Code::Blocks
« Reply #3 on: April 17, 2013, 12:48:54 pm »
Thanks for the response, I will try it out. First tests show that at least the "Another program instance is currently running" dialog box is still present. Maybe I can hack the code myself to deal with this.
There are command line options, which should help you to fix this (--multiple-instances probably).
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Non-interactive building with Code::Blocks
« Reply #4 on: April 17, 2013, 01:07:39 pm »

Thanks for the response, I will try it out. First tests show that at least the "Another program instance is currently running" dialog box is still present. Maybe I can hack the code myself to deal with this.

Definitely in the in the console-version.

It is really headless and works on servers without xserver.

It's in: http://sourceforge.net/p/codeblocks/code/HEAD/tree/branches/codeblocks_console/ and linux-only (might also work on mac).
I did not update it for a long time and it is not a clean, but more or less hackky solution. Nevertheless it works fine with the conf-file up to release 12.11, but probaly not with the conf-files from trunk.

Offline paavo512

  • Single posting newcomer
  • *
  • Posts: 8
Re: Non-interactive building with Code::Blocks
« Reply #5 on: April 17, 2013, 02:07:28 pm »

Offline paavo512

  • Single posting newcomer
  • *
  • Posts: 8
Re: Non-interactive building with Code::Blocks
« Reply #6 on: April 17, 2013, 02:58:45 pm »
[
It's in: http://sourceforge.net/p/codeblocks/code/HEAD/tree/branches/codeblocks_console/ and linux-only (might also work on mac).

Oh, I see. I found what is probably an obsolete version from http://svn.code.sf.net/p/codeblocks/code/branches/codeblocks_console

Sorry, still do not get it. It seems SourceForge refers to the same repository which I already downloaded and compiled (http://svn.code.sf.net/p/codeblocks/code/branches/codeblocks_console) and this definitely wants to have $DISPLAY and to display build messages in a floating window, etc:

Code
altair 15:01:28 Linux> DISPLAY= /opt/codeblocks_console/bin/codeblocks --build --target=Debug BuildAcapella.workspace
Error: Unable to initialize gtk, is DISPLAY set properly?

altair 15:55:18 Linux> svn info ~/test/codeblocks_console/
Path: /home/paavo/test/codeblocks_console
Working Copy Root Path: /home/paavo/test/codeblocks_console
URL: http://svn.code.sf.net/p/codeblocks/code/branches/codeblocks_console
Repository Root: http://svn.code.sf.net/p/codeblocks/code
Repository UUID: 2a5c6006-c6dd-42ca-98ab-0921f2732cef
Revision: 8992
Node Kind: directory
Schedule: normal
Last Changed Author: jenslody
Last Changed Rev: 8423
Last Changed Date: 2012-09-30 01:26:41 +0300 (Sun, 30 Sep 2012)

Cheers
Paavo

Offline paavo512

  • Single posting newcomer
  • *
  • Posts: 8
Re: Non-interactive building with Code::Blocks
« Reply #7 on: April 17, 2013, 03:02:53 pm »

Ok, discovered also /opt/codeblocks_console/bin/codeblocks_con among the installed programs, this seems to be the right one!  :)

Thanks
Paavo

Offline paavo512

  • Single posting newcomer
  • *
  • Posts: 8
Re: Non-interactive building with Code::Blocks
« Reply #8 on: April 29, 2013, 10:41:16 am »

Ok, discovered also /opt/codeblocks_console/bin/codeblocks_con among the installed programs, this seems to be the right one!  :)


Yeah, the codeblocks console build seems otherwise nice, but actually it does not work. It remains hanging at random points. Is this a known problem?