[almighty] Makefile error and Jenkins naster build

Konrad Kleine kkleine at redhat.com
Fri Sep 30 06:25:53 UTC 2016


Hi Baiju,

the problem is hard to fix because Make offers no command switches (see
https://www.chemie.fu-berlin.de/chemnet/use/info/make/make_9.html#SEC85)
for handling errors in subcommands.

The error

> /bin/sh: PATH: command not found

indicates that Make called sh to execute "PATH".

Obviously this is wrong. So I thought I can teach Make to globally use the
-e switch on the shell to immediately abort if there's an error. It turned
out that is possible to modify the shell that gets used for executing shell
commands and also specify the flags. Here's a simple Makefile to set those
variables (NOTE: they will not work if setting as environment variables):

.SHELLFLAGS=-ec
SHELL=/bin/bash
all:
echo "$(.SHELLFLAGS)"
echo "$(SHELL)"
echo "hallo $$(PATH)"


When executed with: make && echo ok this results in


echo "-ec"
-ec
echo "/bin/bash"
/bin/bash
echo "hallo $(PATH)"
/bin/bash: PATH: command not found
hallo
ok


As you can see it doesn't seem like the shell flags have the desired effect
because Make still returns 0 instead of 1.

Here you can read on the SHELL variable:
https://www.gnu.org/software/make/manual/html_node/Choosing-the-Shell.html#Choosing-the-Shell

I try to fiddle around with this but I don't expect much.

Regards
Konrad

On Fri, Sep 30, 2016 at 7:42 AM, Konrad Kleine <kkleine at redhat.com> wrote:

> Hey Baiju,
>
> thank you for spotting this.
>
> I'm on it.
>
> On Thu, Sep 29, 2016 at 3:46 AM, Baiju Muthukadan <bmuthuka at redhat.com>
> wrote:
>
>> Hi Konrad,
>>
>> There was an error in the "make generate" during this master build:
>> https://ci.centos.org/view/Devtools/job/devtools-almighty-
>> core-build-master/44/console
>>
>> You can see these lines there:
>> -----------------------------------------------------------
>> + make docker-generate
>> docker exec -t -i "almighty-core-local-build" make generate
>> cd vendor/github.com/goadesign/goa/goagen && go build -v
>> [...snip...]
>> PATH="$(PATH):vendor/github.com/jteeuwen/go-bindata/go-bindata"
>> vendor/github.com/elazarl/go-bindata-assetfs/go-bindata-asse
>> tfs/go-bindata-assetfs
>> -debug
>> <http://github.com/elazarl/go-bindata-assetfs/go-bindata-assetfs/go-bindata-assetfs-debug>
>> assets/...
>>
>> /bin/sh: PATH: command not found
>> -----------------------------------------------------------
>>
>> But it never made the build to fail and prevented Jenkins to deploy
>> the artifact. We have fixed this issue here:
>> https://github.com/almighty/almighty-core/pull/286 I had a look at all
>> the make files to see any potential similar issue, but I couldn't find
>> anything. Do you think we need to anything else in Jenkins to capture
>> these kind of issues? May be use some Jenkins plugin to search for
>> "command not found" string and make Jenkins to fail?
>>
>> Regards,
>> Baiju M
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/almighty-public/attachments/20160930/0a8372cf/attachment.htm>


More information about the almighty-public mailing list