mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2026-02-10 11:40:28 +08:00
fix: use explicit arch parameter for sysproxy node selection
This commit is contained in:
parent
295c4400e9
commit
ab58248d7b
@ -321,10 +321,10 @@ const SYSPROXY_RS_VERSION = 'v0.1.0'
|
||||
const SYSPROXY_RS_URL_PREFIX = `https://github.com/mihomo-party-org/sysproxy-rs-opti/releases/download/${SYSPROXY_RS_VERSION}`
|
||||
|
||||
function getSysproxyNodeName() {
|
||||
// 检测是否为 musl 系统(与 src/native/sysproxy/index.js 保持一致)
|
||||
const isMusl = (() => {
|
||||
if (platform !== 'linux') return false
|
||||
try {
|
||||
// 通过 ldd --version 输出判断是否为 musl
|
||||
const output = execSync('ldd --version 2>&1 || true').toString()
|
||||
return output.includes('musl')
|
||||
} catch {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
const { existsSync, readFileSync } = require('fs')
|
||||
const { existsSync } = require('fs')
|
||||
const { join, dirname } = require('path')
|
||||
|
||||
const { platform, arch } = process
|
||||
@ -7,17 +7,19 @@ let nativeBinding = null
|
||||
let loadError = null
|
||||
|
||||
function isMusl() {
|
||||
if (!process.report || typeof process.report.getReport !== 'function') {
|
||||
try {
|
||||
const lddPath = require('child_process').execSync('which ldd').toString().trim()
|
||||
return readFileSync(lddPath, 'utf8').includes('musl')
|
||||
} catch {
|
||||
return true
|
||||
}
|
||||
} else {
|
||||
// 优先使用 process.report(Node.js 12+,最可靠)
|
||||
if (process.report && typeof process.report.getReport === 'function') {
|
||||
const { glibcVersionRuntime } = process.report.getReport().header
|
||||
return !glibcVersionRuntime
|
||||
}
|
||||
// 备选:检查 ldd --version 输出
|
||||
try {
|
||||
const { execSync } = require('child_process')
|
||||
const output = execSync('ldd --version 2>&1 || true').toString()
|
||||
return output.includes('musl')
|
||||
} catch {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
function getBindingName() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user