Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 606542 - net-fs/samba fails to build if sys-libs/glibc doesn't have USE=rpc, portage doesn't require use flag change
Summary: net-fs/samba fails to build if sys-libs/glibc doesn't have USE=rpc, portage d...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's SAMBA Team
URL:
Whiteboard:
Keywords:
: 632686 (view as bug list)
Depends on:
Blocks: glibc-rpc
  Show dependency tree
 
Reported: 2017-01-19 19:59 UTC by afarah
Modified: 2017-11-13 15:56 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description afarah 2017-01-19 19:59:43 UTC
net-fs/samba-4.2.14 fails to build unless sys-libs/glibc-2.23-r3 was compiled with the rpc use flag, but portage doesn't inform about the need for it. Requiring the rpc use flag for glibc should solve the issue. 

See also: https://bugzilla.samba.org/show_bug.cgi?id=10976

Reproducible: Always

Steps to Reproduce:
1. Re-emerge glibc without the rpc use flag
2. Try to emerge samba
Comment 1 Martin von Gagern 2017-02-06 09:21:23 UTC
Wow, upstream bug from 2014 and still no reaction.

I guess this bug here should block tracker bug 381391 aka. glibc-2.14-rpc. So someone with sufficient permissions please add this.

People might find this more easily if the missing file were mentioned in the subject. For me (and with MAKEOPTS=-j1) the original error message read

