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 :
/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 :
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 ?
oh boy, I am staring to feel a real linux newbie ;-)
Followed your suggestion, no luck (yet) :
+ 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 ) :
killerbot@thorgal:~/CodeBlocks/trunk> echo $DISPLAY
:0
so I also tried "export DISPLAY=:0", same result, no luck.
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 ...)
So, now I'm back home:
the following script works for me from a real console:
#!/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.
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 :
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).
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.
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).
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) Could not save config file...: Warning
Aborted
Even when I kept it named as default.conf, same thing.
Thanks Jens, I gave this one a try, but there's a linker issue :
+ /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
yes; this is again a step forward, here's the output, where we can see there are still a few little issues :
+ /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 ?
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).
#./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