Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 631488 - dev-lang/python-3.6.1-r1: rpc/rpc.h: No such file or directory (with sys-libs/glibc[-rpc] or >=sys-libs/glibc-2.26)
Summary: dev-lang/python-3.6.1-r1: rpc/rpc.h: No such file or directory (with sys-libs...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Python Gentoo Team
URL: https://bugs.python.org/issue32007
Whiteboard:
Keywords:
: 639458 639738 639800 (view as bug list)
Depends on:
Blocks: glibc-rpc
  Show dependency tree
 
Reported: 2017-09-20 08:27 UTC by Flo Gravo
Modified: 2021-08-11 19:57 UTC (History)
14 users (show)

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


Attachments
patch, use "git am" to apply, fixes python:3.6 only (0001-dev-lang-python-Hackfix-the-build-with-glibc-2.26.-O.patch,3.01 KB, patch)
2017-10-28 19:32 UTC, Andreas K. Hüttel
Details | Diff
failed build log (with enabled nis module) (python-3.6.3:20171111-161728.log.gz,28.86 KB, application/gzip)
2017-11-11 16:33 UTC, Andreas K. Hüttel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Flo Gravo 2017-09-20 08:27:16 UTC
dev-lang/python-3.6.1-r1 fails to build with glibc 2.26 or rpc disabled

Reproducible: Always
Comment 1 Perfect Gentleman 2017-09-20 10:52:41 UTC
(In reply to Flo Gravo from comment #0)
> dev-lang/python-3.6.1-r1 fails to build with glibc 2.26 or rpc disabled
> 
> Reproducible: Always

add "-I/usr/include/tirpc/" to CFLAGS & CXXFLAGS
Comment 2 Flo Gravo 2017-09-21 08:01:10 UTC
How about adding
append-cflags "-I/usr/include/tirpc"
to the ebuild?
Comment 3 Perfect Gentleman 2017-09-21 11:20:05 UTC
(In reply to Flo Gravo from comment #2)
> How about adding
> append-cflags "-I/usr/include/tirpc"
> to the ebuild?

I think that'll work too. IMO, using env & package.env is much easier
Comment 4 Shane Peelar 2017-09-21 12:30:54 UTC
Don't forget to add net-libs/libtirpc to the DEPENDS too, if you patch the ebuild.
Comment 5 Perfect Gentleman 2017-09-21 12:43:12 UTC
(In reply to Shane Peelar from comment #4)
> Don't forget to add net-libs/libtirpc to the DEPENDS too, if you patch the
> ebuild.

for glibc-2.26 it's not necessary.
Comment 6 Aric Belsito 2017-09-21 20:08:03 UTC
Just FYI, I'm pretty sure this bug applies to all versions of python, on all libc versions.

Based off of the mailing list discussion, libtirpc and ntirpc need to be supported as well as the glibc sunrpc version, so simply appending to CFLAGS is not enough.

No issue is encountered with musl on my end until libtirpc was installed for a different package, so I'm assuming there's an autodetect in the python configure that can tell that I have the libtirpc.pc file in pkgconfig, but it can't tell where the actual headers are, even though the path is set in the Cflags variable of the pkgconfig file.
Comment 7 Flo Gravo 2017-09-21 20:23:25 UTC
Yeah. Other versions of python are also affected.
Comment 8 Andreas K. Hüttel archtester gentoo-dev 2017-09-23 20:56:01 UTC
@everyone, 

* yes, this affects all python verions, if you have either glibc[-rpc] or >=glibc-2.26. 

* the workaround for the moment is to install net-libs/libtirpc and add -I/usr/include/tirpc somewhere to CFLAGS

* I'm waiting because this affects many packages and I want a uniform solution, so it needs some discussion.

See https://wiki.gentoo.org/wiki/Project:Toolchain/RPC_implementation

News will be posted here. Please keep in mind that glibc-2.26 is still unkeyworded, meaning, if you try to use it you get to keep the pieces.
Comment 9 Andreas K. Hüttel archtester gentoo-dev 2017-09-24 09:16:44 UTC
@python: pretty please; I dont think anything will still change in the plans.

For glibc-2.26 support, each python needs at least the 
|| ( net-libs/libnsl <sys-libs/glibc-2.26 ) 
dependency plus the mechanism for switching the RPC implementation and dependencies (see linked wiki page).

[This only affects the nis module, I *think*, so disabling that might be another way out, but I'm pretty sure above libraries will be pulled in by something in @system anyway.]

Right now in my @system chroot dev-lang/python is the only thing that doesnt rebuild.
Comment 10 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2017-09-24 09:52:30 UTC
AFAIU we're talking of an automagic dep here, so we should either add a USE flag and figure out a way to make it conditional, or dep unconditionally.
Comment 11 Mike Gilbert gentoo-dev 2017-09-24 15:29:12 UTC
From setup.py:

            # Sun yellow pages. Some systems have the functions in libc.
            if (host_platform not in ['cygwin', 'qnx6'] and
                find_file('rpcsvc/yp_prot.h', inc_dirs, []) is not None):
                if (self.compiler.find_library_file(lib_dirs, 'nsl')):
                    libs = ['nsl']
                else:
                    libs = []
                exts.append( Extension('nis', ['nismodule.c'],
                                       libraries = libs) )
            else:
                missing.append('nis')

I would guess that glibc still installs rpcsvc/yp_prot.h for some reason. Was that intentional, or an oversight?
Comment 12 Andreas K. Hüttel archtester gentoo-dev 2017-09-24 18:17:01 UTC
(In reply to Mike Gilbert from comment #11)
> I would guess that glibc still installs rpcsvc/yp_prot.h for some reason.
> Was that intentional, or an oversight?

(~amd64 chroot) porto ~ # equery belongs rpcsvc/yp_prot.h
 * Searching for rpcsvc/yp_prot.h ... 
net-libs/libnsl-1.1.0 (/usr/include/rpcsvc/yp_prot.h)

The problem is that the headers are split over various packages. That particular header is provided (for >=glibc-2.26) by net-libs/libnsl, which is the actual NIS/NIS+/... code (not the underlying rpc code). And net-libs/libnsl is already pulled into @system by something else.

net-libs/libnsl again uses net-libs/libtirpc (which, e.g., provides rpc/rpc.h as /usr/include/tirpc/rpc/rpc.h).
Comment 13 Mike Gilbert gentoo-dev 2017-09-24 18:27:18 UTC
So what file(s) do we need to check for to ensure that python will build with NIS support (optionally)? Would adding a check for rpc/rpc.h suffice?

I would like a solution we can submit upstream, and we can tweak it for Gentoo after.
Comment 14 Andreas K. Hüttel archtester gentoo-dev 2017-09-24 18:40:43 UTC
(In reply to Mike Gilbert from comment #13)
> So what file(s) do we need to check for to ensure that python will build
> with NIS support (optionally)? Would adding a check for rpc/rpc.h suffice?
> 
> I would like a solution we can submit upstream, and we can tweak it for
> Gentoo after.

The way I understand it you need to make sure two parts are present (compare also my g-dev mail):

1) RPC implementation, sunrpc or libtirpc
A good header to check is IMHO <rpc/rpc.h> (it's by default in /usr/include for sunrpc and in /usr/include/tirpc for libtirpc; libtirpc provides a .pc file as well); for libtirpc you need to link -ltirpc

2) NIS implementation, libnsl (either internal to glibc, or separate)
That's what the existing check for <rpcsvc/yp_prot.h> tests for; in both cases it goes into /usr/include by default, and in both cases the library is -lnsl (different soversion though).
Comment 15 Mike Gilbert gentoo-dev 2017-09-24 18:48:37 UTC
Thanks. I'll see if I can work on some solution.

Also, copying Arfrever since he is usually helpful with python build system patches.
Comment 16 Andreas K. Hüttel archtester gentoo-dev 2017-10-28 19:32:05 UTC
Created attachment 500566 [details, diff]
patch, use "git am" to apply, fixes python:3.6 only

Here's what could be a workable solution. @python, if you're happy with this I can extend it to the newest ~arch of each slot.

Not really upstreamable in this form though, since without the ebuild logic it introduces bad automagic. With the ebuilds and the conditional patching it should be fine.
Comment 17 Larry the Git Cow gentoo-dev 2017-11-11 16:07:51 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=56760ce3a29757b6cf00b585a9a1d480fdaf312f

commit 56760ce3a29757b6cf00b585a9a1d480fdaf312f
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2017-11-11 16:07:33 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2017-11-11 16:07:46 +0000

    dev-lang/python: disable the nis module
    
    This fails to build with glibc-2.26.
    
    Bug: https://bugs.gentoo.org/631488
    Package-Manager: Portage-2.3.13_p1, Repoman-2.3.3_p81

 dev-lang/python/files/2.7-disable-nis.patch |  21 ++
 dev-lang/python/files/3.6-disable-nis.patch |  21 ++
 dev-lang/python/python-2.7.14-r1.ebuild     | 366 ++++++++++++++++++++++++++++
 dev-lang/python/python-3.4.6-r1.ebuild      | 358 +++++++++++++++++++++++++++
 dev-lang/python/python-3.5.4-r1.ebuild      | 363 +++++++++++++++++++++++++++
 dev-lang/python/python-3.6.3-r1.ebuild      | 343 ++++++++++++++++++++++++++
 6 files changed, 1472 insertions(+)}
Comment 18 Andreas K. Hüttel archtester gentoo-dev 2017-11-11 16:33:38 UTC
Created attachment 503600 [details]
failed build log (with enabled nis module)

Example build log. 

libtirpc is installed (with rpc/rpc.h in /usr/include/tirpc), libnsl is installed and provides /usr/include/rpcsvc/yp_prot.h
Comment 19 Andreas K. Hüttel archtester gentoo-dev 2017-11-11 19:29:43 UTC
(In reply to Larry the Git Cow from comment #17)
> The bug has been referenced in the following commit(s):
> 
> https://gitweb.gentoo.org/repo/gentoo.git/commit/
> ?id=56760ce3a29757b6cf00b585a9a1d480fdaf312f
> 
> commit 56760ce3a29757b6cf00b585a9a1d480fdaf312f
> Author:     Mike Gilbert <floppym@gentoo.org>
> AuthorDate: 2017-11-11 16:07:33 +0000
> Commit:     Mike Gilbert <floppym@gentoo.org>
> CommitDate: 2017-11-11 16:07:46 +0000
> 
>     dev-lang/python: disable the nis module
>     

Confirmed that the new versions (without nis module) build and install fine with sys-libs/glibc-2.26-r3
Comment 20 Brian Evans (RETIRED) gentoo-dev 2017-12-02 01:59:15 UTC
*** Bug 639458 has been marked as a duplicate of this bug. ***
Comment 21 Mike Gilbert gentoo-dev 2017-12-04 15:33:14 UTC
*** Bug 639738 has been marked as a duplicate of this bug. ***
Comment 22 Mike Gilbert gentoo-dev 2017-12-04 16:21:25 UTC
I stabilized the relevant ebuilds.
Comment 23 Brian Evans (RETIRED) gentoo-dev 2017-12-04 18:02:02 UTC
*** Bug 639800 has been marked as a duplicate of this bug. ***