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

NIS module included in Debian image but not in Alpine one #247

Closed
antoine-roux opened this issue Dec 18, 2017 · 4 comments · Fixed by #266
Closed

NIS module included in Debian image but not in Alpine one #247

antoine-roux opened this issue Dec 18, 2017 · 4 comments · Fixed by #266

Comments

@antoine-roux
Copy link

Hello, the installed Python on Alpine and Debian is not strictly the same.
I'm trying to use the nis module on Alpine, but it is not compiled.

$ docker run python:jessie python -c 'import nis; print("OK")'
OK
$ docker run python:stretch python -c 'import nis; print("OK")'
OK
$ docker run python:slim python -c 'import nis; print("OK")'
OK
$ docker run python:alpine python -c 'import nis; print("OK")'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'nis'

I read somewhere that the Alpine libc does not include nis built-in. But libnsl is available on Alpine repos (https://pkgs.alpinelinux.org/package/v3.7/community/x86_64/libnsl).
Can we imagine to have this feature in the future 3.7 Alpine image?

Thanks,
Antoine

@JayH5
Copy link
Contributor

JayH5 commented Dec 18, 2017

I tried including the libnsl-dev package in #249 (it's only available on Alpine 3.7) but compiling the nis module still failed with:

building 'nis' extension
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I./Include -I. -I/usr/local/include -I/usr/src/python/Include -I/usr/src/python -c /usr/src/python/Modules/nismodule.c -o build/temp.linux-x86_64-3.6/usr/src/python/Modules/nismodule.o
/usr/src/python/Modules/nismodule.c:17:21: fatal error: rpc/rpc.h: No such file or directory
 #include <rpc/rpc.h>
                     ^
compilation terminated.
The following modules found by detect_modules() in setup.py, have been
built by the Makefile instead, as configured by the Setup files:
atexit                pwd                   time

Failed to build these modules:
nis

@antoine-roux
Copy link
Author

Maybe with something like libtirpc-dev?

@JayH5
Copy link
Contributor

JayH5 commented Dec 18, 2017

Huh, it does actually build and the import works if you install both libnsl-dev and libtirpc-dev. However, it's necessary to add /usr/include/tirpc to the include directories while building the nis module. I can't find a way to do that short of editing setup.py.

I'm not going to dig further into this as this isn't a feature I use, but I hope that helps.

@tianon
Copy link
Member

tianon commented Jun 5, 2018

Also relevant: https://github.com/tiran/peps/blob/ba2635cb59cd97264905ce32ef85f9456c1a5297/pep-9999.rst#nis (movement in Python upstream to remove nis entirely)

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 a pull request may close this issue.

3 participants