Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-32521: nis libtirpc #5137

Merged
merged 1 commit into from Jan 12, 2018
Merged

bpo-32521: nis libtirpc #5137

merged 1 commit into from Jan 12, 2018

Conversation

tiran
Copy link
Member

@tiran tiran commented Jan 8, 2018

glibc has removed Sun RPC. Use replacement libtirpc headers and library in
nis module

Signed-off-by: Christian Heimes christian@python.org

https://bugs.python.org/issue32521

@tiran
Copy link
Member Author

tiran commented Jan 8, 2018

@stratakis
Copy link
Contributor

Confirming here that applying the patch makes the nis module compile successfully at a system where the sun rpc interfaces are provided by libtirpc and not glibc.

@vstinner
Copy link
Member

With this change, setup.py first checks if rpcsvc/yp_prot.h is available:

find_file('rpcsvc/yp_prot.h', inc_dirs, []) is not None

and then it checks if libtirpc is available:

self.compiler.find_library_file(lib_dirs, 'tirpc')

If libtirpc is available, it pass /usr/include/tirpc in include directories to build nismodule.c.

In Fedora 27, rpcsvc/yp_prot.h is provided by glibc-headers. In Fedora rawhide (future F28), it's still provided by glibc-headers. It may be provided by a different package (rpcsvc-proto) in the future: https://bugzilla.redhat.com/show_bug.cgi?id=1532364

The PR is correct since rpcsvc/yp_prot.h will remain in /usr/include (full path: /usr/include/rpcsvc/yp_prot.h) even if it will be provided by a different package in Fedora 28.

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but please just rename include_dirs variable.

Later we might enhance the code by using pkg-config to get the include directory, rather than using an hardcoded path, but well... setup.py doesn't support pkg-config yet, pkg-config is not available on all platforms, and nis is going to be deprecated... So I don't think that it's worth it.

setup.py Outdated
if self.compiler.find_library_file(lib_dirs, 'tirpc'):
# Sun RPC has been moved from glibc to libtirpc
libs.append('tirpc')
include_dirs = ['/usr/include/tirpc']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code lives in the giant detect_modules() function which is 1184 lines long... The function should be refactored, but that's out of the scope of the PR.

Would you mind to rename include_dirs to nic_incs, as done for for other "include_dirs=" parameters? It would avoid bad surprised with name clashes in this giant function.

glibc has removed Sun RPC. Use replacement libtirpc headers and library in
nis module

Signed-off-by: Christian Heimes <christian@python.org>
@tiran
Copy link
Member Author

tiran commented Jan 12, 2018

@vstinner PR is ready for review

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@tiran tiran merged commit f3031b8 into python:master Jan 12, 2018
@miss-islington
Copy link
Contributor

Thanks @tiran for the PR 🌮🎉.. I'm working now to backport this PR to: 2.7, 3.6.
🐍🍒⛏🤖

@tiran tiran deleted the nis_libtirpc branch January 12, 2018 14:26
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jan 12, 2018
glibc has removed Sun RPC. Use replacement libtirpc headers and library in
nis module

Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit f3031b8)
@bedevere-bot
Copy link

GH-5165 is a backport of this pull request to the 3.6 branch.

@bedevere-bot
Copy link

GH-5166 is a backport of this pull request to the 2.7 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jan 12, 2018
glibc has removed Sun RPC. Use replacement libtirpc headers and library in
nis module

Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit f3031b8)
tiran pushed a commit that referenced this pull request Jan 12, 2018
glibc has removed Sun RPC. Use replacement libtirpc headers and library in
nis module

Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit f3031b8)
tiran pushed a commit that referenced this pull request Jan 12, 2018
glibc has removed Sun RPC. Use replacement libtirpc headers and library in
nis module

Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit f3031b8)
jcfr pushed a commit to python-cmake-buildsystem/python-cmake-buildsystem that referenced this pull request Jan 21, 2020
glibc has removed Sun RPC. Use replacement libtirpc headers and library in
nis moduleupdated path for rpc.h for systems using libtirpc

See python/cpython#5137

This closes #224

Co-authored-by: Jean-Christophe Fillion-Robin <jchris.fillion@kitware.com>
jcfr pushed a commit to python-cmake-buildsystem/python-cmake-buildsystem that referenced this pull request Jan 21, 2020
glibc has removed Sun RPC. Use replacement libtirpc headers and library in
nis moduleupdated path for rpc.h for systems using libtirpc

See python/cpython#5137

This closes #224

Co-authored-by: Jean-Christophe Fillion-Robin <jchris.fillion@kitware.com>
jcfr added a commit to python-cmake-buildsystem/python-cmake-buildsystem that referenced this pull request Jan 21, 2020
glibc has removed Sun RPC. Use replacement libtirpc headers and library in
nis moduleupdated path for rpc.h for systems using libtirpc

See python/cpython#5137

This closes #224

Co-authored-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>
jcfr added a commit to python-cmake-buildsystem/python-cmake-buildsystem that referenced this pull request Jan 22, 2020
glibc has removed Sun RPC. Use replacement libtirpc headers and library in
nis moduleupdated path for rpc.h for systems using libtirpc

See python/cpython#5137

This closes #224

Co-authored-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>
dand-oss pushed a commit to dand-oss/python-cmake-buildsystem that referenced this pull request May 13, 2020
glibc has removed Sun RPC. Use replacement libtirpc headers and library in
nis moduleupdated path for rpc.h for systems using libtirpc

See python/cpython#5137

This closes python-cmake-buildsystem#224

Co-authored-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>
dand-oss pushed a commit to dand-oss/python-cmake-buildsystem that referenced this pull request Jun 5, 2022
glibc has removed Sun RPC. Use replacement libtirpc headers and library in
nis moduleupdated path for rpc.h for systems using libtirpc

See python/cpython#5137

This closes python-cmake-buildsystem#224

Co-authored-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants