Hi, It seems that (at least on FreeBSD), texpect.c is missing an include for signal.h. Perhaps this is implicit on other systems? [ 694/3892] Compiling lib/talloc/pytalloc_util.c [ 695/3892] Compiling lib/talloc/pytalloc.c [ 696/3892] Compiling lib/texpect/texpect.c ../lib/texpect/texpect.c:79:1: error: unknown type name 'sig_atomic_t' ../lib/texpect/texpect.c: In function 'eval_parent': ../lib/texpect/texpect.c:265:20: error: 'SIGALRM' undeclared (first use in this function) ../lib/texpect/texpect.c:265:20: note: each undeclared identifier is reported only once for each function it appears in ../lib/texpect/texpect.c: In function 'main': ../lib/texpect/texpect.c:391:15: warning: assignment from incompatible pointer type [enabled by default] ../lib/texpect/texpect.c:430:22: error: storage size of 'sa' isn't known ../lib/texpect/texpect.c:436:15: error: 'SIGALRM' undeclared (first use in this function) Waf: Leaving directory `/opt/src/samba42-gcc-5d22bcf/bin' Build failed: -> task failed (err #1): {task: cc texpect.c -> texpect_1.o} *** Error code 1 Stop. make: stopped in /opt/src/samba42-gcc-5d22bcf root@stor-pri-01:/opt/src/samba42-gcc-5d22bcf # uname -a FreeBSD stor-pri-01.ds.lib.cam.ac.uk 10.0-RELEASE-p4 FreeBSD 10.0-RELEASE-p4 #0: Tue Jun 3 13:14:57 UTC 2014 root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64 root@stor-pri-01:/opt/src/samba42-gcc-5d22bcf # This works for me, but I presume it would be better wrapped in an ifdef. Regards, Tristram
Forgot to give branch info: root@stor-pri-01:/opt/src/samba42-gcc-5d22bcf # git branch -v * master 5d22bcf s3:torture: in LOCAL-MESSAGING-READ3, print some messages to child Regards, Tristram
I ran into this while doing a test build of Samba 4.2.0rc4 on a Solaris 10 i386 machine. Solaris needs signal.h too. Fedora linux does not need it.
Bug 11092 includes a patch that adds signal.h to texpect.c. Submitting two separate patches seemed too messy as the changer are right next to each other.
In master this got fixed by adding: #include "system/filesys.h" #include "system/wait.h" after: #include "replace.h" in lib/texpect/texpect.c Does that fix it in 4.2.x also ?
The texpect.c in 4.2.0rc4 does not have #include "replace.h" in it, so I just added #include "system/filesys.h" #include "system/wait.h" after the other includes in the same place that I had been adding #ifdef HAVE_SIGNAL_H #include <signal.h> #endif and it compiles correctly on Solaris 10. I don't have a FreeBSD system to test on.
Created attachment 10807 [details] Proposed patch for 4.2.0.
Comment on attachment 10807 [details] Proposed patch for 4.2.0. This is part of commit 0f0148e020b6f85447f26de17c2b0b002bcdf498 from master. Shouldn't we possibly cherry-pick patches from master?
Here are the patches in master that are not in 4.2: 4bbfc54d09d813d1fb827de5855ce40e8eab1095 lib: texpect. Fix the build on Solaris. 0da7295fbc34170385d2b6bd165685aa092ab0ec lib/texpect: prefer bsd/libutil.h if available e27a23e6aa27ae2a9b6ae2e2a2560943157aaa5c lib/texpect: fix compiler warnings 0f0148e020b6f85447f26de17c2b0b002bcdf498 lib/texpect: make the code more portable by using "replace.h" and "system/wait.h" ccb0d9d6169594e8dd1c8935c9dfec51ee7125c4 lib/texpect: portability fix, include signal.h most of these are portability related. Should we pick all or most of them?
(In reply to Michael Adam from comment #7) Don't think that cherry-pick will apply, I was just trying to limit changes at this stage. If you want to back port I'll +1 for 4.2.0.
(In reply to Michael Adam from comment #8) Yeah that list looks safe enough to me.
Created attachment 10809 [details] patchset of backports for 4.2 Patchset with backports of the relevant patches. Untested hence not obsoleting original patchset for now.
Comment on attachment 10809 [details] patchset of backports for 4.2 patchset compiles on linux for me. can't test solaris/bsd today.
The patchset compiles on Solaris 10 i386 and the texpect program displays the help message when invoked with --help.
*** Bug 11092 has been marked as a duplicate of this bug. ***
Is there still time to get this into 4.2.0 release?
Comment on attachment 10807 [details] Proposed patch for 4.2.0. obsoleted by more comprehensive patchset
either 4.2.0 or the next bugfix release
Comment on attachment 10809 [details] patchset of backports for 4.2 LGTM.
Comment on attachment 10809 [details] patchset of backports for 4.2 explicit
@Karolin, please merge for 4.2.
Pushed to autobuild-v4-2-test.
*** Bug 11148 has been marked as a duplicate of this bug. ***
Please note that this bug is still present in 4.2.0 release. Manually adding "#include <signal.h> to lib/texpect/texpect.c fixed the problem.
(In reply to samba from comment #23) Right, the fix was too late for 4.2.0 final. I it will definitely be included in the first bugfix release 4.2.1. Michael
Pushed to v4-2-test. Will be included in 4.2.1. Closing out bug report. Thanks!