[PATCH v3] libvirt-ci: remove obsolete RISC-V ports setup for Debian 13+

yangzewei@loongson.cn posted 1 patch 2 weeks, 1 day ago
Failed in applying to current master (apply log)
lcitool/formatters.py | 15 ---------------
lcitool/projects.py   |  2 +-
lcitool/util.py       |  4 +++-
3 files changed, 4 insertions(+), 17 deletions(-)
[PATCH v3] libvirt-ci: remove obsolete RISC-V ports setup for Debian 13+
Posted by yangzewei@loongson.cn 2 weeks, 1 day ago
From: yzewei <yangzewei@loongson.cn>

This patch combines previous v1 and v2 patches, Please ignore previous patches v1 and v2.

- Remove obsolete RISC-V ports setup for Debian 13+
  Debian 13 and later officially support riscv64, so the old
  debian-ports archive keyring and sources.list configuration
  are no longer necessary.

- Add validation to forbid RISC-V cross compilation on Debian < 13
  Ensures that cross compiling for riscv64 on unsupported Debian
  releases fails early with a clear error message.

Signed-off-by: yzewei <yangzewei@loongson.cn>
---
 lcitool/formatters.py | 15 ---------------
 lcitool/projects.py   |  2 +-
 lcitool/util.py       |  4 +++-
 3 files changed, 4 insertions(+), 17 deletions(-)

diff --git a/lcitool/formatters.py b/lcitool/formatters.py
index c26cf22a..af171fae 100644
--- a/lcitool/formatters.py
+++ b/lcitool/formatters.py
@@ -456,21 +456,6 @@ class BuildEnvFormatter(Formatter):
                     "dpkg --add-architecture {cross_arch_deb}",
                 ]
             )