[1202/3374] Compiling default/source3/librpc/gen_ndr/ndr_smbXsrv.c
In file included from default/source3/librpc/gen_ndr/ndr_smbXsrv.c:3:0:
../source3/include/includes.h:113:28: fatal error: rpcsvc/yp_prot.h: No such file or directory
compilation terminated.
Waf: Leaving directory `/var/tmp/portage/net-fs/samba-4.5.5/work/samba-4.5.5-abi_x86_64.amd64/bin'
Build failed:  -> task failed (err #1): 
        {task: cc ndr_smbXsrv.c -> ndr_smbXsrv_4.o}
make: *** [Makefile:8: all] Error 1

https://github.com/samba-team/samba/commit/debb2b2b9e9a495b0f9f31753ac5e75e4b2 appears to be the code which introduced the current broken form of the check for rpcsvc/yp_prot.h, but after backing that one out, I simply get a different set of errors:

[1522/3374] Compiling source3/lib/util.c
../source3/lib/util.c: In function ‘automount_lookup’:
../source3/lib/util.c:656:19: warning: implicit declaration of function ‘yp_get_default_domain’ [-Wimplicit-function-declaration]
  if ((nis_error = yp_get_default_domain(&nis_domain)) != 0) {
                   ^
In file included from ../source3/include/includes.h:301:0,
                 from ../source3/lib/util.c:24:
../source3/lib/util.c:657:31: warning: implicit declaration of function ‘yperr_string’ [-Wimplicit-function-declaration]
   DEBUG(3, ("YP Error: %s\n", yperr_string(nis_error)));
                               ^
../source3/../lib/util/debug.h:185:20: note: in definition of macro ‘DEBUG’
        && (dbgtext body) )
                    ^
../source3/lib/util.c:657:13: warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘int’ [-Wformat=]
   DEBUG(3, ("YP Error: %s\n", yperr_string(nis_error)));
             ^
../source3/../lib/util/debug.h:185:20: note: in definition of macro ‘DEBUG’
        && (dbgtext body) )
                    ^
../source3/lib/util.c:663:19: warning: implicit declaration of function ‘yp_match’ [-Wimplicit-function-declaration]
  if ((nis_error = yp_match(nis_domain, nis_map, user_name,
                   ^
../source3/lib/util.c:674:25: error: ‘YPERR_KEY’ undeclared (first use in this function)
  } else if(nis_error == YPERR_KEY) {
                         ^
../source3/lib/util.c:674:25: note: each undeclared identifier is reported only once for each function it appears in
In file included from ../source3/include/includes.h:301:0,
                 from ../source3/lib/util.c:24:
../source3/lib/util.c:679:13: warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘int’ [-Wformat=]
   DEBUG(3, ("YP Error: \"%s\" while looking up \"%s\" in map \"%s\"\n", 
             ^
../source3/../lib/util/debug.h:185:20: note: in definition of macro ‘DEBUG’
        && (dbgtext body) )
                    ^
Waf: Leaving directory `/var/tmp/portage/net-fs/samba-4.5.5/work/samba-4.5.5-abi_x86_64.amd64/bin'
Build failed:  -> task failed (err #1): 
	{task: cc util.c -> util_47.o}
make: *** [Makefile:8: all] Error 1

Looking for upstream reports for this I found
https://sourceforge.net/p/libtirpc/bugs/30/

But I guess the way forward would be to drop NIS support when building against libtirpc. Apparently (judging from docs-xml/using_samba/ch02.xml) there used to be configure switches --with-nis and --with-nisplus, and presumably their --without-* counterparts as well, at some point. But I can't seem to find a WAF analogon to these; simply passing them will cause waf to complain:

waf: error: no such option: --without-nis

Perhaps someone with a bit more knowledge of waf can work out a way to disable NAS support in such a way that libtirpc is enough to build samba.
Comment 2 Martin von Gagern 2017-02-06 22:29:02 UTC
Some more detail: waf actually checks for yp_get_default_domain using the following code (created by samba_autoconf.py):

#define yp_get_default_domain __fake__yp_get_default_domain
#ifdef HAVE_LIMITS_H
# include <limits.h>
#else
# include <assert.h>
#endif
#undef yp_get_default_domain
#if defined __stub_yp_get_default_domain || defined __stub___yp_get_default_domain
#error "bad glibc stub"
#endif
extern char yp_get_default_domain();
int main() { return yp_get_default_domain(); }

So this checks whether the symbol exists in the library, but not whether there is a header to match it. I think this approach could use some improvement. Anyway, getting this check to fail will make the build as a whole succeed. Here is how I got samba 4.5.5 to compile for me on glibc[-rpc]:

ebuild /usr/portage/net-fs/samba/samba-4.5.5.ebuild clean unpack
wget -O- 'https://github.com/samba-team/samba/commit/debb2b2b9e9a495b0f.patch' \
 | patch -R -p1 -d/var/tmp/portage/net-fs/samba-4.5.5/work/samba-4.5.5
sed -i -E 's:(yp_get_default_domain):xx\1:' \
 /var/tmp/portage/net-fs/samba-4.5.5/work/samba-4.5.5*/source3/wscript
ebuild /usr/portage/net-fs/samba/samba-4.5.5.ebuild merge
Comment 3 Andreas K. Hüttel gentoo-dev 2017-10-07 23:35:57 UTC
*** Bug 632686 has been marked as a duplicate of this bug. ***
Comment 4 Dmitry Derevyanko 2017-10-19 20:26:30 UTC
This patch https://attachments.samba.org/attachment.cgi?id=13172 works for me with glibc-2.26.
Comment 5 Larry the Git Cow gentoo-dev 2017-11-13 15:49:36 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=51c693cb95d3dcde67b32a3a39944e0759d1c2a3

commit 51c693cb95d3dcde67b32a3a39944e0759d1c2a3
Author:     Lars Wendler <polynomial-c@gentoo.org>
AuthorDate: 2017-11-13 15:49:04 +0000
Commit:     Lars Wendler <polynomial-c@gentoo.org>
CommitDate: 2017-11-13 15:49:29 +0000

    net-fs/samba: Fixed build with rpc-less glibc.
    
    Closes: https://bugs.gentoo.org/606542
    Closes: https://bugs.gentoo.org/637320
    Package-Manager: Portage-2.3.13, Repoman-2.3.4

 net-fs/samba/files/samba-glibc-2.26-no_rpc.patch | 14 ++++++++++++++
 net-fs/samba/samba-4.6.9.ebuild                  |  1 +
 net-fs/samba/samba-4.7.1.ebuild                  |  1 +
 3 files changed, 16 insertions(+)
Comment 6 Larry the Git Cow gentoo-dev 2017-11-13 15:56:47 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=43216e1833dd91caef752e565150fb6df9684ccc

commit 43216e1833dd91caef752e565150fb6df9684ccc
Author:     Lars Wendler <polynomial-c@gentoo.org>
AuthorDate: 2017-11-13 15:56:40 +0000
Commit:     Lars Wendler <polynomial-c@gentoo.org>
CommitDate: 2017-11-13 15:56:40 +0000

    net-fs/samba: Fix stable samba when glibc[-rpc] is installed.
    
    Bug: https://bugs.gentoo.org/606542
    Package-Manager: Portage-2.3.13, Repoman-2.3.4

 net-fs/samba/samba-4.2.14.ebuild    | 1 +
 net-fs/samba/samba-4.5.10-r1.ebuild | 1 +
 2 files changed, 2 insertions(+)}