Author Topic: CodeBlocks being called from hudson (on linux)  (Read 19869 times)

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5179
CodeBlocks being called from hudson (on linux)
« on: December 28, 2010, 11:22:25 pm »
Has anyone setup a job in hudson which should call CB ?

I have done it in the past on windows (well actually a self made executable was actually calling CB), I am trying something similar in linux, but now the hudson job immediately calls CB.

The hudson job executes :
Code: [Select]
/usr/local/bin/codeblocks --no-splash-screen --rebuild --target=Debug Arrays/Arrays.cbp

Note : hudson installation created a special hudson user to run the "hudson application (java war)".

However it fails, gtk issue :
Code: [Select]
Error: Unable to initialize gtk, is DISPLAY set properly?
Finished: FAILURE

This would be a typical error when it would be run as root, but how come this  special user also has these issues. Anyone any experience in this area ?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12005
    • Travis build status
Re: CodeBlocks being called from hudson (on linux)
« Reply #1 on: December 28, 2010, 11:38:18 pm »
Do you have a running X?
Do you start hudson from gui terminal or from cronjob, or hudson is even a daemon?
(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 jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: CodeBlocks being called from hudson (on linux)
« Reply #2 on: December 29, 2010, 09:24:52 am »
If hudson user seems to be allowed to start programs in your x-server, but it can not use it.
If you run xhost + before it. should work. It allows other users to use your X display.

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: CodeBlocks being called from hudson (on linux)
« Reply #3 on: December 29, 2010, 09:31:37 am »
If hudson user seems to be allowed to start programs in your x-server, but it can not use it.
If you run xhost + before it. should work. It allows other users to use your X display.
Better would be to just allow the hudson user access to your X displyay, because xhost + allows it for each and any user.
It should be doable with an Xaccess-file, but I have no time to look for it at the moment.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5179
Re: CodeBlocks being called from hudson (on linux)
« Reply #4 on: December 29, 2010, 09:44:06 am »
I just tried the suggestions (thanks),  but no luck.

First : hudson is start by a startup script in /etc/init.d/
Started by the user 'hudson', which I verified by doing a 'ps'.

I tried to : xhost + hudson ==> xhost:  bad hostname "hudson"

Then I tried : xhost +  ==> access control disabled, clients can connect from any host
Restarted hudson, but the problem persists.
When I go into YAST (Suse linux), user and groups, no sign of user hudson in there.

I am bumping into my linux knowledge limits :-(

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: CodeBlocks being called from hudson (on linux)
« Reply #5 on: December 29, 2010, 10:47:39 am »
You can try to export your display before running C::B.
It's most likely :0.0, export DISPLAY=:0.0 should work, if it is done immediately befor running C::B (and if it' the correct display of course).

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: CodeBlocks being called from hudson (on linux)
« Reply #6 on: December 29, 2010, 11:24:50 am »
Or make hudson start a new X on a specified display, set the DISPLAY variable and start C::B.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5179
Re: CodeBlocks being called from hudson (on linux)
« Reply #7 on: December 29, 2010, 02:39:37 pm »
oh boy, I am staring to feel a real linux newbie ;-)

Followed your suggestion, no luck (yet) :

Code: [Select]
+ export DISPLAY=:0.0
+ DISPLAY=:0.0
+ /usr/local/bin/codeblocks --no-check-associations --no-dde --no-splash-screen --rebuild --target=Debug Arrays/Arrays.cbp
No protocol specified
Error: Unable to initialize gtk, is DISPLAY set properly?

When I do in a shell (during my regular login ) :
Code: [Select]
killerbot@thorgal:~/CodeBlocks/trunk> echo $DISPLAY
:0
so I also tried "export DISPLAY=:0", same result, no luck.