-            if target.cross_arch == "riscv64":
-                cross_commands.extend(
-                    [
-                        "{nosync}{packaging_command} install debian-ports-archive-keyring",
-                        "{nosync}echo 'deb http://ftp.ports.debian.org/debian-ports/ sid main' > /etc/apt/sources.list.d/ports.list",
-                        "{nosync}echo 'deb http://ftp.ports.debian.org/debian-ports/ unreleased main' >> /etc/apt/sources.list.d/ports.list",
-                    ]
-                )
-            cross_commands.extend(
-                [
-                    "{nosync}{packaging_command} update",
-                    "{nosync}{packaging_command} dist-upgrade -y",
-                    "{nosync}{packaging_command} install --no-install-recommends -y dpkg-dev",
-                ]
-            )
             if varmap["cross_pkgs"]:
                 cross_commands.extend(
                     [
diff --git a/lcitool/projects.py b/lcitool/projects.py
index f1187cb2..0324f21a 100644
--- a/lcitool/projects.py
+++ b/lcitool/projects.py
@@ -270,7 +270,7 @@ class Project:
             target_name = f"{target_name}"
         else:
             try:
-                util.validate_cross_platform(target.cross_arch, osname)
+                util.validate_cross_platform(target.cross_arch, osname, osversion)
             except ValueError as ex:
                 raise ProjectError(str(ex))
             target_name = f"{target_name}-{target.cross_arch}-cross"
diff --git a/lcitool/util.py b/lcitool/util.py
index 3f5cb870..aedf3882 100644
--- a/lcitool/util.py
+++ b/lcitool/util.py
@@ -409,10 +409,12 @@ class DataDir:
         return result
 
 
-def validate_cross_platform(cross_arch: str, osname: str) -> None:
+def validate_cross_platform(cross_arch: str, osname: str, osversion: str) -> None:
     if osname not in ["Debian", "Fedora"]:
         raise ValueError(f"Cannot cross compile on {osname}")
     if osname == "Debian" and cross_arch.startswith("mingw"):
         raise ValueError(f"Cannot cross compile for {cross_arch} on {osname}")
     if osname == "Fedora" and not cross_arch.startswith("mingw"):
         raise ValueError(f"Cannot cross compile for {cross_arch} on {osname}")
+    if osname == "Debian" and cross_arch == "riscv64" and int(osversion.split('.')[0]) < 13:
+        raise ValueError(f"Cross compiling for {cross_arch} is not supported on Debian < 13")
-- 
2.43.0
Re: [PATCH v3] libvirt-ci: remove obsolete RISC-V ports setup for Debian 13+
Posted by Daniel P. Berrangé via Devel 1 week, 5 days ago
Hi,

Only the main libvirt.git uses the old style mailing list
workflow. Everything else is exclusively gitlab merge
requests, so could you submit an MR for this against the
https://gitlab.com/libvirt/libvirt-ci repository.

On Sat, Oct 11, 2025 at 10:26:00AM +0800, yangzewei@loongson.cn wrote:
> From: yzewei <yangzewei@loongson.cn>
> 
> This patch combines previous v1 and v2 patches, Please ignore previous patches v1 and v2.
> 
> - Remove obsolete RISC-V ports setup for Debian 13+
>   Debian 13 and later officially support riscv64, so the old
>   debian-ports archive keyring and sources.list configuration
>   are no longer necessary.
> 
> - Add validation to forbid RISC-V cross compilation on Debian < 13
>   Ensures that cross compiling for riscv64 on unsupported Debian
>   releases fails early with a clear error message.
> 
> Signed-off-by: yzewei <yangzewei@loongson.cn>
> ---
>  lcitool/formatters.py | 15 ---------------
>  lcitool/projects.py   |  2 +-
>  lcitool/util.py       |  4 +++-
>  3 files changed, 4 insertions(+), 17 deletions(-)
> 
> diff --git a/lcitool/formatters.py b/lcitool/formatters.py
> index c26cf22a..af171fae 100644
> --- a/lcitool/formatters.py
> +++ b/lcitool/formatters.py
> @@ -456,21 +456,6 @@ class BuildEnvFormatter(Formatter):
>                      "dpkg --add-architecture {cross_arch_deb}",
>                  ]
>              )
> -            if target.cross_arch == "riscv64":
> -                cross_commands.extend(
> -                    [
> -                        "{nosync}{packaging_command} install debian-ports-archive-keyring",
> -                        "{nosync}echo 'deb http://ftp.ports.debian.org/debian-ports/ sid main' > /etc/apt/sources.list.d/ports.list",
> -                        "{nosync}echo 'deb http://ftp.ports.debian.org/debian-ports/ unreleased main' >> /etc/apt/sources.list.d/ports.list",
> -                    ]
> -                )
> -            cross_commands.extend(
> -                [
> -                    "{nosync}{packaging_command} update",
> -                    "{nosync}{packaging_command} dist-upgrade -y",
> -                    "{nosync}{packaging_command} install --no-install-recommends -y dpkg-dev",
> -                ]
> -            )
>              if varmap["cross_pkgs"]:
>                  cross_commands.extend(
>                      [
> diff --git a/lcitool/projects.py b/lcitool/projects.py
> index f1187cb2..0324f21a 100644
> --- a/lcitool/projects.py
> +++ b/lcitool/projects.py
> @@ -270,7 +270,7 @@ class Project:
>              target_name = f"{target_name}"
>          else:
>              try:
> -                util.validate_cross_platform(target.cross_arch, osname)
> +                util.validate_cross_platform(target.cross_arch, osname, osversion)
>              except ValueError as ex:
>                  raise ProjectError(str(ex))
>              target_name = f"{target_name}-{target.cross_arch}-cross"
> diff --git a/lcitool/util.py b/lcitool/util.py
> index 3f5cb870..aedf3882 100644
> --- a/lcitool/util.py
> +++ b/lcitool/util.py
> @@ -409,10 +409,12 @@ class DataDir:
>          return result
>  
>  
> -def validate_cross_platform(cross_arch: str, osname: str) -> None:
> +def validate_cross_platform(cross_arch: str, osname: str, osversion: str) -> None:
>      if osname not in ["Debian", "Fedora"]:
>          raise ValueError(f"Cannot cross compile on {osname}")
>      if osname == "Debian" and cross_arch.startswith("mingw"):
>          raise ValueError(f"Cannot cross compile for {cross_arch} on {osname}")
>      if osname == "Fedora" and not cross_arch.startswith("mingw"):
>          raise ValueError(f"Cannot cross compile for {cross_arch} on {osname}")
> +    if osname == "Debian" and cross_arch == "riscv64" and int(osversion.split('.')[0]) < 13:
> +        raise ValueError(f"Cross compiling for {cross_arch} is not supported on Debian < 13")
> -- 
> 2.43.0
> 

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|