HelloWorld program build using cygwin in Jenkins - issue while building

2,515 views
Skip to first unread message

Kanu

unread,
Feb 29, 2012, 1:35:56 AM2/29/12
to Jenkins Users
Hi all,

I have the Jenkins setup in my machine and I have configured the
settings with the below options.

1.In 'Execute shell' tab under Hello world project settings:-> c:/
cygwin/bin/bash -xe c:/test/build.sh

2.In Manage Jenkins under 'shell executable' tab:-> C:\cygwin\bin\bash

3.This is my build.sh file content.
#!/bin/sh
c:/cygwin/bin/gcc -g helloworld.c

4.I have the cygwin installed under c:\cygwin

This is my error log when I tried to build using the Jenkins set up

Console Output
Started by user anonymous
Building in workspace C:\Program Files\Jenkins\workspace\Helloworld
[Helloworld] $ C:\cygwin\bin\bash -xe C:\WINDOWS\TEMP
\hudson9092646218282923936.sh
+ c:/cygwin/bin/bash -xe c:/test/build.sh
+ c:/cygwin/bin/gcc -g helloworld.c
Build step 'Execute shell' marked build as failure
Finished: FAILURE


Many kind regards,
/Kanu

Sami Tikka

unread,
Mar 1, 2012, 3:01:10 AM3/1/12
to jenkins...@googlegroups.com
Have you considered the possibility that your build really failed? An error in the compiler or cygwin is not really jenkins's fault. What kind of steps have you taken to investigate the problem?

-- Sami

RENJITH G

unread,
Mar 1, 2012, 3:31:46 AM3/1/12
to jenkins...@googlegroups.com
I just noted the cosole output and finalised it was not built due the sentence I saw
Build step 'Execute shell' marked build as failure
Finished: FAILURE

Now I checked in the workspace also and didn't see any out file.

I searched the error message in google and didn't get any valid results.Also I posted in #jenkins IRC and didn't get any inputs.
I tried to dig into the error log but no more details on the issue is found

Expecting some more inputs from the team.

Many kind regards
/renjith_g

Sami Tikka

unread,
Mar 1, 2012, 5:15:33 PM3/1/12
to jenkins...@googlegroups.com
Can you execute the same commands in a Command Prompt window as
Jenkins did and does it work?

Can you do the same in the same directory where Jenkins tried to do it
and does it work?

Does it work if you change Jenkins service to run as some other user,
e.g. yourself?

-- Sami

2012/3/1 RENJITH G <gopinadh...@gmail.com>:

Kanu

unread,
Mar 2, 2012, 12:22:54 AM3/2/12
to Jenkins Users, ian.l...@wolfsonmicro.com, renjith.g...@wolfsonmicro.com
Thanks Samy.
Tracked your questions and found that was not building from the cygwin
console either.

So I installed the latest cygwin package and found the helloworld.c is
building from the cygwin console.

After this I tried the same in Jenkins with my old jenkins settings
and got another issue from the Jenkins build console.

Please see the log:

Console Output
View as plain text

Started by user anonymous
Building in workspace C:\Program Files\Jenkins\workspace\Helloworld
[Helloworld] $ C:\cygwin\bin\bash -xe C:\WINDOWS\TEMP
\hudson8960933788009414142.sh
cygwin warning:
MS-DOS style path detected: C:\WINDOWS\TEMP
\hudson8960933788009414142.sh
Preferred POSIX equivalent is: /cygdrive/c/WINDOWS/TEMP/
hudson8960933788009414142.sh
CYGWIN environment variable option "nodosfilewarning" turns off this
warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
+ c:/cygwin/bin/bash -xe c:/test/build.sh
+ c:/cygwin/bin/gcc -c helloworld.c
/usr/lib/gcc/i686-pc-cygwin/4.5.3/cc1.exe: error while loading shared
libraries: ?: cannot open shared object file: No such file or
directory
Build step 'Execute shell' marked build as failure
Finished: FAILURE


Please have a look at it and give some more inputs.