Quote
Or make hudson start a new X on a specified display, set the DISPLAY variable and start C::B.
No clue on how to do that (I know something like startx exists, but ...)

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: CodeBlocks being called from hudson (on linux)
« Reply #8 on: December 29, 2010, 11:47:48 pm »
So, now I'm back home:
the following script works for me from a real console:
Code: [Select]
#!/bin/sh
cd /home/jens/codeblocks-build/codeblocks.trunk/src
xinit -e "export LC_ALL=en_US.UTF-8; codeblocks --build CodeBlocks-unix.cbp; codeblocks --build ContribPlugins-unix.workspace ;./update" -- :101

it changes in my C::B test directory and starts an xserver via xinit.
xinit calls xterm with the arguments before "--" and start an xserver on display 101 (should not be used normaly).
I build the whole C::B in an english environment and run the update-script.

xinit might behave different on other distros, if it does not work you should read the man-page.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5179
Re: CodeBlocks being called from hudson (on linux)
« Reply #9 on: December 30, 2010, 12:00:27 am »
that did start a CB, but strange stuff, both my monitors turned black, in the upper left corner you could see the CB starting and the plugins loading (as you would get when starting CB in shell), then again in the upper left part CB became visible (like a very first start if CB) and saying it detected the compiler. But no project was building ...

Tried it a second time, same thing. Seems this is not yet the solution.


EDIT : I called the same thing in a regular shell, just for testing purposes :
Code: [Select]
xinit -e '/usr/local/bin/codeblocks --no-check-associations --no-dde --no-splash-screen --rebuild --target=Debug Arrays/Arrays.cbp' -- :101
The screens turning black, and then CB visible (no compiler detected window here).
« Last Edit: December 30, 2010, 12:03:11 am by killerbot »

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: CodeBlocks being called from hudson (on linux)
« Reply #10 on: December 30, 2010, 12:20:06 am »
that did start a CB, but strange stuff, both my monitors turned black, in the upper left corner you could see the CB starting and the plugins loading (as you would get when starting CB in shell), then again in the upper left part CB became visible (like a very first start if CB) and saying it detected the compiler. But no project was building ...

Tried it a second time, same thing. Seems this is not yet the solution.


EDIT : I called the same thing in a regular shell, just for testing purposes :
Code: [Select]
xinit -e '/usr/local/bin/codeblocks --no-check-associations --no-dde --no-splash-screen --rebuild --target=Debug Arrays/Arrays.cbp' -- :101
The screens turning black, and then CB visible (no compiler detected window here).
Remove --no-check-associations and --no-dde (or use --no-ipc for the second), because they are windows arguments and seem to break the batch-build.
I think it should build anyways, but at the begin of the log messages you have "unknown long-option ...", so it might be a wxWidgets problem.

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: CodeBlocks being called from hudson (on linux)
« Reply #11 on: December 30, 2010, 12:53:55 am »
By the way: the monitors turn black, because a new xserver is started and xinit switched to it.
If you don't want that, you can run an alternative xserver like Xvnc to run xterm in.

Code: [Select]
xinit -e '/usr/local/bin/codeblocks --rebuild --target=Debug Arrays/Arrays.cbp' -- /Usr/bin/Xvnc :101
In all cases you have to switch to the correct directory before running the command ,of course (or use full path).

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5179
Re: CodeBlocks being called from hudson (on linux)
« Reply #12 on: December 30, 2010, 08:54:29 am »
Thanks, we are getting somewhere

1) when launching the xinit/Xvnc from the shell : works and no black screens (minor issue could be I don't see the build window, but it might be good not to show that, however when something terribly might go wrong and CB pops up a message box,that message box will not be visible I guess, and such can not be clicked)

2) when hudson will issue this command, it is not succeeding, since it is showing that compiler detected dialog box, which need to be clicked, and as such the build never finishes.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5179
Re: CodeBlocks being called from hudson (on linux)
« Reply #13 on: December 30, 2010, 09:18:03 am »
A little recap :

