Skip to content

Add linux/loong64 target#142

Merged
tsosunchia merged 1 commit intonxtrace:mainfrom
KatyushaScarlet:main
Jan 7, 2026
Merged

Add linux/loong64 target#142
tsosunchia merged 1 commit intonxtrace:mainfrom
KatyushaScarlet:main

Conversation

@KatyushaScarlet
Copy link

@KatyushaScarlet KatyushaScarlet commented Jan 7, 2026

Add linux/loong64 target to:

image

Summary by CodeRabbit

新增功能

  • 扩展了支持的目标架构:新增了对 loong64 架构的支持,使产品现可在 loong64 系统上进行构建和部署。该变更更新了构建配置、持续集成流程和系统架构检测逻辑,增强了产品的跨平台兼容性。

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 7, 2026

概览

该变更在三个文件中添加了对 loong64 架构的支持:编译平台列表、持续集成构建矩阵和系统架构检查逻辑。loong64 作为新的目标架构被集成到现有的构建和安装流程中。

变更

内聚组 / 文件 变更摘要
构建配置
.cross_compile.sh, .github/workflows/build.yml
在各自的平台/矩阵列表中添加 linux/loong64 架构支持,扩展跨平台编译和 CI 覆盖范围
系统架构检测
nt_install.sh
checkSystemArch 函数中添加 loong64 架构分支,使系统能够识别并映射 loong64 架构参数

代码审查工作量评估

🎯 2 (Simple) | ⏱️ ~8 分钟

🐰 架构扩展迎新朋,
loong64 龙芯入行列,
跨越山河编译忙,
从脚本到工作流,
又一片天地敞开啦!🚀

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题清晰准确地反映了PR的主要变更:添加linux/loong64目标架构支持,这与raw_summary中对三个文件的修改相符。

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @nt_install.sh:
- Around line 37-38: The architecture check branch using the variable arch
currently matches "loong64" and sets archParam to "loong64", which is incorrect
for LoongArch64 systems where uname -m returns "loongarch64"; update the
conditional in the branch that handles LoongArch to match "loongarch64" (or
accept both "loongarch64" and "loong64") and set archParam to the correct
identifier "loongarch64" (or normalize both inputs to "loongarch64") so the
architecture detection and subsequent logic use the proper LoongArch64 name.
📜 Review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 182c6ab and 412010e.

📒 Files selected for processing (3)
  • .cross_compile.sh
  • .github/workflows/build.yml
  • nt_install.sh
🔇 Additional comments (2)
.cross_compile.sh (1)

9-9: 变更正确!

linux/loong64 已正确添加到平台列表中,格式与其他平台一致。该目标将使用 CGO_ENABLED=0 进行纯 Go 编译,这对于交叉编译场景是合适的。

.github/workflows/build.yml (1)

53-53: loong64 目标架构支持确认无误,可以批准合并。

Go 1.25.x 完全支持 linux/loong64 目标架构,包括竞态检测器、cgo 回溯支持和 cgo 程序内部链接。loong64 已正确添加到构建矩阵中,格式与其他架构保持一致。

Comment on lines +37 to +38
elif [[ $arch == "loong64" ]]; then
archParam="loong64"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

# Search the codebase for loong-related references
rg -i "loong" --type-list | head -20

Repository: nxtrace/NTrace-V1

Length of output: 450


🏁 Script executed:

# Search for loong references in all files
rg -i "loong(arch)?64" -C 2

Repository: nxtrace/NTrace-V1

Length of output: 275


🏁 Script executed:

# Read the nt_install.sh file to understand the context
git ls-files | grep -E "(nt_install|install)" | head -10

Repository: nxtrace/NTrace-V1

Length of output: 74


🌐 Web query:

What does uname -m return on LoongArch64 Linux systems

💡 Result:

On LoongArch64 Linux systems uname -m returns: loongarch64. [1][2]


🌐 Web query:

LoongArch64 architecture identifier uname output

💡 Result:

On LoongArch64 Linux, uname -m reports: loongarch64. [1][2][3]

Sources:

  • qemu-devel example uname output showing "loongarch64". [1]
  • Launchpad / dpkg example showing "uname -m" = "loongarch64". [2]
  • Slackware/porting discussion noting package/arch names and uname-m = "loongarch64". [3]

🏁 Script executed:

# Read the full nt_install.sh file to understand context
wc -l nt_install.sh

Repository: nxtrace/NTrace-V1

Length of output: 78


🏁 Script executed:

# Read the architecture detection section
cat -n nt_install.sh | head -50

Repository: nxtrace/NTrace-V1

Length of output: 1509


🏁 Script executed:

# Search for all loong references in the entire codebase
rg -i "loong" -A 2 -B 2

Repository: nxtrace/NTrace-V1

Length of output: 275


修正 LoongArch 架构检测:应检查 loongarch64 而非 loong64

LoongArch64 系统上 uname -m 返回的是 loongarch64,而当前代码检查的是 loong64,这导致架构检测失败。需要更改检查条件为正确的标识符,或同时支持两种标识符:

 elif [[ $arch == "mips" ]]; then
 archParam="mips"
-elif [[ $arch == "loong64" ]]; then
+elif [[ $arch == "loongarch64" ]] || [[ $arch == "loong64" ]]; then
 archParam="loong64"
 fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
elif [[ $arch == "loong64" ]]; then
archParam="loong64"
elif [[ $arch == "mips" ]]; then
archParam="mips"
elif [[ $arch == "loongarch64" ]] || [[ $arch == "loong64" ]]; then
archParam="loong64"
fi
🤖 Prompt for AI Agents
In @nt_install.sh around lines 37 - 38, The architecture check branch using the
variable arch currently matches "loong64" and sets archParam to "loong64", which
is incorrect for LoongArch64 systems where uname -m returns "loongarch64";
update the conditional in the branch that handles LoongArch to match
"loongarch64" (or accept both "loongarch64" and "loong64") and set archParam to
the correct identifier "loongarch64" (or normalize both inputs to "loongarch64")
so the architecture detection and subsequent logic use the proper LoongArch64
name.

@tsosunchia tsosunchia merged commit 67440e7 into nxtrace:main Jan 7, 2026
38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants