Skip to contentSkip to conversation

package/gdb: remove python2 support

PATCH In review Adam Duskett 3 participants 4 messages Jan 4, 2022 – Jan 13, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/gdb: remove python2 support

According to the GDB 9.2 changelog, python3 has been supported since at least 2019.

- Remove BR2_PACKAGE_HOST_GDB_PYTHON in package/gdb/Config.in.host

- Add BR2_PACKAGE_HOST_GDB_PYTHON to Config.in.legacy

- Change depends on BR2_PACKAGE_PYTHON || BR2_PACKAGE_PYTHON3 to depends on BR2_PACKAGE_PYTHON3 in package/gdb/Config.in

---
 Config.in.legacy           |  7 +++++++
 package/gdb/Config.in      |  2 +-
 package/gdb/Config.in.host |  5 -----
 package/gdb/gdb.mk         | 10 +---------
 4 files changed, 9 insertions(+), 15 deletions(-)
Config.in.legacy +7 -0
index 5994d94487..a126d56052 100644
@@ -146,6 +146,13 @@ endif
 
 comment "Legacy options removed in 2022.02"
 
+config BR2_PACKAGE_HOST_GDB_PYTHON
+	bool "GDB Python2 support removed"
+	select BR2_LEGACY
+	help
+	  Python2 is deprecated and no longer supported.
+	  Please migrate to Python3.
+
 config BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_RISCV64_GLIBC_BLEEDING_EDGE
 	bool "Bootlin riscv64 glibc bleeding-edge toolchain removed"
 	select BR2_LEGACY
package/gdb/Config.in +1 -1
index 6f1a883de7..daad6c910d 100644
@@ -77,7 +77,7 @@ config BR2_PACKAGE_GDB_TUI
 
 config BR2_PACKAGE_GDB_PYTHON
 	bool "Python support"
-	depends on BR2_PACKAGE_PYTHON || BR2_PACKAGE_PYTHON3
+	depends on BR2_PACKAGE_PYTHON3
 	help
 	  This option enables Python support in the target gdb.
 
package/gdb/Config.in.host +0 -5
index a6e1d7f53c..2c6c78f20a 100644
@@ -41,11 +41,6 @@ config BR2_PACKAGE_HOST_GDB_NOPYTHON
 	help
 	  This option disables Python support in the cross gdb.
 
-config BR2_PACKAGE_HOST_GDB_PYTHON
-	bool "Python 2"
-	help
-	  This option enables the Python 2 support in the cross gdb.
-
 config BR2_PACKAGE_HOST_GDB_PYTHON3
 	bool "Python 3"
 	help
package/gdb/gdb.mk +1 -9
index 4ff498230a..2929eaf058 100644
@@ -206,11 +206,6 @@ ifeq ($(BR2_PACKAGE_PYTHON3),y)
 GDB_CONF_ENV += BR_PYTHON_VERSION=$(PYTHON3_VERSION_MAJOR)
 GDB_MAKE_ENV += BR_PYTHON_VERSION=$(PYTHON3_VERSION_MAJOR)
 GDB_DEPENDENCIES += python3
-else
-# CONF_ENV: for top-level configure; MAKE_ENV: for sub-projects' configure.
-GDB_CONF_ENV += BR_PYTHON_VERSION=$(PYTHON_VERSION_MAJOR)
-GDB_MAKE_ENV += BR_PYTHON_VERSION=$(PYTHON_VERSION_MAJOR)
-GDB_DEPENDENCIES += python
 endif
 GDB_CONF_OPTS += --with-python=$(TOPDIR)/package/gdb/gdb-python-config
 else
@@ -287,10 +282,7 @@ else
 HOST_GDB_CONF_OPTS += --disable-tui
 endif
 
-ifeq ($(BR2_PACKAGE_HOST_GDB_PYTHON),y)
-HOST_GDB_CONF_OPTS += --with-python=$(HOST_DIR)/bin/python2
-HOST_GDB_DEPENDENCIES += host-python
-else ifeq ($(BR2_PACKAGE_HOST_GDB_PYTHON3),y)
+ifeq ($(BR2_PACKAGE_HOST_GDB_PYTHON3),y)
 HOST_GDB_CONF_OPTS += --with-python=$(HOST_DIR)/bin/python3
 HOST_GDB_DEPENDENCIES += host-python3
 else