CB is a strong IDE, but it is also a strong build tool (focusing now on command line usage) :
- feed it a workspace, and it can build all projects
- feed it a project, and it can build *all* targets [ONLY if there is a virtual target bundling all the targets] [IDEA : I think when no target is specified all targets should be build] Any comments ???????
- It can run post build things, either by ,anual commands or by launching several plug-ins (for example run a CppCheck)

As such it can be a good replacement for make files, especially towards continuous integration. Where continuous integration would be configured by a shell script to launch the correct makefiles, it now could be configured to call CB.

I have done long time ago such things on windows, where the CI hudson was calling a 'driver program' which in turn called CB (that driver program created for example the correct config spec for clearcase depending on certain criteria), but forget about windows, time to focus on linux.

There are 2 ways of running hudson :

1) under your regular user account during your regular sessions, you fire up a shell and start the hudson.war manually [java -jar hudson.war]. Hudson will store all it stuff in '.hudson' directory in your home directory
GOOD :
 - no issues as described above in the previous replies, there's an xserver, the build window is even visible
BAD :
 - it is not automatically started, after each login you need to open up your shell and reissue the command to fire up the hudson.war
Question : I guess this can be automated (how exactly ?)

2) install a package for your distribution, this will also activate a startup script (for me : OpenSuse ->/etc/init.d/hudson, with a config file /etc/sysconfig/hudson), the hudson stuff now ends up somewhere under /var/lib/hudson and /varr/log/hudson) and it is being launched by the startup script as the user 'hudson' which is a member of the group 'hudson'
GOOD :
 - automatically launched
 - dedicated user for this
 - no need to log in with a certain user account
 - really a server/service
BAD :
 - those gtk issues / xserver issues pop up as described in the previous replies :-(

I tried in the configuration to say the hudson daemon should be run by my account (HUDSON_USER="killerbot") but that didn't help, the issues remain.

So the closet was thet xinit/Xvnc thing but that also fails now due to the compiler detected dialog box invisibly waiting to be clicked ...

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: CodeBlocks being called from hudson (on linux)
« Reply #14 on: December 30, 2010, 10:03:57 am »
The compiler detection dialog only pops up once, if hudson could save the default.conf, but I guess it has no home-directory and so no default place (that is writable) to store it.
A workaround is to copy a working default.conf (or any other *.conf for C::B) to the location where your executable is (for example as hudson_cb.conf) and start C::B normally, or in second case with the personality you use as parameter.
If it is started from a virtual terminal (running under your X), you can also use Xephyr (if installed) as xserver. It needs xhost + to be set before. So the new xserver is started in a nested window on your desktop.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5179
Re: CodeBlocks being called from hudson (on linux)
« Reply #15 on: December 30, 2010, 10:16:45 am »
I am trying the personality idea.
This is what I did (experiment from a shell)

1) copied my default.conf to another directory and renamed it to hudson_cb.conf
2) in a shell : codeblocks --personality=/home/killerbot/hudson_cb.conf
3) --> was just like a very first run of CB,so also compiler detection
4) closed that CB --> wanted to save a default.conf , clicked OK
5)
Code: [Select]
Could not save config file...: Warning
Aborted
Even when I kept it named as default.conf, same thing.

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: CodeBlocks being called from hudson (on linux)
« Reply #16 on: December 30, 2010, 12:06:02 pm »
the conf-file has to be either in the users ~/.codeblocks directory or in the same directory as the C::B executable.
As workaround, you can use a relative path (starting from your exe-folder), in your case -p ../../../home/killerbot/.codeblocks/.default (or wherever the conf-file you want to use is located).
The file-ending is appended automatically by C::B.

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: CodeBlocks being called from hudson (on linux)
« Reply #17 on: December 30, 2010, 12:46:25 pm »
The clean solution would be to create a real C::B console-app.

I will try to revive my ugly patch (mentioned before) and instead of using tons of ifdefs, split he used parts of C::B (mainly compiler-plugin, some core-sdk parts like plugin-manager etc.) into a base-part, that works also on a console and a derived (gui-) part.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5179
Re: CodeBlocks being called from hudson (on linux)
« Reply #18 on: December 30, 2010, 01:56:47 pm »
I made a copy of my default.conf, renamed it to hudson.conf and copied next to my system codeblocks executable.

