You are not logged in.

#1 2014-09-01 16:35:43

W.F.Cody
Member
From: Ghent
Registered: 2010-11-18
Posts: 155

strange make error when script is started in PKGBUILD

Hi

I have an extremely strange error related to make when I tried to package the -git version of Open Watcom (v2 fork)

https://aur.archlinux.org/packages/open_watcom-v2-git/

When running makepkg -s, the build chokes on the following step:
building wsplice in $srcdir/watcom/bld/wmake (Makefile: posmake)
since this binary is not built, some headers are not generated and the build dies.

Doing exactly the same thing as in the PKGBUILD "build()" outside of makepkg -s
by cd-ing to $srcdir/watcom and running
source setvars.sh
./build.sh

works and stuff are building....

Anyone got an idea what could be the issue?


My AUR packages
Any package of mine is up for grabs. If you think you could mantain it better - just contact me!

Offline

#2 2014-09-01 16:42:37

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,517
Website

Re: strange make error when script is started in PKGBUILD

Can you provide the actual error output?

Have you tried building manually as you describe after setting environment variables as specified in makepkg.conf?


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2014-09-02 07:12:44

W.F.Cody
Member
From: Ghent
Registered: 2010-11-18
Posts: 155

Re: strange make error when script is started in PKGBUILD

Trilby wrote:

Can you provide the actual error output?

Have you tried building manually as you describe after setting environment variables as specified in makepkg.conf?

There is no actual error output where it actually goes wrong. This is the issue I opened before I noticed that the error only happened when I used makepkg:
https://github.com/open-watcom/open-watcom-v2/issues/76

The relevant part of the $srcdir/watcom/bld/wmake/posmake is this:

wsplice: wsplice.o clibext.o
	$(CC) -g wsplice.o clibext.o -o $@

usage.gh : ../h/usage.sp wsplice
	./wsplice -kIS_RC -kENGLISH -f '{MSG_USAGE_BASE+%#%+, "%s"},' ../h/usage.sp -o "%n%n%n%n" $@

usageend.gh: usage.gh wsplice
	./wsplice -f "%+" usage.gh -o "#define MSG_USAGE_LAST (MSG_USAGE_BASE+%#)%n" $@

cretype : ../c/cretype.c
	$(CC) -o $@ $?

If I build with makepkg -s (invoking "source setvars.sh" and "./build.sh" inside PKGBUILD), this happens:

rm -f *.o *.gh
cc -g -O2 -I../h -I../../watcom/h -I../../lib_misc/h -I. -D__LINUX__ -D__UNIX__ -DUNIX -Uunix -DBOOTSTRAP -c ../../builder/c/wsplice.c
cc -g -O2 -I../h -I../../watcom/h -I../../lib_misc/h -I. -D__LINUX__ -D__UNIX__ -DUNIX -Uunix -DBOOTSTRAP -c ../../watcom/c/clibext.c
cc -o cretype ../c/cretype.c
cc -g -O2 -I../h -I../../watcom/h -I../../lib_misc/h -I. -D__LINUX__ -D__UNIX__ -DUNIX -Uunix -DBOOTSTRAP -c ../c/macros.c
In file included from ../c/macros.c:49:0:
../h/mrcmsg.h:245:23: fatal error: usageend.gh: No such file or directory
 #include "usageend.gh"
                       ^
compilation terminated.
../posmake:16: recipe for target 'macros.o' failed

If I do exactly the same thing outside of makepkg (manually "source setvars.sh" and "./build.sh"), I get this:

rm -f *.o *.gh
cc -g -O2 -I../h -I../../watcom/h -I../../lib_misc/h -I. -D__LINUX__ -D__UNIX__ -DUNIX -Uunix -DBOOTSTRAP -c ../../builder/c/wsplice.c
cc -g -O2 -I../h -I../../watcom/h -I../../lib_misc/h -I. -D__LINUX__ -D__UNIX__ -DUNIX -Uunix -DBOOTSTRAP -c ../../watcom/c/clibext.c
cc -g wsplice.o clibext.o -o wsplice
./wsplice -kIS_RC -kENGLISH -f '{MSG_USAGE_BASE+%#%+, "%s"},' ../h/usage.sp -o "%n%n%n%n" usage.gh
./wsplice -f "%+" usage.gh -o "#define MSG_USAGE_LAST (MSG_USAGE_BASE+%#)%n" usageend.gh
./cretype > isarray.gh
cc -g -O2 -I../h -I../../watcom/h -I../../lib_misc/h -I. -D__LINUX__ -D__UNIX__ -DUNIX -Uunix -DBOOTSTRAP -c ../c/macros.c
cc -g -O2 -I../h -I../../watcom/h -I../../lib_misc/h -I. -D__LINUX__ -D__UNIX__ -DUNIX -Uunix -DBOOTSTRAP -c ../c/main.c
cc -g -O2 -I../h -I../../watcom/h -I../../lib_misc/h -I. -D__LINUX__ -D__UNIX__ -DUNIX -Uunix -DBOOTSTRAP -c ../c/massert.c
cc -g -O2 -I../h -I../../watcom/h -I../../lib_misc/h -I. -D__LINUX__ -D__UNIX__ -DUNIX -Uunix -DBOOTSTRAP -c ../c/mautodep.c
cc -g -O2 -I../h -I../../watcom/h -I../../lib_misc/h -I. -D__LINUX__ -D__UNIX__ -DUNIX -Uunix -DBOOTSTRAP -c ../c/mautoomf.c
(and so on...)

Thanks to your suggestion, I also tried the manual method above but also with "source /etc/makepkg.conf" (and checked with echo that the variables were defined)
This gives exactly the same output as my previous attempt to manually build, so this is not the issue...


My AUR packages
Any package of mine is up for grabs. If you think you could mantain it better - just contact me!

Offline

#4 2014-09-02 10:28:16

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,396

Re: strange make error when script is started in PKGBUILD

Makepkg and CLI user commands run in different environments and each uses their own set of environment variables.

I've encountered similar issues before , and they're often hard to troubleshoot.

there are atleast 2 things that can cause these problems :

-  the flags set in # ARCHITECTURE, COMPILE FLAGS section of makepkg.conf
   By using the options= directive in PKGBUILD you can override flags set by makepkg.conf .
   I suggest you try !buildflags   and/or !makeflags .

- search paths are different,  this can give problems with finding include files and/or libraries.
  sourcecode with lots of relative paths using ../ (often multiple times) is prone to have these problems.


In file included from ../c/macros.c:49:0:
../h/mrcmsg.h:245:23: fatal error: usageend.gh: No such file or directory
 #include "usageend.gh"

That message does suggest you are facing the different search paths issue, but try options= first .


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

Board footer

Powered by FluxBB