Skip to contentSkip to conversation

package/pkg-python: fix python 3.8.0 package builds

PATCH New James Hilliard 3 participants 6 messages Oct 17, 2019 – Oct 19, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/pkg-python: fix python 3.8.0 package builds

We need to update the sysconfigdata path for python 3.8.0 per upstream commit 7efc526e5cfb929a79c192ac2dcf7eb78d3a4401 which indicates the "m" flag has been removed from sys.abiflags.

Fixes this build error when building target packages:
ValueError: Empty module name

---
 package/pkg-python.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/pkg-python.mk +1 -1
index e906920417..be1ce071df 100644
@@ -21,7 +21,7 @@
 ################################################################################
 
 define PKG_PYTHON_SYSCONFIGDATA_NAME
-$(basename $(notdir $(wildcard $(STAGING_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/_sysconfigdata_m_linux_*.py)))
+$(basename $(notdir $(wildcard $(STAGING_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/_sysconfigdata__linux_*.py)))
 endef
 
 # Target distutils-based packages
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/1 package/pkg-python: fix python 3.8.0 package builds

Quoted 19 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"James" == James Hilliard <[email protected]> writes:

We need to update the sysconfigdata path for python 3.8.0 per upstream commit 7efc526e5cfb929a79c192ac2dcf7eb78d3a4401 which indicates the "m" flag has been removed from sys.abiflags.

Fixes this build error when building target packages:
ValueError: Empty module name

---
 package/pkg-python.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/pkg-python.mk +0 -0
index e906920417..be1ce071df 100644

package/pkg-python.mk line 24

Quoted 5 lines
package/pkg-python.mk +1 -1
@@ -21,7 +21,7 @@
 ################################################################################
 
 define PKG_PYTHON_SYSCONFIGDATA_NAME
-$(basename $(notdir $(wildcard $(STAGING_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/_sysconfigdata_m_linux_*.py)))
+$(basename $(notdir $(wildcard $(STAGING_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/_sysconfigdata__linux_*.py)))

Ehh, this presumably then breaks it for python 2.7?

Signature · 1 line
Bye, Peter Korsgaard
#2 lore raw

PATCH 1/1 package/pkg-python: fix python 3.8.0 package builds

Quoted 22 lines · Peter Korsgaard
Quoted 21 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

"James" == James Hilliard <[email protected]> writes:

We need to update the sysconfigdata path for python 3.8.0 per upstream commit 7efc526e5cfb929a79c192ac2dcf7eb78d3a4401 which indicates the "m" flag has been removed from sys.abiflags.

Fixes this build error when building target packages:
ValueError: Empty module name

---
 package/pkg-python.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/pkg-python.mk +0 -0
index e906920417..be1ce071df 100644
@@ -21,7 +21,7 @@
 ################################################################################
Quoted 5 lines

package/pkg-python.mk line 24

Quoted 3 lines
package/pkg-python.mk +1 -1
 define PKG_PYTHON_SYSCONFIGDATA_NAME
-$(basename $(notdir $(wildcard $(STAGING_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/_sysconfigdata_m_linux_*.py)))
+$(basename $(notdir $(wildcard $(STAGING_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/_sysconfigdata__linux_*.py)))

Ehh, this presumably then breaks it for python 2.7?

I assume not since the path has $(PYTHON3_VERSION_MAJOR) in it which I don't think does anything for python2 builds.

Quoted 3 lines

--
Bye, Peter Korsgaard

#3 lore raw

PATCH 1/1 package/pkg-python: fix python 3.8.0 package builds

Quoted 23 lines · James Hilliard
Quoted 22 lines · Peter Korsgaard
Quoted 21 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

"James" == James Hilliard <[email protected]> writes:

We need to update the sysconfigdata path for python 3.8.0 per upstream commit 7efc526e5cfb929a79c192ac2dcf7eb78d3a4401 which indicates the "m" flag has been removed from sys.abiflags.

Fixes this build error when building target packages:
ValueError: Empty module name

---
 package/pkg-python.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/pkg-python.mk +0 -0
index e906920417..be1ce071df 100644
@@ -21,7 +21,7 @@
 ################################################################################
Quoted 7 lines
Quoted 5 lines

package/pkg-python.mk line 24

Quoted 3 lines
package/pkg-python.mk +1 -1
 define PKG_PYTHON_SYSCONFIGDATA_NAME
-$(basename $(notdir $(wildcard $(STAGING_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/_sysconfigdata_m_linux_*.py)))
+$(basename $(notdir $(wildcard $(STAGING_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/_sysconfigdata__linux_*.py)))

Ehh, this presumably then breaks it for python 2.7?

I assume not since the path has $(PYTHON3_VERSION_MAJOR) in it which I don't think does anything for python2 builds.

To be entirely complete: in Python 2.7, it's called _sysconfigdata.py (without
arch specification). However, since the thing is in a $(wildcard), nothing matches (even if we would use PYTHON_VERSION_MAJOR), so _PYTHON_SYSCONFIGDATA_NAME is set to empty.

In [1] I set _PYTHON_SYSCONFIGDATA_NAME to _sysconfigdata.py for Python2.7 (but
only in meson-package, I'm not sure why...), but Adam says that this breaks libglib2...

Anyway, this patch is definitely correct.

Regards,
Arnout

[1] http://patchwork.ozlabs.org/patch/1141860/

#4 lore raw

PATCH 1/1 package/pkg-python: fix python 3.8.0 package builds

Quoted 32 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Arnout" == Arnout Vandecappelle <[email protected]> writes:

Quoted 29 lines · James Hilliard
Quoted 28 lines · Peter Korsgaard
Quoted 27 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

"James" == James Hilliard <[email protected]> writes:

We need to update the sysconfigdata path for python 3.8.0 per upstream commit 7efc526e5cfb929a79c192ac2dcf7eb78d3a4401 which indicates the "m" flag has been removed from sys.abiflags.

Fixes this build error when building target packages:
ValueError: Empty module name

---
 package/pkg-python.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/pkg-python.mk +1 -1
index e906920417..be1ce071df 100644
@@ -21,7 +21,7 @@
 ################################################################################
 
 define PKG_PYTHON_SYSCONFIGDATA_NAME
-$(basename $(notdir $(wildcard
 $(STAGING_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/_sysconfigdata_m_linux_*.py)))
+$(basename $(notdir $(wildcard
 $(STAGING_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/_sysconfigdata__linux_*.py)))
Quoted 8 lines
Quoted 3 lines
Quoted 1 line

Ehh, this presumably then breaks it for python 2.7?

I assume not since the path has $(PYTHON3_VERSION_MAJOR) in it which I don't think does anything for python2 builds.

To be entirely complete: in Python 2.7, it's called _sysconfigdata.py (without
arch specification). However, since the thing is in a $(wildcard), nothing matches (even if we would use PYTHON_VERSION_MAJOR), so _PYTHON_SYSCONFIGDATA_NAME is set to empty.

Ahh yes. So why is it not needed on 2.7? Because it is installed in a location mentioned in PYTHONPATH?

Quoted 5 lines

In [1] I set _PYTHON_SYSCONFIGDATA_NAME to _sysconfigdata.py for Python2.7 (but
only in meson-package, I'm not sure why...), but Adam says that this breaks libglib2...

Anyway, this patch is definitely correct.

Correct. Applied, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#5 lore raw

PATCH 1/1 package/pkg-python: fix python 3.8.0 package builds

Quoted 36 lines · Peter Korsgaard
Quoted 35 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Arnout" == Arnout Vandecappelle <[email protected]> writes:

Quoted 32 lines · James Hilliard
Quoted 22 lines · Peter Korsgaard
Quoted 21 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

"James" == James Hilliard <[email protected]> writes:

We need to update the sysconfigdata path for python 3.8.0 per upstream commit 7efc526e5cfb929a79c192ac2dcf7eb78d3a4401 which indicates the "m" flag has been removed from sys.abiflags.

Fixes this build error when building target packages:
ValueError: Empty module name

---
 package/pkg-python.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/pkg-python.mk +0 -0
index e906920417..be1ce071df 100644
@@ -21,7 +21,7 @@
 ################################################################################
Quoted 7 lines

package/pkg-python.mk line 25

Quoted 5 lines
package/pkg-python.mk +1 -1
 define PKG_PYTHON_SYSCONFIGDATA_NAME
-$(basename $(notdir $(wildcard
 $(STAGING_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/_sysconfigdata_m_linux_*.py)))
+$(basename $(notdir $(wildcard
 $(STAGING_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/_sysconfigdata__linux_*.py)))

Ehh, this presumably then breaks it for python 2.7?

I assume not since the path has $(PYTHON3_VERSION_MAJOR) in it which I don't think does anything for python2 builds.

Quoted 7 lines
Quoted 4 lines

To be entirely complete: in Python 2.7, it's called _sysconfigdata.py (without
arch specification). However, since the thing is in a $(wildcard), nothing matches (even if we would use PYTHON_VERSION_MAJOR), so _PYTHON_SYSCONFIGDATA_NAME is set to empty.

Ahh yes. So why is it not needed on 2.7? Because it is installed in a location mentioned in PYTHONPATH?

I'm not sure, but I think the reason why we pass it in Python3 is that
otherwise it will use _sysconfigdata_m_linux_x86_64-linux-gnu.py instead of _sysconfigdata_m_linux_aarch64-linux-gnu.

In Python2.7, there's only one sysconfigdata, which I assume is the one for
cross-compilation. Or maybe it's just wrong and we never noticed :-)

Regards,
Arnout

Quoted 9 lines
Quoted 6 lines

In [1] I set _PYTHON_SYSCONFIGDATA_NAME to _sysconfigdata.py for Python2.7 (but
only in meson-package, I'm not sure why...), but Adam says that this breaks libglib2...

Anyway, this patch is definitely correct.

Correct. Applied, thanks.