and then had hudson launch CB with --personality=hudson.

The good news : it ran.

The less good news :
- no stdout output to discover, so one might even wonder if anything did build ...
- not tried yet : but probably on a build error, things will remain invisible, and we would have no clue if it succeeded or what did fail (gonna try this later on)

When I use the above mentioned manual launch of hudson, then we could see the build progress dialog, and next to that hudson saw coming in (through stdout ??) the content of that build progress dialog. That way it can be seen in the hudson build log what has happened, and in case something failed, what had failed.

So to be really useful, I think we need that stdout behavior, How can we get that back, combined with the xinit/xvnc/personality way.

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: CodeBlocks being called from hudson (on linux)
« Reply #19 on: December 30, 2010, 02:26:47 pm »
I always write the log to a html-file, that's not the same, but a possible solution.
You can also try to redirect stdout/stderr to a file (and show it with tail -f flename) or a tty to see the output.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5179
Re: CodeBlocks being called from hudson (on linux)
« Reply #20 on: December 30, 2010, 02:40:24 pm »
I am afraid that hudson won't be able to understand the log file, or display it; since it is expecting raw text, but something to try ...
EDIT : did a cat of the build html file, it is better than nothing, but not the ultimate solution, one can not 'monitor' the build, since output only pops up at the end, and just a cat of a html file is not really readable.

EDIT 2 : in this setup, when a build error occurs, hudson has no clue of it, probably for 2 reasons :
- it can't scan anything on stdout (if it already does this)
- the return value of CB/compiler is probably not propagated due to the xinit ?
« Last Edit: December 30, 2010, 02:57:36 pm by killerbot »

Offline san

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: CodeBlocks being called from hudson (on linux)
« Reply #21 on: December 31, 2010, 10:08:19 am »
Jens, it would be great if there would be an option to build codeblocks projects without the need for an X server. It would make it possible to run automated nightly builds on a dedicated server.

Don't mean to hijack this thread but when attempting to do nightly builds without the need for an X server leads to a search for other buildsystems and purely use codeblocks as an advanced text editor. Right now I'm looking at Waf and Scons which seems both flexible. And are there plans to support other other build systems (like Makefiles) from codeblocks?

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: CodeBlocks being called from hudson (on linux)
« Reply #22 on: December 31, 2010, 10:40:19 am »
C::B partly supports makefiles.
It can call them, but in this case it is really just a better editor (with code-completion etc.), but the power of C::B's build-system can not be used.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5179
Re: CodeBlocks being called from hudson (on linux)
« Reply #23 on: December 31, 2010, 11:07:23 am »
one very powerfull use case of CB as a build system, is when you have code to be compiled for different platforms, or just with different compilers.

Example : a library
- target 1 : gcc debug
- target 2 : gcc release
- target 3 : cross compiler debug
- target 4 : cross compiler release
- and so on

Just tell CB to build the cbp project file, and you get all of them, much easier compared to make files. Note it will no always be the best tool for the job, but in many use cases it is.

Basically : can the build engine of CB get a non gui front-end, and in such a way that it can start up without an x server being present.

EDIT : the batch builds are a first step, but seems we need a bit more.
« Last Edit: December 31, 2010, 02:10:20 pm by killerbot »

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: CodeBlocks being called from hudson (on linux)
« Reply #24 on: December 31, 2010, 10:09:35 pm »
@killerbot:
do you use 64-bit or 32-bit linux ?
Which distro do you use ?

I just revived the ugly, hacky "ifdef"-console-C::B. I had to apply the 190kB patch manually, but now it works.
I just compile dthe whole C::B (core and contrib-plugins) on a real console (not virtual terminal).

I test it on other distros (centos will be the first) and see if it works there without recompiling.

