[PATCH v2] libvirt-ci: forbid RISC-V cross compile on Debian < 13

杨泽伟 posted 1 patch 2 weeks, 1 day ago
Failed in applying to current master (apply log)
lcitool/projects.py | 2 +-
lcitool/util.py     | 4 +++-
2 files changed, 4 insertions(+), 2 deletions(-)
[PATCH v2] libvirt-ci: forbid RISC-V cross compile on Debian < 13
Posted by 杨泽伟 2 weeks, 1 day ago
From 3c3ebcea07d20977f30baedcec50a859c1ac04a5 Mon Sep 17 00:00:00 2001
From: yzewei <yangzewei@loongson.cn>
Date: Sat, 11 Oct 2025 09:39:29 +0800
Subject: [PATCH] This patch updates [PATCH v1] to add validation: RISC-V cross
 compilation is forbidden on Debian < 13.


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


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



本邮件及其附件含有龙芯中科的商业秘密信息,仅限于发送给上面地址中列出的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制或散发)本邮件及其附件中的信息。如果您错收本邮件,请您立即电话或邮件通知发件人并删除本邮件。 
This email and its attachments contain confidential information from Loongson Technology , which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this email in error, please notify the sender by phone or email immediately and delete it.