1 line
20 KiB
JSON
1 line
20 KiB
JSON
{"ast":null,"code":"// Copyright 2017 Lovell Fuller and others.\n// SPDX-License-Identifier: Apache-2.0\n\n'use strict';\n\nconst childProcess = require('child_process');\nconst {\n isLinux,\n getReport\n} = require('./process');\nconst {\n LDD_PATH,\n readFile,\n readFileSync\n} = require('./filesystem');\nlet cachedFamilyFilesystem;\nlet cachedVersionFilesystem;\nconst command = 'getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true';\nlet commandOut = '';\nconst safeCommand = () => {\n if (!commandOut) {\n return new Promise(resolve => {\n childProcess.exec(command, (err, out) => {\n commandOut = err ? ' ' : out;\n resolve(commandOut);\n });\n });\n }\n return commandOut;\n};\nconst safeCommandSync = () => {\n if (!commandOut) {\n try {\n commandOut = childProcess.execSync(command, {\n encoding: 'utf8'\n });\n } catch (_err) {\n commandOut = ' ';\n }\n }\n return commandOut;\n};\n\n/**\n * A String constant containing the value `glibc`.\n * @type {string}\n * @public\n */\nconst GLIBC = 'glibc';\n\n/**\n * A Regexp constant to get the GLIBC Version.\n * @type {string}\n */\nconst RE_GLIBC_VERSION = /GLIBC\\s(\\d+\\.\\d+)/;\n\n/**\n * A String constant containing the value `musl`.\n * @type {string}\n * @public\n */\nconst MUSL = 'musl';\n\n/**\n * This string is used to find if the {@link LDD_PATH} is GLIBC\n * @type {string}\n */\nconst GLIBC_ON_LDD = GLIBC.toUpperCase();\n\n/**\n * This string is used to find if the {@link LDD_PATH} is musl\n * @type {string}\n */\nconst MUSL_ON_LDD = MUSL.toLowerCase();\nconst isFileMusl = f => f.includes('libc.musl-') || f.includes('ld-musl-');\nconst familyFromReport = () => {\n const report = getReport();\n if (report.header && report.header.glibcVersionRuntime) {\n return GLIBC;\n }\n if (Array.isArray(report.sharedObjects)) {\n if (report.sharedObjects.some(isFileMusl)) {\n return MUSL;\n }\n }\n return null;\n};\nconst familyFromCommand = out => {\n const [getconf, ldd1] = out.split(/[\\r\\n]+/);\n if (getconf && getconf.includes(GLIBC)) {\n return GLIBC;\n }\n if (ldd1 && ldd1.includes(MUSL)) {\n return MUSL;\n }\n return null;\n};\nconst getFamilyFromLddContent = content => {\n if (content.includes(MUSL_ON_LDD)) {\n return MUSL;\n }\n if (content.includes(GLIBC_ON_LDD)) {\n return GLIBC;\n }\n return null;\n};\nconst familyFromFilesystem = async () => {\n if (cachedFamilyFilesystem !== undefined) {\n return cachedFamilyFilesystem;\n }\n cachedFamilyFilesystem = null;\n try {\n const lddContent = await readFile(LDD_PATH);\n cachedFamilyFilesystem = getFamilyFromLddContent(lddContent);\n } catch (e) {}\n return cachedFamilyFilesystem;\n};\nconst familyFromFilesystemSync = () => {\n if (cachedFamilyFilesystem !== undefined) {\n return cachedFamilyFilesystem;\n }\n cachedFamilyFilesystem = null;\n try {\n const lddContent = readFileSync(LDD_PATH);\n cachedFamilyFilesystem = getFamilyFromLddContent(lddContent);\n } catch (e) {}\n return cachedFamilyFilesystem;\n};\n\n/**\n * Resolves with the libc family when it can be determined, `null` otherwise.\n * @returns {Promise<?string>}\n */\nconst family = async () => {\n let family = null;\n if (isLinux()) {\n family = await familyFromFilesystem();\n if (!family) {\n family = familyFromReport();\n }\n if (!family) {\n const out = await safeCommand();\n family = familyFromCommand(out);\n }\n }\n return family;\n};\n\n/**\n * Returns the libc family when it can be determined, `null` otherwise.\n * @returns {?string}\n */\nconst familySync = () => {\n let family = null;\n if (isLinux()) {\n family = familyFromFilesystemSync();\n if (!family) {\n family = familyFromReport();\n }\n if (!family) {\n const out = safeCommandSync();\n family = familyFromCommand(out);\n }\n }\n return family;\n};\n\n/**\n * Resolves `true` only when the platform is Linux and the libc family is not `glibc`.\n * @returns {Promise<boolean>}\n */\nconst isNonGlibcLinux = async () => isLinux() && (await family()) !== GLIBC;\n\n/**\n * Returns `true` only when the platform is Linux and the libc family is not `glibc`.\n * @returns {boolean}\n */\nconst isNonGlibcLinuxSync = () => isLinux() && familySync() !== GLIBC;\nconst versionFromFilesystem = async () => {\n if (cachedVersionFilesystem !== undefined) {\n return cachedVersionFilesystem;\n }\n cachedVersionFilesystem = null;\n try {\n const lddContent = await readFile(LDD_PATH);\n const versionMatch = lddContent.match(RE_GLIBC_VERSION);\n if (versionMatch) {\n cachedVersionFilesystem = versionMatch[1];\n }\n } catch (e) {}\n return cachedVersionFilesystem;\n};\nconst versionFromFilesystemSync = () => {\n if (cachedVersionFilesystem !== undefined) {\n return cachedVersionFilesystem;\n }\n cachedVersionFilesystem = null;\n try {\n const lddContent = readFileSync(LDD_PATH);\n const versionMatch = lddContent.match(RE_GLIBC_VERSION);\n if (versionMatch) {\n cachedVersionFilesystem = versionMatch[1];\n }\n } catch (e) {}\n return cachedVersionFilesystem;\n};\nconst versionFromReport = () => {\n const report = getReport();\n if (report.header && report.header.glibcVersionRuntime) {\n return report.header.glibcVersionRuntime;\n }\n return null;\n};\nconst versionSuffix = s => s.trim().split(/\\s+/)[1];\nconst versionFromCommand = out => {\n const [getconf, ldd1, ldd2] = out.split(/[\\r\\n]+/);\n if (getconf && getconf.includes(GLIBC)) {\n return versionSuffix(getconf);\n }\n if (ldd1 && ldd2 && ldd1.includes(MUSL)) {\n return versionSuffix(ldd2);\n }\n return null;\n};\n\n/**\n * Resolves with the libc version when it can be determined, `null` otherwise.\n * @returns {Promise<?string>}\n */\nconst version = async () => {\n let version = null;\n if (isLinux()) {\n version = await versionFromFilesystem();\n if (!version) {\n version = versionFromReport();\n }\n if (!version) {\n const out = await safeCommand();\n version = versionFromCommand(out);\n }\n }\n return version;\n};\n\n/**\n * Returns the libc version when it can be determined, `null` otherwise.\n * @returns {?string}\n */\nconst versionSync = () => {\n let version = null;\n if (isLinux()) {\n version = versionFromFilesystemSync();\n if (!version) {\n version = versionFromReport();\n }\n if (!version) {\n const out = safeCommandSync();\n version = versionFromCommand(out);\n }\n }\n return version;\n};\nmodule.exports = {\n GLIBC,\n MUSL,\n family,\n familySync,\n isNonGlibcLinux,\n isNonGlibcLinuxSync,\n version,\n versionSync\n};","map":{"version":3,"names":["childProcess","require","isLinux","getReport","LDD_PATH","readFile","readFileSync","cachedFamilyFilesystem","cachedVersionFilesystem","command","commandOut","safeCommand","Promise","resolve","exec","err","out","safeCommandSync","execSync","encoding","_err","GLIBC","RE_GLIBC_VERSION","MUSL","GLIBC_ON_LDD","toUpperCase","MUSL_ON_LDD","toLowerCase","isFileMusl","f","includes","familyFromReport","report","header","glibcVersionRuntime","Array","isArray","sharedObjects","some","familyFromCommand","getconf","ldd1","split","getFamilyFromLddContent","content","familyFromFilesystem","undefined","lddContent","e","familyFromFilesystemSync","family","familySync","isNonGlibcLinux","isNonGlibcLinuxSync","versionFromFilesystem","versionMatch","match","versionFromFilesystemSync","versionFromReport","versionSuffix","s","trim","versionFromCommand","ldd2","version","versionSync","module","exports"],"sources":["/Users/shoofle/Projects/the-forest/node_modules/detect-libc/lib/detect-libc.js"],"sourcesContent":["// Copyright 2017 Lovell Fuller and others.\n// SPDX-License-Identifier: Apache-2.0\n\n'use strict';\n\nconst childProcess = require('child_process');\nconst { isLinux, getReport } = require('./process');\nconst { LDD_PATH, readFile, readFileSync } = require('./filesystem');\n\nlet cachedFamilyFilesystem;\nlet cachedVersionFilesystem;\n\nconst command = 'getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true';\nlet commandOut = '';\n\nconst safeCommand = () => {\n if (!commandOut) {\n return new Promise((resolve) => {\n childProcess.exec(command, (err, out) => {\n commandOut = err ? ' ' : out;\n resolve(commandOut);\n });\n });\n }\n return commandOut;\n};\n\nconst safeCommandSync = () => {\n if (!commandOut) {\n try {\n commandOut = childProcess.execSync(command, { encoding: 'utf8' });\n } catch (_err) {\n commandOut = ' ';\n }\n }\n return commandOut;\n};\n\n/**\n * A String constant containing the value `glibc`.\n * @type {string}\n * @public\n */\nconst GLIBC = 'glibc';\n\n/**\n * A Regexp constant to get the GLIBC Version.\n * @type {string}\n */\nconst RE_GLIBC_VERSION = /GLIBC\\s(\\d+\\.\\d+)/;\n\n/**\n * A String constant containing the value `musl`.\n * @type {string}\n * @public\n */\nconst MUSL = 'musl';\n\n/**\n * This string is used to find if the {@link LDD_PATH} is GLIBC\n * @type {string}\n */\nconst GLIBC_ON_LDD = GLIBC.toUpperCase();\n\n/**\n * This string is used to find if the {@link LDD_PATH} is musl\n * @type {string}\n */\nconst MUSL_ON_LDD = MUSL.toLowerCase();\n\nconst isFileMusl = (f) => f.includes('libc.musl-') || f.includes('ld-musl-');\n\nconst familyFromReport = () => {\n const report = getReport();\n if (report.header && report.header.glibcVersionRuntime) {\n return GLIBC;\n }\n if (Array.isArray(report.sharedObjects)) {\n if (report.sharedObjects.some(isFileMusl)) {\n return MUSL;\n }\n }\n return null;\n};\n\nconst familyFromCommand = (out) => {\n const [getconf, ldd1] = out.split(/[\\r\\n]+/);\n if (getconf && getconf.includes(GLIBC)) {\n return GLIBC;\n }\n if (ldd1 && ldd1.includes(MUSL)) {\n return MUSL;\n }\n return null;\n};\n\nconst getFamilyFromLddContent = (content) => {\n if (content.includes(MUSL_ON_LDD)) {\n return MUSL;\n }\n if (content.includes(GLIBC_ON_LDD)) {\n return GLIBC;\n }\n return null;\n};\n\nconst familyFromFilesystem = async () => {\n if (cachedFamilyFilesystem !== undefined) {\n return cachedFamilyFilesystem;\n }\n cachedFamilyFilesystem = null;\n try {\n const lddContent = await readFile(LDD_PATH);\n cachedFamilyFilesystem = getFamilyFromLddContent(lddContent);\n } catch (e) {}\n return cachedFamilyFilesystem;\n};\n\nconst familyFromFilesystemSync = () => {\n if (cachedFamilyFilesystem !== undefined) {\n return cachedFamilyFilesystem;\n }\n cachedFamilyFilesystem = null;\n try {\n const lddContent = readFileSync(LDD_PATH);\n cachedFamilyFilesystem = getFamilyFromLddContent(lddContent);\n } catch (e) {}\n return cachedFamilyFilesystem;\n};\n\n/**\n * Resolves with the libc family when it can be determined, `null` otherwise.\n * @returns {Promise<?string>}\n */\nconst family = async () => {\n let family = null;\n if (isLinux()) {\n family = await familyFromFilesystem();\n if (!family) {\n family = familyFromReport();\n }\n if (!family) {\n const out = await safeCommand();\n family = familyFromCommand(out);\n }\n }\n return family;\n};\n\n/**\n * Returns the libc family when it can be determined, `null` otherwise.\n * @returns {?string}\n */\nconst familySync = () => {\n let family = null;\n if (isLinux()) {\n family = familyFromFilesystemSync();\n if (!family) {\n family = familyFromReport();\n }\n if (!family) {\n const out = safeCommandSync();\n family = familyFromCommand(out);\n }\n }\n return family;\n};\n\n/**\n * Resolves `true` only when the platform is Linux and the libc family is not `glibc`.\n * @returns {Promise<boolean>}\n */\nconst isNonGlibcLinux = async () => isLinux() && await family() !== GLIBC;\n\n/**\n * Returns `true` only when the platform is Linux and the libc family is not `glibc`.\n * @returns {boolean}\n */\nconst isNonGlibcLinuxSync = () => isLinux() && familySync() !== GLIBC;\n\nconst versionFromFilesystem = async () => {\n if (cachedVersionFilesystem !== undefined) {\n return cachedVersionFilesystem;\n }\n cachedVersionFilesystem = null;\n try {\n const lddContent = await readFile(LDD_PATH);\n const versionMatch = lddContent.match(RE_GLIBC_VERSION);\n if (versionMatch) {\n cachedVersionFilesystem = versionMatch[1];\n }\n } catch (e) {}\n return cachedVersionFilesystem;\n};\n\nconst versionFromFilesystemSync = () => {\n if (cachedVersionFilesystem !== undefined) {\n return cachedVersionFilesystem;\n }\n cachedVersionFilesystem = null;\n try {\n const lddContent = readFileSync(LDD_PATH);\n const versionMatch = lddContent.match(RE_GLIBC_VERSION);\n if (versionMatch) {\n cachedVersionFilesystem = versionMatch[1];\n }\n } catch (e) {}\n return cachedVersionFilesystem;\n};\n\nconst versionFromReport = () => {\n const report = getReport();\n if (report.header && report.header.glibcVersionRuntime) {\n return report.header.glibcVersionRuntime;\n }\n return null;\n};\n\nconst versionSuffix = (s) => s.trim().split(/\\s+/)[1];\n\nconst versionFromCommand = (out) => {\n const [getconf, ldd1, ldd2] = out.split(/[\\r\\n]+/);\n if (getconf && getconf.includes(GLIBC)) {\n return versionSuffix(getconf);\n }\n if (ldd1 && ldd2 && ldd1.includes(MUSL)) {\n return versionSuffix(ldd2);\n }\n return null;\n};\n\n/**\n * Resolves with the libc version when it can be determined, `null` otherwise.\n * @returns {Promise<?string>}\n */\nconst version = async () => {\n let version = null;\n if (isLinux()) {\n version = await versionFromFilesystem();\n if (!version) {\n version = versionFromReport();\n }\n if (!version) {\n const out = await safeCommand();\n version = versionFromCommand(out);\n }\n }\n return version;\n};\n\n/**\n * Returns the libc version when it can be determined, `null` otherwise.\n * @returns {?string}\n */\nconst versionSync = () => {\n let version = null;\n if (isLinux()) {\n version = versionFromFilesystemSync();\n if (!version) {\n version = versionFromReport();\n }\n if (!version) {\n const out = safeCommandSync();\n version = versionFromCommand(out);\n }\n }\n return version;\n};\n\nmodule.exports = {\n GLIBC,\n MUSL,\n family,\n familySync,\n isNonGlibcLinux,\n isNonGlibcLinuxSync,\n version,\n versionSync\n};\n"],"mappings":"AAAA;AACA;;AAEA,YAAY;;AAEZ,MAAMA,YAAY,GAAGC,OAAO,CAAC,eAAe,CAAC;AAC7C,MAAM;EAAEC,OAAO;EAAEC;AAAU,CAAC,GAAGF,OAAO,CAAC,WAAW,CAAC;AACnD,MAAM;EAAEG,QAAQ;EAAEC,QAAQ;EAAEC;AAAa,CAAC,GAAGL,OAAO,CAAC,cAAc,CAAC;AAEpE,IAAIM,sBAAsB;AAC1B,IAAIC,uBAAuB;AAE3B,MAAMC,OAAO,GAAG,mEAAmE;AACnF,IAAIC,UAAU,GAAG,EAAE;AAEnB,MAAMC,WAAW,GAAGA,CAAA,KAAM;EACxB,IAAI,CAACD,UAAU,EAAE;IACf,OAAO,IAAIE,OAAO,CAAEC,OAAO,IAAK;MAC9Bb,YAAY,CAACc,IAAI,CAACL,OAAO,EAAE,CAACM,GAAG,EAAEC,GAAG,KAAK;QACvCN,UAAU,GAAGK,GAAG,GAAG,GAAG,GAAGC,GAAG;QAC5BH,OAAO,CAACH,UAAU,CAAC;MACrB,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ;EACA,OAAOA,UAAU;AACnB,CA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