diff mbox series

[bug#62309,core-updates,v2,2/2] u-boot: Fix build under Python 3.10.

Message ID 1896443a4ab3038fdbd1077a625178eeae1f737b.1679389017.git.dev@jpoiret.xyz
State New
Headers show
Series Fix qemu build | expand

Commit Message

Josselin Poiret March 21, 2023, 8:59 a.m. UTC
* gnu/packages/patches/u-boot-fix-build-python-3.10.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/bootloaders.scm (u-boot): Apply patch.
---
 gnu/local.mk                                  |  1 +
 gnu/packages/bootloaders.scm                  |  3 ++
 .../u-boot-fix-build-python-3.10.patch        | 35 +++++++++++++++++++
 3 files changed, 39 insertions(+)
 create mode 100644 gnu/packages/patches/u-boot-fix-build-python-3.10.patch

Comments

Maxim Cournoyer March 21, 2023, 4:14 p.m. UTC | #1
Hi Josselin,

Josselin Poiret <dev@jpoiret.xyz> writes:

> * gnu/packages/patches/u-boot-fix-build-python-3.10.patch: New file.
> * gnu/local.mk (dist_patch_DATA): Register it.
> * gnu/packages/bootloaders.scm (u-boot): Apply patch.
> ---
>  gnu/local.mk                                  |  1 +
>  gnu/packages/bootloaders.scm                  |  3 ++
>  .../u-boot-fix-build-python-3.10.patch        | 35 +++++++++++++++++++
>  3 files changed, 39 insertions(+)
>  create mode 100644 gnu/packages/patches/u-boot-fix-build-python-3.10.patch
>
> diff --git a/gnu/local.mk b/gnu/local.mk
> index 058b23c683..73cf7b89a1 100644
> --- a/gnu/local.mk
> +++ b/gnu/local.mk
> @@ -1936,6 +1936,7 @@ dist_patch_DATA =						\
>    %D%/packages/patches/tuxpaint-stamps-path.patch		\
>    %D%/packages/patches/twinkle-bcg729.patch			\
>    %D%/packages/patches/u-boot-allow-disabling-openssl.patch	\
> +  %D%/packages/patches/u-boot-fix-build-python-3.10.patch	\
>    %D%/packages/patches/u-boot-infodocs-target.patch		\
>    %D%/packages/patches/u-boot-patman-guix-integration.patch	\
>    %D%/packages/patches/u-boot-nintendo-nes-serial.patch		\
> diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
> index ac269807be..457f3b3994 100644
> --- a/gnu/packages/bootloaders.scm
> +++ b/gnu/packages/bootloaders.scm
> @@ -655,6 +655,9 @@ (define u-boot
>                       %u-boot-allow-disabling-openssl-patch
>                       %u-boot-sifive-prevent-relocating-initrd-fdt
>                       %u-boot-rk3399-enable-emmc-phy-patch
> +                     ;; FIXME The following patch is backported from 2023.01,
> +                     ;; remove when updating.

FIXME and other similar comment prefixes are more conventionally used
with a colon (FIXME: ...), I think.  I also prefer to keep the patch
origin tracking in the patch itself (and 'guix lint' checks for that
nowadays, at least in some cases).  The patch should fail to apply when
after it's included in a release.

Feel free to push with these suggested changes.
Josselin Poiret March 21, 2023, 6:32 p.m. UTC | #2
Hi Maxim,

Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:

> FIXME and other similar comment prefixes are more conventionally used
> with a colon (FIXME: ...), I think.  I also prefer to keep the patch
> origin tracking in the patch itself (and 'guix lint' checks for that
> nowadays, at least in some cases).  The patch should fail to apply when
> after it's included in a release.

Right, I added this FIXME in the heat of the moment.  I don't really
mind either way, although I find it nice that when it fails to apply,
anyone can see this comment and conclude that it should be ok to remove
(as opposed to some patches failing because they're not up to date).
What do you mean by "patch origin tracking", and it being taken care of
by `guix lint`?

> Feel free to push with these suggested changes.

I don't know if this was directed at me or committers, but I'll just add
that I do not have commit rights, if anyone else wants to have a look
and push :)

Best,
Maxim Cournoyer March 22, 2023, 6:23 p.m. UTC | #3
Hi,

Josselin Poiret <dev@jpoiret.xyz> writes:

> Hi Maxim,
>
> Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:
>
>> FIXME and other similar comment prefixes are more conventionally used
>> with a colon (FIXME: ...), I think.  I also prefer to keep the patch
>> origin tracking in the patch itself (and 'guix lint' checks for that
>> nowadays, at least in some cases).  The patch should fail to apply when
>> after it's included in a release.
>
> Right, I added this FIXME in the heat of the moment.  I don't really
> mind either way, although I find it nice that when it fails to apply,
> anyone can see this comment and conclude that it should be ok to remove
> (as opposed to some patches failing because they're not up to date).
> What do you mean by "patch origin tracking", and it being taken care of
> by `guix lint`?
>
>> Feel free to push with these suggested changes.
>
> I don't know if this was directed at me or committers, but I'll just add
> that I do not have commit rights, if anyone else wants to have a look
> and push :)

It was directed at you, I thought you already had commit rights :-).
Ludovic Courtès March 26, 2023, 8:30 p.m. UTC | #4
Hi,

Pushed both patches as 68793b702e4295d011c89e72826fd15ce18e0b95, with
the cosmetic changes Maxim proposed.

Thanks!

Ludo’.
diff mbox series

Patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 058b23c683..73cf7b89a1 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1936,6 +1936,7 @@  dist_patch_DATA =						\
   %D%/packages/patches/tuxpaint-stamps-path.patch		\
   %D%/packages/patches/twinkle-bcg729.patch			\
   %D%/packages/patches/u-boot-allow-disabling-openssl.patch	\
+  %D%/packages/patches/u-boot-fix-build-python-3.10.patch	\
   %D%/packages/patches/u-boot-infodocs-target.patch		\
   %D%/packages/patches/u-boot-patman-guix-integration.patch	\
   %D%/packages/patches/u-boot-nintendo-nes-serial.patch		\
diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index ac269807be..457f3b3994 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -655,6 +655,9 @@  (define u-boot
                      %u-boot-allow-disabling-openssl-patch
                      %u-boot-sifive-prevent-relocating-initrd-fdt
                      %u-boot-rk3399-enable-emmc-phy-patch
+                     ;; FIXME The following patch is backported from 2023.01,
+                     ;; remove when updating.
+                     (search-patch "u-boot-fix-build-python-3.10.patch")
                      (search-patch "u-boot-infodocs-target.patch")
                      (search-patch "u-boot-patman-guix-integration.patch")))
               (method url-fetch)