Signature · 6 lines
2.33.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

Hello Adam,

Le 04/01/2022 à 21:09, Adam Duskett a écrit :

Quoted 9 lines

According to the GDB 9.2 changelog, python3 has been supported since at least 2019.

- Remove BR2_PACKAGE_HOST_GDB_PYTHON in package/gdb/Config.in.host

- Add BR2_PACKAGE_HOST_GDB_PYTHON to Config.in.legacy

- Change depends on BR2_PACKAGE_PYTHON || BR2_PACKAGE_PYTHON3 to depends on BR2_PACKAGE_PYTHON3 in package/gdb/Config.in

Agree on the principle but it seems that the gdb for csky is still based on gdb 7.12.

https://github.com/c-sky/binutils-gdb/blob/4ecb98fbc2f94dbe01b69384afbc515107de73df/gdb/version.in

But since csky toolchain has been removed recently, I guess we can remove the before applying your patch.

For ARC, gdb is based on 10.x

https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/blob/arc-2020.09-release-gdb/gdb/version.in

Best regards,
Romain

Quoted 75 lines
---
 Config.in.legacy           |  7 +++++++
 package/gdb/Config.in      |  2 +-
 package/gdb/Config.in.host |  5 -----
 package/gdb/gdb.mk         | 10 +---------
 4 files changed, 9 insertions(+), 15 deletions(-)
Config.in.legacy +7 -0
index 5994d94487..a126d56052 100644
@@ -146,6 +146,13 @@ endif
 
 comment "Legacy options removed in 2022.02"
 
+config BR2_PACKAGE_HOST_GDB_PYTHON
+	bool "GDB Python2 support removed"
+	select BR2_LEGACY
+	help
+	  Python2 is deprecated and no longer supported.
+	  Please migrate to Python3.
+
 config BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_RISCV64_GLIBC_BLEEDING_EDGE
 	bool "Bootlin riscv64 glibc bleeding-edge toolchain removed"
 	select BR2_LEGACY
package/gdb/Config.in +1 -1
index 6f1a883de7..daad6c910d 100644
@@ -77,7 +77,7 @@ config BR2_PACKAGE_GDB_TUI
 
 config BR2_PACKAGE_GDB_PYTHON
 	bool "Python support"
-	depends on BR2_PACKAGE_PYTHON || BR2_PACKAGE_PYTHON3
+	depends on BR2_PACKAGE_PYTHON3
 	help
 	  This option enables Python support in the target gdb.
 
package/gdb/Config.in.host +0 -5
index a6e1d7f53c..2c6c78f20a 100644
@@ -41,11 +41,6 @@ config BR2_PACKAGE_HOST_GDB_NOPYTHON
 	help
 	  This option disables Python support in the cross gdb.
 
-config BR2_PACKAGE_HOST_GDB_PYTHON
-	bool "Python 2"
-	help
-	  This option enables the Python 2 support in the cross gdb.
-
 config BR2_PACKAGE_HOST_GDB_PYTHON3
 	bool "Python 3"
 	help
package/gdb/gdb.mk +0 -5
index 4ff498230a..2929eaf058 100644
@@ -206,11 +206,6 @@ ifeq ($(BR2_PACKAGE_PYTHON3),y)
 GDB_CONF_ENV += BR_PYTHON_VERSION=$(PYTHON3_VERSION_MAJOR)
 GDB_MAKE_ENV += BR_PYTHON_VERSION=$(PYTHON3_VERSION_MAJOR)
 GDB_DEPENDENCIES += python3
-else
-# CONF_ENV: for top-level configure; MAKE_ENV: for sub-projects' configure.
-GDB_CONF_ENV += BR_PYTHON_VERSION=$(PYTHON_VERSION_MAJOR)
-GDB_MAKE_ENV += BR_PYTHON_VERSION=$(PYTHON_VERSION_MAJOR)
-GDB_DEPENDENCIES += python
 endif
 GDB_CONF_OPTS += --with-python=$(TOPDIR)/package/gdb/gdb-python-config
 else
