GNOME Bugzilla – Bug 167688
Please use "sh -c" to call external binaries in gtkdoc-scanobj
Last modified: 2005-09-15 14:24:06 UTC
Version details: Debian Distribution/Version: Debian/sid Hi, When the ".c" compiled by gtkdoc-scanobj is built correctly but can not be run (for example because it segfaults, or the libraries are not available, or it isn't executable etc.), you can not easily diagnose it. We got the problem in debian in the following build-log : http://buildd.debian.org/fetch.php?&pkg=libbonobo&ver=2.8.1-1&arch=ia64&stamp=1108514028&file=log&as=raw extract: mkdir .libs cc -g -Wall -O2 -g -Wall -O2 -DGNOMELOCALEDIR=/usr/share/locale -DORBIT2=1 -pthread -I/usr/include/orbit-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I../.. -I../.. -c libbonobo-scan.c -fPIC -DPIC -o .libs/libbonobo-scan.o libbonobo-scan.c: In function `get_object_types': libbonobo-scan.c:18: warning: implicit declaration of function `bonobo_running_context_get_type' libbonobo-scan.c:21: warning: implicit declaration of function `bonobo_moniker_extender_get_type' libbonobo-scan.c:26: warning: implicit declaration of function `bonobo_item_handler_get_type' libbonobo-scan.c:29: warning: implicit declaration of function `bonobo_shlib_factory_get_type' cc -g -Wall -O2 -g -Wall -O2 -DGNOMELOCALEDIR=/usr/share/locale -DORBIT2=1 -pthread -I/usr/include/orbit-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I../.. -I../.. -c libbonobo-scan.c -o libbonobo-scan.o >/dev/null 2>&1 cc -g -Wall -O2 -o .libs/libbonobo-scan .libs/libbonobo-scan.o -Wl,--export-dynamic ../../bonobo/.libs/libbonobo-2.so /build/buildd/libbonobo-2.8.1/bonobo-activation/.libs/libbonobo-activation.so -pthread /usr/lib/libORBitCosNaming-2.so /usr/lib/libORBit-2.so /usr/lib/libpopt.so -lm /usr/lib/libgmodule-2.0.so -ldl /usr/lib/libgobject-2.0.so /usr/lib/libgthread-2.0.so -lpthread /usr/lib/libglib-2.0.so creating libbonobo-scan Scan failed make[5]: *** [scan-build.stamp] Error 255 make[5]: Leaving directory `/build/buildd/libbonobo-2.8.1/doc/api' I'll attach a patch to add a "sh -c" part to system() calls in Perl, which will have this effect: bee% perl -e 'system("./foo");' bee% perl -e 'system("sh -c ./foo");' sh: ./foo: Permission non accordée
Created attachment 37585 [details] [review] prepend sh -c to system() calls in gtkdoc-scanobj
Make that a "sh -c -x" when you commit the change. :p
I tried this: $command = "sh -c -x $CC $CFLAGS -c -o $o_file $MODULE-scan.c && $LD -o $MODULE-scan $o_file $LDFLAGS"; but it doesn't work. It runs a shell. I've made it more verbose though. It now outputs messages about compiling, linking and running the scanner. Hopefully that is enough.
It's: sh -x -c (-x is just a flag to do the equivalent of "set -x")
I'll use "sh -c" to run the scanner, but I'm not really convinced the other changes help much.
(Perfect, the goal was to see build messages such as "segfault" in build logs on remote machines, and this will now be the case.)