UEA-PRODEM

This commit is contained in:
2026-06-10 12:14:46 -03:00
parent f54126b9d8
commit 9947565694
5319 changed files with 148520 additions and 129332 deletions
+43 -8
View File
@@ -1,21 +1,56 @@
const { existsSync } = require('node:fs');
const path = require('node:path');
const { platform, arch, report } = require('node:process');
const { spawnSync } = require('node:child_process');
const isMusl = () => {
const getReportHeader = () => {
try {
return !report.getReport().header.glibcVersionRuntime;
if (platform !== 'win32') {
// Avoid blocking reverse DNS (PTR) lookups on open TCP socket handles.
// See: https://github.com/nodejs/node/issues/55576
const previousExcludeNetwork = report.excludeNetwork;
report.excludeNetwork = true;
const header = report.getReport().header;
report.excludeNetwork = previousExcludeNetwork;
return header;
}
// This is needed because report.getReport() crashes the process on Windows sometimes.
const script =
"const r=require('node:process').report;r.excludeNetwork=true;console.log(JSON.stringify(r.getReport().header));";
const child = spawnSync(process.execPath, ['-p', script], {
encoding: 'utf8',
timeout: 3000,
windowsHide: true
});
if (child.status !== 0) {
return null;
}
// The output from node -p might include a trailing 'undefined' and newline
const stdout = child.stdout?.replace(/undefined\r?\n?$/, '').trim();
if (!stdout) {
return null;
}
return JSON.parse(stdout);
} catch {
return false;
return null;
}
};
let reportHeader;
const isMingw32 = () => {
try {
return report.getReport().header.osName.startsWith('MINGW32_NT');
} catch {
return false;
}
reportHeader ??= getReportHeader();
return reportHeader?.osName?.startsWith('MINGW32_NT') ?? false;
};
const isMusl = () => {
reportHeader ??= getReportHeader();
return reportHeader ? !reportHeader.glibcVersionRuntime : false;
};
const bindingsByPlatformAndArch = {