@@ -287,10 +282,7 @@ else
 HOST_GDB_CONF_OPTS += --disable-tui

package/gdb/gdb.mk else · line 288

Quoted 10 lines
package/gdb/gdb.mk +1 -4
 endif
 
-ifeq ($(BR2_PACKAGE_HOST_GDB_PYTHON),y)
-HOST_GDB_CONF_OPTS += --with-python=$(HOST_DIR)/bin/python2
-HOST_GDB_DEPENDENCIES += host-python
-else ifeq ($(BR2_PACKAGE_HOST_GDB_PYTHON3),y)
+ifeq ($(BR2_PACKAGE_HOST_GDB_PYTHON3),y)
 HOST_GDB_CONF_OPTS += --with-python=$(HOST_DIR)/bin/python3
 HOST_GDB_DEPENDENCIES += host-python3
 else

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#2 lore raw

Le 06/01/2022 à 22:10, Romain Naour a écrit :

Quoted 5 lines

Hello Adam,

Le 04/01/2022 à 21:09, Adam Duskett a écrit :

Quoted 2 lines

According to the GDB 9.2 changelog, python3 has been supported since at least 2019.

Actually python3 support is available since gdb 7.8 for Linux:

https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=9a27f2c60d760a95a27e336750f26f69f91dd156

It's gdb python3 support for windows that is available since version 9.2.

Best regards,
Romain

Quoted 99 lines
Quoted 7 lines

- Remove BR2_PACKAGE_HOST_GDB_PYTHON in package/gdb/Config.in.host

- Add BR2_PACKAGE_HOST_GDB_PYTHON to Config.in.legacy

- Change depends on BR2_PACKAGE_PYTHON || BR2_PACKAGE_PYTHON3 to depends on BR2_PACKAGE_PYTHON3 in package/gdb/Config.in

Agree on the principle but it seems that the gdb for csky is still based on gdb 7.12.

https://github.com/c-sky/binutils-gdb/blob/4ecb98fbc2f94dbe01b69384afbc515107de73df/gdb/version.in

But since csky toolchain has been removed recently, I guess we can remove the before applying your patch.

For ARC, gdb is based on 10.x

https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/blob/arc-2020.09-release-gdb/gdb/version.in

Best regards,
Romain

Quoted 76 lines
---
 Config.in.legacy           |  7 +++++++
 package/gdb/Config.in      |  2 +-
 package/gdb/Config.in.host |  5 -----
 package/gdb/gdb.mk         | 10 +---------
 4 files changed, 9 insertions(+), 15 deletions(-)
Config.in.legacy +7 -0
index 5994d94487..a126d56052 100644
@@ -146,6 +146,13 @@ endif
 
 comment "Legacy options removed in 2022.02"
 
+config BR2_PACKAGE_HOST_GDB_PYTHON
+	bool "GDB Python2 support removed"
+	select BR2_LEGACY
+	help
+	  Python2 is deprecated and no longer supported.
+	  Please migrate to Python3.
+
 config BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_RISCV64_GLIBC_BLEEDING_EDGE
 	bool "Bootlin riscv64 glibc bleeding-edge toolchain removed"
 	select BR2_LEGACY
package/gdb/Config.in +1 -1
index 6f1a883de7..daad6c910d 100644
@@ -77,7 +77,7 @@ config BR2_PACKAGE_GDB_TUI
 
 config BR2_PACKAGE_GDB_PYTHON
 	bool "Python support"
-	depends on BR2_PACKAGE_PYTHON || BR2_PACKAGE_PYTHON3
+	depends on BR2_PACKAGE_PYTHON3
 	help
 	  This option enables Python support in the target gdb.
 
package/gdb/Config.in.host +0 -5
index a6e1d7f53c..2c6c78f20a 100644
@@ -41,11 +41,6 @@ config BR2_PACKAGE_HOST_GDB_NOPYTHON
 	help
 	  This option disables Python support in the cross gdb.
 
