| Summary: | Python/Python3: distutils cannot find the configuration file (pyconfig.h) in a standard configuration path | ||
|---|---|---|---|
| Product: | Mageia | Reporter: | David GEIGER <geiger.david68210> |
| Component: | RPM Packages | Assignee: | Philippe Makowski <makowski.mageia> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | Normal | CC: | guillomovitch |
| Version: | Cauldron | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Source RPM: | python3-3.4.3-3.mga6.src.rpm | CVE: | |
| Status comment: | |||
|
Description
David GEIGER
2015-08-11 13:18:20 CEST
David GEIGER
2015-08-11 13:18:42 CEST
Assignee:
bugsquad =>
makowski.mageia I don't understand where is your problem, because in fact in setuptools build_ext.py we have :
try:
# Python 2.7 or >=3.2
from sysconfig import _CONFIG_VARS
so it should have the correct information
it should never use distutils.sysconfig but sysconfig it self
and that's the first time that we reach your problem, all other python extension are building without problem
other point the /usr/include/python3.4m/pyconfig.h is correct, as it include /usr/include/multiarch-x86_64-linux/python3.4m/pyconfig.h
I think I found the origin : http://svnweb.mageia.org/packages?view=revision&revision=211298 Date: Mon Feb 20 22:18:08 2012 UTC (3 years, 5 months ago) but now, the problem is, why are you the only one with your audaspace build to reach this issue. Maybe the problem is on your build, not really our Python install. can you give me more details on how you are making your build ? Eventually I can put back the patch, as it seems that the distutils parser is not clever enough. guillomovitch, do you have any clue ? CC:
(none) =>
guillomovitch I don't know if it is feasible or not but simply add this line "#define Py_ENABLE_SHARED 1" in /usr/include/python3.4m/pyconfig.h file is more than enough. or perhaps add "#include <multiarch-x86_64-linux/python3.4m/pyconfig.h>"? (In reply to David GEIGER from comment #3) > I don't know if it is feasible or not but simply add this line "#define > Py_ENABLE_SHARED 1" in /usr/include/python3.4m/pyconfig.h file is more than > enough. hum, I would prefer not, the patch is better, others settings might be important too > or perhaps add "#include <multiarch-x86_64-linux/python3.4m/pyconfig.h>"? it is done already, but clearly distutils parser is not clever enough. for now the best solution I see is to re add the patch, as we have in Python2. (In reply to Philippe Makowski from comment #4) > > or perhaps add "#include <multiarch-x86_64-linux/python3.4m/pyconfig.h>"? > it is done already, but clearly distutils parser is not clever enough. Ok but how is it done the link between "/usr/include/python3.4m/pyconfig.h" and "/usr/include/multiarch-x86_64-linux/python3.4m/pyconfig.h" ? I tested adding #include <multiarch-x86_64-linux/python3.4m/pyconfig.h> and it works. (In reply to David GEIGER from comment #5) > Ok but how is it done the link between "/usr/include/python3.4m/pyconfig.h" > and > "/usr/include/multiarch-x86_64-linux/python3.4m/pyconfig.h" ? > like that : #define _MULTIARCH_HEADER python3.4m/pyconfig.h #include <multiarch-dispatch.h> by the way, we have two diff with python2 : 1/ python2 have in files : %multiarch %multiarch_includedir/python%{dirver}/pyconfig.h instead of %multiarch_includedir/python%{dirver}/pyconfig.h 2/ the patch in distutils I did both in cauldron, python3-3.4.3-4.mga6 should land soon Finaly I added as a quick fix an include (python3-3.4.3-6.mga6 http://svnweb.mageia.org/packages/cauldron/python3/current/SPECS/python3.spec?r1=864562&r2=864561&pathrev=864562 ) but for me it's a temporary fix only distutils have to be investigated python3 -c "import distutils;print(__import__('distutils.sysconfig').sysconfig.get_config_var('Py_ENABLE_SHARED'))" should report the same thing than working python3 -c "import sysconfig;print(sysconfig.get_config_var('Py_ENABLE_SHARED'))" for the record and more investigation, where we loose the sys.arch (Mageia specific) http://svnweb.mageia.org/packages?view=revision&revision=266813 fixed for audaspace with this patch :
$ cat python3-link.patch
Index: bindings/python/setup.py.in
===================================================================
--- bindings/python/setup.py.in
+++ bindings/python/setup.py.in 2015-08-14 23:59:51.356624466 +0200
@@ -25,6 +25,7 @@
library_dirs = ['.', 'Debug', 'Release'],
language = 'c++',
extra_compile_args = extra_args,
+ extra_link_args = ['-lpython3.4m', '-lm'],
sources = [os.path.join(source_directory, file) for file in ['PyAPI.cpp', 'PyDevice.cpp', 'PyHandle.cpp', 'PySound.cpp', 'PySequenceEntry.cpp', 'PySequence.cpp']]
)
this is related to our policy about --no-undefined
but may be we also need to find a way to help cmake and distutils to find the correct link flags
if really as david said "simply add this line "#define Py_ENABLE_SHARED 1" in /usr/include/python3.4m/pyconfig.h file is more than enough" may be we should try
so I keep the bug open even if the build problem of audaspace is solved now.
Thanks a lot philippem! patch adding 'extra_link_args' on setup file works well :) I think that I found the correct patch for Python3 http://svnweb.mageia.org/packages/cauldron/python3/current/SOURCES/python3-3.4.2-distutils-init.patch?view=log python3-3.4.3-7.mga6 should fix your issue with distutils as with the patch I get : $ python3 Python 3.4.3 (default, Jul 1 2015, 18:38:11) [GCC 4.9.2] on linux Type "help", "copyright", "credits" or "license" for more information. >>> __import__("distutils.sysconfig").sysconfig.get_config_var('Py_ENABLE_SHARED') 1 Yes, thanks Philippe for your nice job! :) Now audaspace built properly without python3 link flags. distutils check properly "pyconfig.h" file configuration. So closing of this bug. :) Status:
NEW =>
RESOLVED |