Many kind regards,
/renjith_g

On Mar 1, 10:15 pm, Sami Tikka <sjti...@gmail.com> wrote:
> Can you execute the same commands in a Command Prompt window as
> Jenkins did and does it work?
>
> Can you do the same in the same directory where Jenkins tried to do it
> and does it work?
>
> Does it work if you change Jenkins service to run as some other user,
> e.g. yourself?
>
> -- Sami
>
> 2012/3/1 RENJITH G <gopinadhanrenj...@gmail.com>:
>
> > I just noted the cosole output and finalised it was not built due the
> > sentence I saw
> > Build step 'Execute shell' marked build as failure
> > Finished: FAILURE
>
> > Now I checked in the workspace also and didn't see any out file.
>
> > I searched the error message in google and didn't get any valid results.Also
> > I posted in #jenkins IRC and didn't get any inputs.
> > I tried to dig into the error log but no more details on the issue is found
>
> > Expecting some more inputs from the team.
>
> > Many kind regards
> > /renjith_g
>
> > On Thu, Mar 1, 2012 at 8:01 AM, Sami Tikka <sjti...@gmail.com> wrote:
>
> >> Have you considered the possibility that your build really failed? An
> >> error in the compiler or cygwin is not really jenkins's fault. What kind of
> >> steps have you taken to investigate the problem?
>
> >> -- Sami
>

Les Mikesell

unread,
Mar 2, 2012, 1:24:42 AM3/2/12
to jenkins...@googlegroups.com, ian.l...@wolfsonmicro.com, renjith.g...@wolfsonmicro.com
On Thu, Mar 1, 2012 at 11:22 PM, Kanu <gopinadh...@gmail.com> wrote:
> >
> Started by user anonymous
> Building in workspace C:\Program Files\Jenkins\workspace\Helloworld
> [Helloworld] $ C:\cygwin\bin\bash -xe C:\WINDOWS\TEMP
> \hudson8960933788009414142.sh
> cygwin warning:
>  MS-DOS style path detected: C:\WINDOWS\TEMP
> \hudson8960933788009414142.sh
>  Preferred POSIX equivalent is: /cygdrive/c/WINDOWS/TEMP/
> hudson8960933788009414142.sh
>  CYGWIN environment variable option "nodosfilewarning" turns off this
> warning.
>  Consult the user's guide for more details about POSIX paths:
>    http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
> + c:/cygwin/bin/bash -xe c:/test/build.sh
> + c:/cygwin/bin/gcc -c helloworld.c
> /usr/lib/gcc/i686-pc-cygwin/4.5.3/cc1.exe: error while loading shared
> libraries: ?: cannot open shared object file: No such file or
> directory
> Build step 'Execute shell' marked build as failure
> Finished: FAILURE

When you start cygwin from the usual console batch file it runs bash
with the --login -i options which, among other things will make it
source /etc/profile to set many environment variables (PATH, etc.)
that you won't have otherwise.

--
Les Mikesell
lesmi...@gmail.com

Kanu

unread,
Mar 2, 2012, 1:29:52 AM3/2/12
to Jenkins Users, Les Mikesell
Hi Les,

Sorry, can you bit desciptive? I am newbie to this system.

Many kind regards,
/renjith_g

Les Mikesell

unread,
Mar 2, 2012, 1:58:26 AM3/2/12
to Kanu, Jenkins Users
On Fri, Mar 2, 2012 at 12:29 AM, Kanu <gopinadh...@gmail.com> wrote:
> Hi Les,
>
> Sorry, can you bit desciptive? I am newbie to this system.

I'm not sure what the correct approach for jenkins should be, but if
you start cygwin interactively at the console and type 'env' you will
see very different environment settings than you would have in a cmd
window on windows - and some of them are necessary for cygwin to find
its components. When you start bash with the --login option it
sources /etc/profile and an assortment of other startup scripts, but
maybe there is a better way to do it.

--
Les Mikesell
lesmi...@gmail.com

Reply all
Reply to author
Forward
0 new messages