-config BR2_PACKAGE_HOST_GDB_PYTHON
-	bool "Python 2"
-	help
-	  This option enables the Python 2 support in the cross gdb.
-
 config BR2_PACKAGE_HOST_GDB_PYTHON3
 	bool "Python 3"
 	help
package/gdb/gdb.mk +0 -5
index 4ff498230a..2929eaf058 100644
@@ -206,11 +206,6 @@ ifeq ($(BR2_PACKAGE_PYTHON3),y)
 GDB_CONF_ENV += BR_PYTHON_VERSION=$(PYTHON3_VERSION_MAJOR)
 GDB_MAKE_ENV += BR_PYTHON_VERSION=$(PYTHON3_VERSION_MAJOR)
 GDB_DEPENDENCIES += python3
-else
-# CONF_ENV: for top-level configure; MAKE_ENV: for sub-projects' configure.
-GDB_CONF_ENV += BR_PYTHON_VERSION=$(PYTHON_VERSION_MAJOR)
-GDB_MAKE_ENV += BR_PYTHON_VERSION=$(PYTHON_VERSION_MAJOR)
-GDB_DEPENDENCIES += python
 endif
 GDB_CONF_OPTS += --with-python=$(TOPDIR)/package/gdb/gdb-python-config
 else
@@ -287,10 +282,7 @@ else
 HOST_GDB_CONF_OPTS += --disable-tui
 endif
 
Quoted 10 lines

package/gdb/gdb.mk else · line 288

Quoted 9 lines
package/gdb/gdb.mk +1 -4
-ifeq ($(BR2_PACKAGE_HOST_GDB_PYTHON),y)
-HOST_GDB_CONF_OPTS += --with-python=$(HOST_DIR)/bin/python2
-HOST_GDB_DEPENDENCIES += host-python
-else ifeq ($(BR2_PACKAGE_HOST_GDB_PYTHON3),y)
+ifeq ($(BR2_PACKAGE_HOST_GDB_PYTHON3),y)
 HOST_GDB_CONF_OPTS += --with-python=$(HOST_DIR)/bin/python3
 HOST_GDB_DEPENDENCIES += host-python3
 else

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#3 lore raw
In reply to Adam Duskett

Hello,

Quoted 11 lines · On Tue, 4 Jan 2022 12:09:04 -0800 Adam Duskett <[email protected]> wrote:

According to the GDB 9.2 changelog, python3 has been supported since at least 2019.

- Remove BR2_PACKAGE_HOST_GDB_PYTHON in package/gdb/Config.in.host

- Add BR2_PACKAGE_HOST_GDB_PYTHON to Config.in.legacy

- Change depends on BR2_PACKAGE_PYTHON || BR2_PACKAGE_PYTHON3 to depends on BR2_PACKAGE_PYTHON3 in package/gdb/Config.in

I have applied your patch, after some changes. See below.

Quoted 6 lines
package/gdb/Config.in.host +0 -0
index a6e1d7f53c..2c6c78f20a 100644
@@ -41,11 +41,6 @@ config BR2_PACKAGE_HOST_GDB_NOPYTHON
 	help

package/gdb/Config.in.host config BR2_PACKAGE_HOST_GDB_NOPYTHON · line 46

Quoted 10 lines
package/gdb/Config.in.host +0 -5
 	  This option disables Python support in the cross gdb.
 
-config BR2_PACKAGE_HOST_GDB_PYTHON
-	bool "Python 2"
-	help
-	  This option enables the Python 2 support in the cross gdb.
-
 config BR2_PACKAGE_HOST_GDB_PYTHON3
 	bool "Python 3"
 	help

The choice ... endchoice here was no longer needed, so I have only kept BR2_PACKAGE_HOST_GDB_PYTHON3 as an option.

package/gdb/gdb.mk ifeq ($(BR2_PACKAGE_PYTHON3),y)

Quoted 5 lines
package/gdb/gdb.mk +0 -0
index 4ff498230a..2929eaf058 100644
@@ -206,11 +206,6 @@ ifeq ($(BR2_PACKAGE_PYTHON3),y)

This ifeq ($(BR2_PACKAGE_PYTHON3),y) was no longer needed: we know it's always going to be python3.

Applied with those changes. Thanks!

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot