Skip to contentSkip to conversation

python3: package tkinter's shared objects

PATCH Superseded Dan McGregor 2 participants 13 messages Nov 26, 2024 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 python3: package tkinter's shared objects

From: Dan McGregor <[email protected]>

Seems every time python is updated this gets removed. That's likely because the tk option can't be enabled in python3-native without creating a dependency loop.

For now, re-add the tkinter packaging info to the manifest.

---
 meta/recipes-devtools/python/python3/python3-manifest.json | 1 +
 1 file changed, 1 insertion(+)
meta/recipes-devtools/python/python3/python3-manifest.json +1 -0
index 4b7f9cc7e33..3ed99b9012d 100644
@@ -1092,6 +1092,7 @@
             "core"
         ],
         "files": [
+            "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_tkinter.*.so",
             "${libdir}/python${PYTHON_MAJMIN}/tkinter"
         ],
         "cached": []
Signature · 1 line
2.47.0
#1 lore raw

This is not correct and will be undone by the next manifest update again because that works from a default set of options. You need to add this to the python recipe.

Alex

Quoted 38 lines · Dan McGregor via lists.openembedded.org

From: Dan McGregor <[email protected]>

Seems every time python is updated this gets removed. That's likely because the tk option can't be enabled in python3-native without creating a dependency loop.

For now, re-add the tkinter packaging info to the manifest.

---
 meta/recipes-devtools/python/python3/python3-manifest.json | 1 +
 1 file changed, 1 insertion(+)
meta/recipes-devtools/python/python3/python3-manifest.json +1 -1
index 4b7f9cc7e33..3ed99b9012d 100644
@@ -1092,6 +1092,7 @@
             "core"
         ],
         "files": [
+            "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_tkinter.*.so",
             "${libdir}/python${PYTHON_MAJMIN}/tkinter"
         ],
         "cached": []
--

2.47.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#207824): https://lists.openembedded.org/g/openembedded-core/message/207824
Mute This Topic: https://lists.openembedded.org/mt/109783729/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#2 lore raw

Oh neat, that worked, thanks. There'll be a v2 to this patch. I copied previous patches that fixed this issue by patching the manifest, like this one:
https://git.openembedded.org/openembedded-core/commit/?id=163966765d57fe38e13d0b6659795a13bc702e2d

Updating the recipe itself is kind of gross considering the overall plan for the manifest.json method, but this will prevent it getting reverted every time Python gets updated.

Quoted 47 lines · Alexander Kanavin

This is not correct and will be undone by the next manifest update again because that works from a default set of options. You need to add this to the python recipe.

Alex

Quoted 38 lines · Dan McGregor via lists.openembedded.org

From: Dan McGregor <[email protected]>

Seems every time python is updated this gets removed. That's likely because the tk option can't be enabled in python3-native without creating a dependency loop.

For now, re-add the tkinter packaging info to the manifest.

---
 meta/recipes-devtools/python/python3/python3-manifest.json | 1 +
 1 file changed, 1 insertion(+)
meta/recipes-devtools/python/python3/python3-manifest.json +1 -1
index 4b7f9cc7e33..3ed99b9012d 100644
@@ -1092,6 +1092,7 @@
             "core"
         ],
         "files": [
+            "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_tkinter.*.so",
             "${libdir}/python${PYTHON_MAJMIN}/tkinter"
         ],
         "cached": []
--

2.47.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#207824): https://lists.openembedded.org/g/openembedded-core/message/207824
Mute This Topic: https://lists.openembedded.org/mt/109783729/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#3 lore raw

PATCH v2 1/1 python3: package tkinter's shared objects

In reply to Alexander Kanavin

From: Dan McGregor <[email protected]>

Seems every time python is updated this gets removed. That's likely because the tk option can't be enabled in python3-native without creating a dependency loop.

Instead of manually editing the manifest every time, explicitly add it in the recipe as suggested by Alexander Kanavin.

---
 meta/recipes-devtools/python/python3_3.13.0.bb | 1 +
 1 file changed, 1 insertion(+)
meta/recipes-devtools/python/python3_3.13.0.bb +1 -0
index 8db5b813738..497b5fc1744 100644
@@ -428,6 +428,7 @@ RPROVIDES:${PN}-modules = "${PN}"
 
 FILES:${PN}-pydoc += "${bindir}/pydoc${PYTHON_MAJMIN} ${bindir}/pydoc3"
 FILES:${PN}-idle += "${bindir}/idle3 ${bindir}/idle${PYTHON_MAJMIN}"
+FILES:${PN}-tkinter += "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_tkinter.*.so"
 
 # provide python-pyvenv from python3-venv
 RPROVIDES:${PN}-venv += "${MLPREFIX}python3-pyvenv"
