@oxiaom/adoremix 1.0.34 → 1.0.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/doctor.js +38 -8
- package/src/paths.js +2 -0
package/package.json
CHANGED
package/src/doctor.js
CHANGED
|
@@ -166,6 +166,25 @@ function runDoctor(workdir, opts) {
|
|
|
166
166
|
native = paths.loadNative();
|
|
167
167
|
logger.ok(`✓ 平台子包 ${native.pkgName}`);
|
|
168
168
|
} catch (e) {
|
|
169
|
+
if (e && e.code === 'NATIVE_VERSION_MISMATCH') {
|
|
170
|
+
const mainVer = e.mainVersion || require('../package.json').version;
|
|
171
|
+
const fixCmd = `npm install -g @oxiaom/adoremix@${mainVer} --registry https://registry.npmjs.org`;
|
|
172
|
+
issues.push({ type: 'native-version-mismatch', severity: 'error', msg: e.message, fixCmd });
|
|
173
|
+
logger.error(`❌ ${e.message.split('\n')[0]}`);
|
|
174
|
+
logger.log(` 自动修复:adoremix doctor --fix(用官方源重装到 v${mainVer})`);
|
|
175
|
+
logger.log(` 或手动执行:${fixCmd}`);
|
|
176
|
+
if (opts.fix) {
|
|
177
|
+
logger.info('==> 用官方源重装主包(含最新子包)...');
|
|
178
|
+
try {
|
|
179
|
+
execSync(fixCmd, { stdio: 'inherit' });
|
|
180
|
+
logger.ok('✓ 已重装,请重新运行 adoremix doctor 确认');
|
|
181
|
+
} catch (e2) {
|
|
182
|
+
logger.error(`重装失败:${(e2.message || '').split('\n')[0]}`);
|
|
183
|
+
logger.warn(` 请手动执行:${fixCmd}`);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
return reportAndExit(issues, opts);
|
|
187
|
+
}
|
|
169
188
|
issues.push({ type: 'native', severity: 'error', msg: e.message });
|
|
170
189
|
logger.error(`❌ 平台子包未加载:${e.message.split('\n')[0]}`);
|
|
171
190
|
return reportAndExit(issues, opts);
|
|
@@ -316,24 +335,35 @@ function runDoctor(workdir, opts) {
|
|
|
316
335
|
}
|
|
317
336
|
}
|
|
318
337
|
|
|
319
|
-
// C. Qt
|
|
320
|
-
|
|
338
|
+
// C. 捆绑库一致性:自包含包中,Qt/ICU/pcre/z/glib/krb5/sqlite/ssl 等应全部从捆绑 lib/ 解析。
|
|
339
|
+
// 若某个库从系统路径加载,说明捆绑不完整或 RPATH 未生效,版本可能不匹配(如系统 ICU72 vs 捆绑 ICU67)。
|
|
340
|
+
const BUNDLED_PREFIXES = [
|
|
341
|
+
'libQt5', 'libicu', 'libpcre', 'libz', 'libglib-2.0',
|
|
342
|
+
'libgssapi_krb5', 'libkrb5', 'libk5crypto', 'libkrb5support',
|
|
343
|
+
'libcom_err', 'libkeyutils', 'libdouble-conversion', 'libsqlite3',
|
|
344
|
+
'libssl', 'libcrypto', 'libhiredis', 'libmariadb', 'libopus', 'libmp3lame'
|
|
345
|
+
];
|
|
321
346
|
const libDirNorm = path.normalize(libDir);
|
|
322
|
-
|
|
347
|
+
let bundledChecked = 0;
|
|
348
|
+
let bundledFromSystem = 0;
|
|
349
|
+
for (const so of Object.keys(resolved)) {
|
|
350
|
+
if (!BUNDLED_PREFIXES.some(p => so.startsWith(p))) continue;
|
|
351
|
+
bundledChecked++;
|
|
323
352
|
const rp = resolved[so];
|
|
324
353
|
if (!rp) {
|
|
325
|
-
issues.push({ type: '
|
|
326
|
-
logger.error(`❌ ${so}
|
|
354
|
+
issues.push({ type: 'bundled-lib-missing', severity: 'error', msg: `${so} 未能解析(应捆绑在 lib/)` });
|
|
355
|
+
logger.error(`❌ ${so} 未解析(捆绑库加载失败)`);
|
|
327
356
|
} else if (!path.normalize(rp).startsWith(libDirNorm + path.sep)) {
|
|
328
|
-
|
|
329
|
-
|
|
357
|
+
bundledFromSystem++;
|
|
358
|
+
issues.push({ type: 'bundled-lib-system', severity: 'error', msg: `${so} 从系统加载:${rp}(应捆绑 ${libDir}),版本可能不匹配` });
|
|
359
|
+
logger.error(`❌ ${so} => ${rp}(非捆绑,可能版本不匹配)`);
|
|
330
360
|
} else {
|
|
331
361
|
logger.ok(`✓ ${so} => 捆绑 ${path.basename(rp)}`);
|
|
332
362
|
}
|
|
333
363
|
}
|
|
334
364
|
|
|
335
365
|
// D. 依赖解析统计(信息性)
|
|
336
|
-
logger.log(` 已解析依赖 ${Object.keys(resolved).length} 项,缺库 ${missing.length}
|
|
366
|
+
logger.log(` 已解析依赖 ${Object.keys(resolved).length} 项,缺库 ${missing.length} 项,捆绑库 ${bundledChecked} 项(其中从系统加载 ${bundledFromSystem} 项)`);
|
|
337
367
|
} catch (e) {
|
|
338
368
|
logger.warn(`⚠ ldd 检查失败(非 Linux 或权限问题):${e.message.split('\n')[0]}`);
|
|
339
369
|
}
|
package/src/paths.js
CHANGED
|
@@ -47,6 +47,8 @@ function loadNative() {
|
|
|
47
47
|
` 通常是 npm 镜像(npmmirror 等)没同步最新子包导致。请用官方源重装:\n` +
|
|
48
48
|
` npm install -g @oxiaom/adoremix@${mainVer} --registry https://registry.npmjs.org`
|
|
49
49
|
);
|
|
50
|
+
_loadError.code = 'NATIVE_VERSION_MISMATCH';
|
|
51
|
+
_loadError.mainVersion = mainVer;
|
|
50
52
|
throw _loadError;
|
|
51
53
|
}
|
|
52
54
|
} catch (e) {
|