diff --git a/gnu/packages/patches/u-boot-fix-build-python-3.10.patch b/gnu/packages/patches/u-boot-fix-build-python-3.10.patch
new file mode 100644
index 0000000000..27c03f92f4
--- /dev/null
+++ b/gnu/packages/patches/u-boot-fix-build-python-3.10.patch
@@ -0,0 +1,35 @@ 
+From 7d01bb1c5a1daef0187c9ea276bde19a8d0e7fde Mon Sep 17 00:00:00 2001
+From: Michal Suchanek <msuchanek@suse.de>
+Date: Thu, 13 Oct 2022 22:43:41 +0200
+Subject: [PATCH] libfdt: Fix build with python 3.10
+
+Python 3.10 requires defining PY_SSIZE_T_CLEAN. This will be fixed in
+swig 4.10 but it is not clear when it will be released. There was a
+warning since python 3.8.
+
+Link: https://github.com/swig/swig/pull/2277
+
+Signed-off-by: Michal Suchanek <msuchanek@suse.de>
+Reviewed-by: Simon Glass <sjg@chromium.org>
+---
+ scripts/dtc/pylibfdt/libfdt.i_shipped | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/scripts/dtc/pylibfdt/libfdt.i_shipped b/scripts/dtc/pylibfdt/libfdt.i_shipped
+index 27c29ea260..56cc5d48f4 100644
+--- a/scripts/dtc/pylibfdt/libfdt.i_shipped
++++ b/scripts/dtc/pylibfdt/libfdt.i_shipped
+@@ -7,6 +7,10 @@
+ 
+ %module libfdt
+ 
++%begin %{
++#define PY_SSIZE_T_CLEAN
++%}
++
+ %include <stdint.i>
+ 
+ %{
+-- 
+GitLab
+