Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .cross_compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set -Eeuo pipefail
DIST_PREFIX="nexttrace"
DEBUG_MODE="${1:-}" # 支持 ./script.sh debug
TARGET_DIR="dist"
PLATFORMS="linux/386 linux/amd64 linux/arm64 linux/mips linux/mips64 linux/mipsle linux/mips64le windows/amd64 windows/arm64 openbsd/amd64 openbsd/arm64 freebsd/amd64 freebsd/arm64"
PLATFORMS="linux/386 linux/amd64 linux/arm64 linux/mips linux/mips64 linux/mipsle linux/mips64le linux/loong64 windows/amd64 windows/arm64 openbsd/amd64 openbsd/arm64 freebsd/amd64 freebsd/arm64"
UPX_BIN="${UPX_BIN:-$(command -v upx 2>/dev/null || true)}"
UPX_FLAGS="${UPX_FLAGS:--9}"

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jobs:
- { goos: windows, goarch: arm, goarm: 7, allow_fail: true } # windows/arm 计划于 Go 1.26 移除
- { goos: linux, goarch: arm64 }
- { goos: linux, goarch: riscv64 }
- { goos: linux, goarch: loong64 }
- { goos: linux, goarch: mips64 }
- { goos: linux, goarch: mips64le }
- { goos: linux, goarch: mipsle }
Expand Down
2 changes: 2 additions & 0 deletions nt_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ checkSystemArch() {
archParam="armv7"
elif [[ $arch == "mips" ]]; then
archParam="mips"
elif [[ $arch == "loong64" ]]; then
archParam="loong64"
Comment on lines +37 to +38
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.

fi
}

Expand Down