Signature · 1 line
2.47.0

A message that is not in the archive (sent off-list or not yet received): [email protected]

#5 lore raw

Nevermind, this didn't work, my initial optimistic test was wrong, I had disabled the tk packageconfig again before I ran this :( The original patch so far is the only one that I have that's working.

Quoted 39 lines · Dan McGregor via lists.openembedded.org

From: Dan McGregor <[email protected]>

Seems every time python is updated this gets removed. That's likely because the tk option can't be enabled in python3-native without creating a dependency loop.

Instead of manually editing the manifest every time, explicitly add it in the recipe as suggested by Alexander Kanavin.

---
 meta/recipes-devtools/python/python3_3.13.0.bb | 1 +
 1 file changed, 1 insertion(+)
meta/recipes-devtools/python/python3_3.13.0.bb +1 -1
index 8db5b813738..497b5fc1744 100644
@@ -428,6 +428,7 @@ RPROVIDES:${PN}-modules = "${PN}"
 
 FILES:${PN}-pydoc += "${bindir}/pydoc${PYTHON_MAJMIN} ${bindir}/pydoc3"
 FILES:${PN}-idle += "${bindir}/idle3 ${bindir}/idle${PYTHON_MAJMIN}"
+FILES:${PN}-tkinter += "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_tkinter.*.so"
 
 # provide python-pyvenv from python3-venv
 RPROVIDES:${PN}-venv += "${MLPREFIX}python3-pyvenv"
--

2.47.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#207865): https://lists.openembedded.org/g/openembedded-core/message/207865
Mute This Topic: https://lists.openembedded.org/mt/109792213/3617261
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#6 lore raw

You need to find out why is that. FILES setting in a recipe should not be replaced by what's in the manifest but only added to it.

Alex

Quoted 4 lines · Dan McGregor via lists.openembedded.org

Nevermind, this didn't work, my initial optimistic test was wrong, I had disabled the tk packageconfig again before I ran this :( The original patch so far is the only one that I have that's working.

#7 lore raw
Quoted 3 lines · Alexander Kanavin via lists.openembedded.org

You need to find out why is that. FILES setting in a recipe should not be replaced by what's in the manifest but only added to it.

Okay, that's actually obvious. It's resetting the FILES:${PN}... variables explicitly in the manifest parsing. Didn't know the history of that, so didn't want to touch it. If the intent is to append to what's in the recipe then that's an easy change.

Quoted 17 lines

Alex

Quoted 4 lines · Dan McGregor via lists.openembedded.org

Nevermind, this didn't work, my initial optimistic test was wrong, I had disabled the tk packageconfig again before I ran this :( The original patch so far is the only one that I have that's working.

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#207868): https://lists.openembedded.org/g/openembedded-core/message/207868
Mute This Topic: https://lists.openembedded.org/mt/109792534/3617261
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#8 lore raw
Quoted 7 lines · Dan McGregor
Quoted 2 lines

You need to find out why is that. FILES setting in a recipe should not be replaced by what's in the manifest but only added to it.

Okay, that's actually obvious. It's resetting the FILES:${PN}... variables explicitly in the manifest parsing. Didn't know the history of that, so didn't want to touch it. If the intent is to append to what's in the recipe then that's an easy change.

Can you try that and use buildhistory to see how the packaging changes?

Alex

#9 lore raw
Quoted 11 lines · Alexander Kanavin
Quoted 7 lines · Dan McGregor
Quoted 2 lines

You need to find out why is that. FILES setting in a recipe should not be replaced by what's in the manifest but only added to it.

Okay, that's actually obvious. It's resetting the FILES:${PN}... variables explicitly in the manifest parsing. Didn't know the history of that, so didn't want to touch it. If the intent is to append to what's in the recipe then that's an easy change.

Can you try that and use buildhistory to see how the packaging changes?

Yup, just did that. The packaging didn't change much. The only changes were to the FILES values for python3-dev and python3-idle, in both cases just restoring default value before the value added by the manifest. The files lists for all packages remained the same, except tkinter which added the shared object correctly. v3 incoming...

Quoted 2 lines

Alex

#10 lore raw

PATCH v3 1/1 python3: package tkinter's shared objects

In reply to Alexander Kanavin

From: Dan McGregor <[email protected]>

Seems every time python is updated this gets removed. That's likely because the tk option can't be enabled in python3-native without creating a dependency loop.

Instead of manually editing the manifest every time, explicitly add it in the recipe as suggested by Alexander Kanavin.

---
 meta/recipes-devtools/python/python3_3.13.0.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-devtools/python/python3_3.13.0.bb +1 -1
index 8db5b813738..a393b5e4a07 100644
@@ -360,7 +360,6 @@ python(){
             newpackages.append(pypackage)
 
         # "Build" python's manifest FILES, RDEPENDS and SUMMARY
-        d.setVar('FILES:' + pypackage, '')
         for value in python_manifest[key]['files']:
             d.appendVar('FILES:' + pypackage, ' ' + value)
 
@@ -428,6 +427,7 @@ RPROVIDES:${PN}-modules = "${PN}"
 
 FILES:${PN}-pydoc += "${bindir}/pydoc${PYTHON_MAJMIN} ${bindir}/pydoc3"
 FILES:${PN}-idle += "${bindir}/idle3 ${bindir}/idle${PYTHON_MAJMIN}"
+FILES:${PN}-tkinter += "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_tkinter.*.so"
 
 # provide python-pyvenv from python3-venv
 RPROVIDES:${PN}-venv += "${MLPREFIX}python3-pyvenv"
Signature · 1 line
2.47.0
#11 lore raw

The removal of d.setVar should be in a separate commit, with its own explanation.

Alex

Quoted 47 lines · Dan McGregor via lists.openembedded.org

From: Dan McGregor <[email protected]>

Seems every time python is updated this gets removed. That's likely because the tk option can't be enabled in python3-native without creating a dependency loop.

Instead of manually editing the manifest every time, explicitly add it in the recipe as suggested by Alexander Kanavin.

---
 meta/recipes-devtools/python/python3_3.13.0.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-devtools/python/python3_3.13.0.bb +1 -2
index 8db5b813738..a393b5e4a07 100644
@@ -360,7 +360,6 @@ python(){
             newpackages.append(pypackage)
 
         # "Build" python's manifest FILES, RDEPENDS and SUMMARY
-        d.setVar('FILES:' + pypackage, '')
         for value in python_manifest[key]['files']:
             d.appendVar('FILES:' + pypackage, ' ' + value)
 
@@ -428,6 +427,7 @@ RPROVIDES:${PN}-modules = "${PN}"
 
 FILES:${PN}-pydoc += "${bindir}/pydoc${PYTHON_MAJMIN} ${bindir}/pydoc3"
 FILES:${PN}-idle += "${bindir}/idle3 ${bindir}/idle${PYTHON_MAJMIN}"
+FILES:${PN}-tkinter += "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_tkinter.*.so"
 
 # provide python-pyvenv from python3-venv
 RPROVIDES:${PN}-venv += "${MLPREFIX}python3-pyvenv"
--

2.47.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#207875): https://lists.openembedded.org/g/openembedded-core/message/207875
Mute This Topic: https://lists.openembedded.org/mt/109793661/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#12 lore raw

PATCH v4 1/2 python3: do not overwrite FILES contents

From: Dan McGregor <[email protected]>

Instead of relying completely on the python packaging manifest, allow some default values. This is useful for the edge cases that can't be found automatically by the create_manifest step.

In particular, tkinter can't be built for python3-native, so its consistently missed in manifest updates.

---
 meta/recipes-devtools/python/python3_3.13.0.bb | 1 -
 1 file changed, 1 deletion(-)
meta/recipes-devtools/python/python3_3.13.0.bb +0 -1
index 8db5b813738..fd926811a74 100644
@@ -360,7 +360,6 @@ python(){
             newpackages.append(pypackage)
 
         # "Build" python's manifest FILES, RDEPENDS and SUMMARY
-        d.setVar('FILES:' + pypackage, '')
         for value in python_manifest[key]['files']:
             d.appendVar('FILES:' + pypackage, ' ' + value)
 
Signature · 1 line
2.47.0
#13 lore raw

PATCH v4 2/2 python3: package tkinter's shared objects

From: Dan McGregor <[email protected]>

Seems every time python is updated this gets removed. That's likely because the tk option can't be enabled in python3-native without creating a dependency loop.

Instead of manually editing the manifest every time, explicitly add it in the recipe as suggested by Alexander Kanavin.

---
 meta/recipes-devtools/python/python3_3.13.0.bb | 1 +
 1 file changed, 1 insertion(+)
meta/recipes-devtools/python/python3_3.13.0.bb +1 -0
index fd926811a74..a393b5e4a07 100644
@@ -427,6 +427,7 @@ RPROVIDES:${PN}-modules = "${PN}"
 
 FILES:${PN}-pydoc += "${bindir}/pydoc${PYTHON_MAJMIN} ${bindir}/pydoc3"
 FILES:${PN}-idle += "${bindir}/idle3 ${bindir}/idle${PYTHON_MAJMIN}"
+FILES:${PN}-tkinter += "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_tkinter.*.so"
 
 # provide python-pyvenv from python3-venv
 RPROVIDES:${PN}-venv += "${MLPREFIX}python3-pyvenv"
Signature · 1 line
2.47.0