That's a first step (and proof of concept). Now I will try to split the relevant sources in base and gui-parts.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5179
Re: CodeBlocks being called from hudson (on linux)
« Reply #25 on: January 01, 2011, 02:52:34 am »
I am using OpenSuse 11.3 on 64 bit machines. Currently no 32 bit linux installed.

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: CodeBlocks being called from hudson (on linux)
« Reply #26 on: January 01, 2011, 01:05:33 pm »
I am using OpenSuse 11.3 on 64 bit machines. Currently no 32 bit linux installed.
You can try this package: http://apt.jenslody.de/downloads/codeblocks_con_suse11.2_64.tar.bz2 .
It's compiled (as the name says) on openSuse 11.2 64bit.
Just unpack it and call run_con.sh (instead of codeblocks_con directly).
It should work from a real (non virtual) console.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5179
Re: CodeBlocks being called from hudson (on linux)
« Reply #27 on: January 02, 2011, 10:08:12 am »
Thanks Jens, I gave this one a try, but there's a linker issue :

Code: [Select]
+ /home/killerbot/BurnTemp/output/run_con.sh --personality=hudson --rebuild --target=Debug Arrays/Arrays.cbp
/home/killerbot/BurnTemp/output/codeblocks_con: relocation error: /home/killerbot/BurnTemp/output/libcodeblocks_con.so: symbol _Z18wxSafeConvertWX2MBPKw, version WXU_2.8 not defined in file libwx_baseu-2.8.so.0 with link time reference

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: CodeBlocks being called from hudson (on linux)
« Reply #28 on: January 02, 2011, 10:21:02 am »
It looks like the wxGTK from 11.2 and 11.3 are not compatible.
I caqn update my 64 bit openSuse vm to 11.3 tomorrow ( I still only have ISDN at home ) and recompile it.

Or I can send you the patch (or attach it here).

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5179
Re: CodeBlocks being called from hudson (on linux)
« Reply #29 on: January 02, 2011, 10:42:14 am »
I can wait for your build till tomorrow, no problem.
Have some other stuff to carry out today.

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: CodeBlocks being called from hudson (on linux)
« Reply #30 on: January 03, 2011, 12:28:27 pm »
I can wait for your build till tomorrow, no problem.
Have some other stuff to carry out today.
You can now try this one: http://apt.jenslody.de/downloads/codeblocks_con_suse11.3_64.tar.bz2 .

Build on a fresh openSUSE 11.3 install, no special repos.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5179
Re: CodeBlocks being called from hudson (on linux)
« Reply #31 on: January 03, 2011, 05:58:31 pm »
yes; this is again a step forward, here's the output, where we can see there are still a few little issues :
Code: [Select]
+ /home/killerbot/BurnTemp/output/run_con.sh --personality=hudson --rebuild --target=Debug Arrays/Arrays.cbp
17:51:19: Error: Directory '//.codeblocks/' couldn't be created (error 13: Permission denied)
Scanning for plugins in /home/killerbot/BurnTemp/output/share/codeblocks/plugins

:
The file compiler.zip could not be found.
Please check your installation.
Compiler: loaded
Loaded 1 plugins
Scanning for plugins in /home/killerbot/BurnTemp/output/share/codeblocks/plugins
Loaded 1 plugins
Loading:
Compiler
Added compiler "GNU GCC Compiler"
Added compiler "Intel C/C++ Compiler"
Added compiler "SDCC Compiler"
Added compiler "Tiny C Compiler"
Added compiler "GDC D Compiler"
Added compiler "LLVM D Compiler"
Added compiler "Digital Mars D Compiler"
Added compiler "GNU ARM GCC Compiler"
Added compiler "GNU AVR GCC Compiler"
Added compiler "GNU GCC Compiler for PowerPC"
Added compiler "GNU GCC Compiler for TriCore"
Opening /var/lib/hudson/jobs/ArraysTest/workspace/Arrays/Arrays.cbp
Loading project file...
Parsing project file...
Loading target Debug
Loading target Release
Loading project files...
3 files loaded
Done loading project in 3ms
Project's base path: /var/lib/hudson/jobs/ArraysTest/workspace/Arrays/
Project's common toplevel path: /var/lib/hudson/jobs/ArraysTest/workspace/Arrays/
done
-------------- Clean: Debug in Arrays ---------------
-------------- Build: Debug in Arrays ---------------
Compiling: StructWithConstructor.cpp
Compiling: main.cpp

