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

Build issue with python 3.10 #49

Open
kyak opened this issue Dec 9, 2022 · 3 comments
Open

Build issue with python 3.10 #49

kyak opened this issue Dec 9, 2022 · 3 comments

Comments

@kyak
Copy link

kyak commented Dec 9, 2022

Hi,

I think it started to happen around python-3.10.8 (might be 3.10.7 as well).

cp build/lib.linux-x86_64-3.10/dmidecodemod.cpython-310-x86_64-linux-gnu.so python3.10-dmidecodemod.so
cp: cannot stat 'build/lib.linux-x86_64-3.10/dmidecodemod.cpython-310-x86_64-linux-gnu.so': No such file or directory
make: *** [Makefile:63: python3.10-dmidecodemod.so] Error 1

The correct name for output library is build/lib.linux-x86_64-cpython-310/dmidecodemod.cpython-310-x86_64-linux-gnu.so

I made this small change to Makefile, but I'm not sure it will work with python < 3.10:

--- Makefile.orig       2022-12-09 12:10:37.827178273 +0300
+++ Makefile    2022-12-09 12:09:56.980536826 +0300
@@ -41,10 +41,10 @@
 PY_BIN  := python3
 VERSION := $(shell cd src;$(PY_BIN) -c "from setup_common import *; print(get_version());")
 PACKAGE := python-dmidecode
-PY_VER  := $(shell $(PY_BIN) -c 'import sys; print("%d.%d"%sys.version_info[0:2])')
+PY_VER  := $(shell $(PY_BIN) -c 'import sys; print("%d%d"%sys.version_info[0:2])')
 PY_MV   := $(shell echo $(PY_VER) | cut -b 1)
 PY      := python$(PY_VER)
-SO_PATH := build/lib.linux-$(shell uname -m)-$(PY_VER)
+SO_PATH := build/lib.linux-$(shell uname -m)-cpython-$(PY_VER)
 ifeq ($(PY_MV),2)
        SO  := $(SO_PATH)/dmidecodemod.so
 else
@HuO50
Copy link
Collaborator

HuO50 commented Dec 13, 2022

hello, kyak. Thanks for sending this message about build error, I test python3.10.8-3 version in fedora 36 release, but not happend this error. Can you provide more env info to find the bug?

@kyak
Copy link
Author

kyak commented Dec 14, 2022

I'm on an up to date Arch Linux, so latest everything.

I think it has something to do with cython. Do you have it installed?

@kyak
Copy link
Author

kyak commented Dec 19, 2022

Other people seem to have the same problem, see https://aur.archlinux.org/packages/python-dmidecode#comment-894512

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

No branches or pull requests

2 participants