=== Arrays, Debug ===
In function 'int main()':
/var/lib/hudson/jobs/ArraysTest/workspace/Arrays/main.cpp: In function 'int main()':
error: expected ';' before 'return'
/var/lib/hudson/jobs/ArraysTest/workspace/Arrays/main.cpp:40:2: error: expected ';' before 'return'

* failed creation of directory
* compiler.zip not found

NOTE : the compiler error have been put there on purpose, however in my current setup hudson thinks the build went ok. Could be hudson needs further tuning, or maybe CB doesn't return with an error in case of a compiler failure ?
« Last Edit: January 03, 2011, 06:00:10 pm by killerbot »

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: CodeBlocks being called from hudson (on linux)
« Reply #32 on: January 03, 2011, 08:34:30 pm »
It should not try to load compiler.zip, the correct file is con_compiler.zip..
It's hardcoded only to look for con_compiler as plugin and not to load (or try to load) other plugins (at the moment), so I wonder what happens.

The  fact that the .codeblocks folder can not be created is a access problem, but the pcae where it tries to create it is strange.

I will see what happens, if I try it as user without home directory on openSuse.

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: CodeBlocks being called from hudson (on linux)
« Reply #33 on: January 04, 2011, 02:27:46 pm »
Next try: http://apt.jenslody.de/downloads/codeblocks_con_suse11.3_64-20110104-1.tar.bz2

fixed:
  • compiler.zip error-message is gone(was my fault)
  • exitcode shoud be corect now (wxWidgets/linux(?) issue), was a little more tricky to debug and fix
  • "Nothing to be done"-message is no longer shown after any run
  • Log messages that go int "Build messages" are no longer shown, just messages for "Build log"

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5179
Re: CodeBlocks being called from hudson (on linux)
« Reply #34 on: January 04, 2011, 06:28:24 pm »
I can confirm all improvements.
Nice output, which can be parsed by hudson subparsers, CB returns with failure code when compilation failed, so hudson knows the build failed. No other Cb warnings (file access, compiler.zip).

Looks good.

Offline san

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: CodeBlocks being called from hudson (on linux)
« Reply #35 on: January 04, 2011, 10:46:40 pm »
Nice to see you're making progress with this! Does this project still require a x-server? If you want I can test it on "Ubuntu 8.04 Server" and FreeBSD 7.2.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5179
Re: CodeBlocks being called from hudson (on linux)
« Reply #36 on: January 04, 2011, 11:11:26 pm »
the special stripped build from Jens , no longer needs it. Now it is question how to merge this with full cb, or do we have 2 executables, or ....

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9496
Re: CodeBlocks being called from hudson (on linux)
« Reply #37 on: January 05, 2011, 06:58:49 am »
Now it is question how to merge this with full cb, or do we have 2 executables, or ....
I wouldn't like to have two executables if possible. Jens: Can you post a patch so that we can see how "easy" it would be to make it e.g. a command line option?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: CodeBlocks being called from hudson (on linux)
« Reply #38 on: January 05, 2011, 07:35:28 am »
I'm not sure whether it's worth the work to put all in one binary, because the whole implementation stuff is different for console apps and gui apps.

The only way would be to create a console app, that parses the commandline and then does the gui initialisation manually (starting the main message loop, loading gui related libs, etc.).
This might be an option for the future, but the first step is to split the relevant files in a base and a gui part, with as less changes to the api as possible (preferred is of course to have no changes), to minmize the work on plugins and other not used parts of the sources (not used for console of course).

The problem is, that the gui-related things are not available (not even defined) for console apps, so an extra build-target, that creates a pure console-app is the easiest way at the moment.

I put the whole sources int a svn-repo on my server : svn://jenslody.de/codeblocks-console/trunk (no websvn, only anonymous read-access, write access is only possible via ssh with publickey authorization).

Be warned: the code is really ugly at the moment. It has a lot of ifdefs and splitting into two parts is in a very early stage (many commented out parts etc.).
No optimization or something similar, just making it work.

By the way, it's only needed for OSes that have real consoles like linux, not for windows, so there are no changes to windows project-file.

And the Makefile.am's are not updated to use the splitted files, but this will come (probably today).


Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9496
Re: CodeBlocks being called from hudson (on linux)
« Reply #39 on: January 05, 2011, 04:56:59 pm »
svn-repo on my server : svn://jenslody.de/codeblocks-console/trunk
Jens, don't you think we should create a branch for this on the main repo?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: CodeBlocks being called from hudson (on linux)
« Reply #40 on: January 05, 2011, 05:14:07 pm »
svn-repo on my server : svn://jenslody.de/codeblocks-console/trunk
Jens, don't you think we should create a branch for this on the main repo?

Of course we can do so.

There have been two reasons to create it on my server:
the first is, that it was not (yet) meant to be published, more as a proof of concept,
the second is, that I wanted to create my own repo to learn how to do it, because it's much easier to maintain my patches, if I have a repo somewhere outside my developping systems, because I can reach it easily from everywhere and from all my (partly virtual) systems.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9496
Re: CodeBlocks being called from hudson (on linux)
« Reply #41 on: January 05, 2011, 05:36:14 pm »
There have been two reasons to create it on my server: [...]
I see. So just keep it in mind for the future... For community development and browsing/tracking of the changes BerliOS would be better IMHO.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline san

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: CodeBlocks being called from hudson (on linux)
« Reply #42 on: January 06, 2011, 10:26:40 am »
It seems that there still is a dependency on wxWidgets for codeblocks-console. I don't have wxWidgets installed on my FreeBSD machine and if it's possible like to keep it this way.

Bootstrap returns with the following error (I get a lot of warnings).
Code: [Select]
#./bootstrap
[...]
configure.in:77: error: possibly undefined macro: AM_OPTIONS_WXCONFIG
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure.in:78: error: possibly undefined macro: AM_PATH_WXCONFIG

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: CodeBlocks being called from hudson (on linux)
« Reply #43 on: January 06, 2011, 10:36:20 am »
It seems that there still is a dependency on wxWidgets for codeblocks-console. I don't have wxWidgets installed on my FreeBSD machine and if it's possible like to keep it this way.

Bootstrap returns with the following error (I get a lot of warnings).
Code: [Select]
#./bootstrap
[...]
configure.in:77: error: possibly undefined macro: AM_OPTIONS_WXCONFIG
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure.in:78: error: possibly undefined macro: AM_PATH_WXCONFIG


Not without rewriting great parts of C::B from scratch.

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: CodeBlocks being called from hudson (on linux)
« Reply #44 on: February 12, 2011, 10:27:20 am »
There have been two reasons to create it on my server: [...]
I see. So just keep it in mind for the future... For community development and browsing/tracking of the changes BerliOS would be better IMHO.
Okay, it was nice to play with, but it is really hard to keep in sync with trunk, so a possible merge (if it ever happens) will be quite difficult.

Is it enough if I do a "svn copy ..." to create a new branch, or do I need special rights on the berlios server ?

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9496
Re: CodeBlocks being called from hudson (on linux)
« Reply #45 on: February 12, 2011, 02:17:31 pm »
Is it enough if I do a "svn copy ..." to create a new branch, or do I need special rights on the berlios server ?
Usually not. Go a head with svn copy to /branches/[whatever]. please make sure you copy to the right place... ;-)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