mirror of https://github.com/aminya/setup-cpp
fix: update dependencies
This commit is contained in:
parent
5f27dd008e
commit
f0d23edbf1
|
@ -19,7 +19,7 @@ async function main() {
|
||||||
|
|
||||||
// write the new file in dev/docker/__tests__
|
// write the new file in dev/docker/__tests__
|
||||||
await writeFile(`./dev/docker/__tests__/${dockerFile}.dockerfile`, newDockerFileContent)
|
await writeFile(`./dev/docker/__tests__/${dockerFile}.dockerfile`, newDockerFileContent)
|
||||||
})
|
}),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,8 +35,8 @@ function main() {
|
||||||
"--",
|
"--",
|
||||||
`{{caxa}}/node_modules/.bin/node${exe}`,
|
`{{caxa}}/node_modules/.bin/node${exe}`,
|
||||||
`{{caxa}}/setup-cpp.js`,
|
`{{caxa}}/setup-cpp.js`,
|
||||||
])
|
]),
|
||||||
)
|
),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
14
package.json
14
package.json
|
@ -80,7 +80,7 @@
|
||||||
"@types/eslint": "^8.44.0",
|
"@types/eslint": "^8.44.0",
|
||||||
"@types/jest": "^29.5.3",
|
"@types/jest": "^29.5.3",
|
||||||
"@types/mri": "^1.1.1",
|
"@types/mri": "^1.1.1",
|
||||||
"@types/node": "^20.4.2",
|
"@types/node": "^20.4.4",
|
||||||
"@types/npmcli__ci-detect": "^2.0.0",
|
"@types/npmcli__ci-detect": "^2.0.0",
|
||||||
"@types/prettier": "2.7.3",
|
"@types/prettier": "2.7.3",
|
||||||
"@types/semver": "^7.5.0",
|
"@types/semver": "^7.5.0",
|
||||||
|
@ -92,7 +92,7 @@
|
||||||
"ci-log": "workspace:*",
|
"ci-log": "workspace:*",
|
||||||
"cross-env": "7.0.3",
|
"cross-env": "7.0.3",
|
||||||
"cross-spawn": "^7.0.3",
|
"cross-spawn": "^7.0.3",
|
||||||
"cspell": "^6.31.1",
|
"cspell": "^6.31.2",
|
||||||
"escape-path-with-spaces": "^1.0.2",
|
"escape-path-with-spaces": "^1.0.2",
|
||||||
"escape-quotes": "^1.0.2",
|
"escape-quotes": "^1.0.2",
|
||||||
"escape-string-regexp": "^5.0.0",
|
"escape-string-regexp": "^5.0.0",
|
||||||
|
@ -100,7 +100,7 @@
|
||||||
"eslint-config-atomic": "^1.19.3",
|
"eslint-config-atomic": "^1.19.3",
|
||||||
"exec-powershell": "workspace:*",
|
"exec-powershell": "workspace:*",
|
||||||
"execa": "^7.1.1",
|
"execa": "^7.1.1",
|
||||||
"fast-glob": "^3.3.0",
|
"fast-glob": "^3.3.1",
|
||||||
"find-up": "^6.3.0",
|
"find-up": "^6.3.0",
|
||||||
"gen-readme": "^1.6.0",
|
"gen-readme": "^1.6.0",
|
||||||
"is-url-online": "^1.5.0",
|
"is-url-online": "^1.5.0",
|
||||||
|
@ -108,19 +108,19 @@
|
||||||
"micro-memoize": "^4.1.2",
|
"micro-memoize": "^4.1.2",
|
||||||
"mri": "^1.2.0",
|
"mri": "^1.2.0",
|
||||||
"msvc-dev-cmd": "github:aminya/msvc-dev-cmd#9f672c1",
|
"msvc-dev-cmd": "github:aminya/msvc-dev-cmd#9f672c1",
|
||||||
"npm-check-updates": "^16.10.15",
|
"npm-check-updates": "^16.10.16",
|
||||||
"npm-run-all2": "^6.0.6",
|
"npm-run-all2": "^6.0.6",
|
||||||
"numerous": "1.0.3",
|
"numerous": "1.0.3",
|
||||||
"parcel": "2.9.3",
|
"parcel": "2.9.3",
|
||||||
"path-exists": "^5.0.0",
|
"path-exists": "^5.0.0",
|
||||||
"patha": "^0.4.1",
|
"patha": "^0.4.1",
|
||||||
"prettier": "2.8.8",
|
"prettier": "3.0.0",
|
||||||
"prettier-config-atomic": "^3.1.0",
|
"prettier-config-atomic": "^3.1.0",
|
||||||
"quote-unquote": "^1.0.0",
|
"quote-unquote": "^1.0.0",
|
||||||
"readme-md-generator": "^1.0.0",
|
"readme-md-generator": "^1.0.0",
|
||||||
"retry-as-promised": "^7.0.4",
|
"retry-as-promised": "^7.0.4",
|
||||||
"semver": "7.5.3",
|
"semver": "7.5.4",
|
||||||
"setup-python": "github:actions/setup-python#v4.6.1",
|
"setup-python": "github:actions/setup-python#v4.7.0",
|
||||||
"shx": "0.3.4",
|
"shx": "0.3.4",
|
||||||
"simple-update-notifier": "^2.0.0",
|
"simple-update-notifier": "^2.0.0",
|
||||||
"time-delta": "github:aminya/time-delta#69d91a41cef28e569be9a2991129f5f7d1f0d00e",
|
"time-delta": "github:aminya/time-delta#69d91a41cef28e569be9a2991129f5f7d1f0d00e",
|
||||||
|
|
|
@ -17,7 +17,7 @@ let powershell: string | undefined
|
||||||
export function execPowershell(
|
export function execPowershell(
|
||||||
command: string,
|
command: string,
|
||||||
startupFlags: string[] = ["-NoProfile", "-NoLogo", "-NonInteractive"],
|
startupFlags: string[] = ["-NoProfile", "-NoLogo", "-NonInteractive"],
|
||||||
execOptions: execa.Options = { stdio: "inherit" }
|
execOptions: execa.Options = { stdio: "inherit" },
|
||||||
): execa.ExecaChildProcess<string> {
|
): execa.ExecaChildProcess<string> {
|
||||||
return execa.execa(getPowerShell(), [...startupFlags, "-c", command], execOptions)
|
return execa.execa(getPowerShell(), [...startupFlags, "-c", command], execOptions)
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@ export function execPowershell(
|
||||||
export function execPowershellSync(
|
export function execPowershellSync(
|
||||||
command: string,
|
command: string,
|
||||||
startupFlags: string[] = ["-NoProfile", "-NoLogo", "-NonInteractive"],
|
startupFlags: string[] = ["-NoProfile", "-NoLogo", "-NonInteractive"],
|
||||||
execOptions: execa.SyncOptions = { stdio: "inherit" }
|
execOptions: execa.SyncOptions = { stdio: "inherit" },
|
||||||
): execa.ExecaSyncReturnValue<string> {
|
): execa.ExecaSyncReturnValue<string> {
|
||||||
return execa.execaSync(getPowerShell(), [...startupFlags, "-c", command], execOptions)
|
return execa.execaSync(getPowerShell(), [...startupFlags, "-c", command], execOptions)
|
||||||
}
|
}
|
||||||
|
|
554
pnpm-lock.yaml
554
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
|
@ -30,7 +30,7 @@ export async function setupBazel(version: string, _setupDir: string, _arch: stri
|
||||||
// https://bazel.build/install/ubuntu
|
// https://bazel.build/install/ubuntu
|
||||||
const keyFileName = await addAptKeyViaDownload(
|
const keyFileName = await addAptKeyViaDownload(
|
||||||
"bazel-archive-keyring.gpg",
|
"bazel-archive-keyring.gpg",
|
||||||
"https://bazel.build/bazel-release.pub.gpg"
|
"https://bazel.build/bazel-release.pub.gpg",
|
||||||
)
|
)
|
||||||
execRootSync("bash", [
|
execRootSync("bash", [
|
||||||
"-c",
|
"-c",
|
||||||
|
|
|
@ -14,7 +14,7 @@ export async function setupChocolatey(
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
_setupDir: string,
|
_setupDir: string,
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
_arch: string
|
_arch: string,
|
||||||
): Promise<InstallationInfo | undefined> {
|
): Promise<InstallationInfo | undefined> {
|
||||||
if (process.platform !== "win32") {
|
if (process.platform !== "win32") {
|
||||||
return undefined
|
return undefined
|
||||||
|
@ -50,7 +50,7 @@ export async function setupChocolatey(
|
||||||
"-Command",
|
"-Command",
|
||||||
"[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))",
|
"[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))",
|
||||||
],
|
],
|
||||||
{ stdio: "inherit" }
|
{ stdio: "inherit" },
|
||||||
)
|
)
|
||||||
|
|
||||||
const chocoPath = `${process.env.ALLUSERSPROFILE}\\chocolatey\\bin`
|
const chocoPath = `${process.env.ALLUSERSPROFILE}\\chocolatey\\bin`
|
||||||
|
|
|
@ -39,7 +39,7 @@ All the available tools:
|
||||||
coverage: { tools: `--gcovr, --opencppcoverage, --kcov` },
|
coverage: { tools: `--gcovr, --opencppcoverage, --kcov` },
|
||||||
other: { tools: `--python, --powershell, --sevenzip` },
|
other: { tools: `--python, --powershell, --sevenzip` },
|
||||||
},
|
},
|
||||||
["tools"]
|
["tools"],
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
/** Get an object from github actions */
|
/** Get an object from github actions */
|
||||||
|
|
|
@ -34,7 +34,7 @@ export async function installCompiler(
|
||||||
arch: string,
|
arch: string,
|
||||||
successMessages: string[],
|
successMessages: string[],
|
||||||
hasLLVM: boolean,
|
hasLLVM: boolean,
|
||||||
errorMessages: string[]
|
errorMessages: string[],
|
||||||
) {
|
) {
|
||||||
try {
|
try {
|
||||||
const { compiler, version } = getCompilerInfo(compilerAndVersion)
|
const { compiler, version } = getCompilerInfo(compilerAndVersion)
|
||||||
|
@ -48,7 +48,7 @@ export async function installCompiler(
|
||||||
const installationInfo = await setupLLVM(
|
const installationInfo = await setupLLVM(
|
||||||
getVersion("llvm", version, osVersion),
|
getVersion("llvm", version, osVersion),
|
||||||
join(setupCppDir, "llvm"),
|
join(setupCppDir, "llvm"),
|
||||||
arch
|
arch,
|
||||||
)
|
)
|
||||||
|
|
||||||
await activateGcovLLVM()
|
await activateGcovLLVM()
|
||||||
|
@ -87,7 +87,7 @@ export async function installCompiler(
|
||||||
const installationInfo = await setupMSVC(
|
const installationInfo = await setupMSVC(
|
||||||
getVersion("msvc", version, osVersion),
|
getVersion("msvc", version, osVersion),
|
||||||
join(setupCppDir, "msvc"),
|
join(setupCppDir, "msvc"),
|
||||||
arch
|
arch,
|
||||||
)
|
)
|
||||||
|
|
||||||
if (hasLLVM) {
|
if (hasLLVM) {
|
||||||
|
|
|
@ -16,7 +16,7 @@ describe("setup-doxygen", () => {
|
||||||
const installInfo = await setupDoxygen(
|
const installInfo = await setupDoxygen(
|
||||||
getVersion("doxygen", undefined, await ubuntuVersion()),
|
getVersion("doxygen", undefined, await ubuntuVersion()),
|
||||||
directory,
|
directory,
|
||||||
process.arch
|
process.arch,
|
||||||
)
|
)
|
||||||
|
|
||||||
await testBin("doxygen", ["--version"], (installInfo as InstallationInfo | undefined)?.binDir)
|
await testBin("doxygen", ["--version"], (installInfo as InstallationInfo | undefined)?.binDir)
|
||||||
|
|
|
@ -55,7 +55,7 @@ export async function setupDoxygen(version: string, setupDir: string, arch: stri
|
||||||
() => {
|
() => {
|
||||||
return setupChocoPack("doxygen.install", version)
|
return setupChocoPack("doxygen.install", version)
|
||||||
},
|
},
|
||||||
{ name: "doxygen.install", max: 4, backoffBase: 2000, report: (err) => info(err) }
|
{ name: "doxygen.install", max: 4, backoffBase: 2000, report: (err) => info(err) },
|
||||||
)
|
)
|
||||||
const binDir = await activateWinDoxygen()
|
const binDir = await activateWinDoxygen()
|
||||||
const installationInfo = { binDir }
|
const installationInfo = { binDir }
|
||||||
|
|
|
@ -222,7 +222,7 @@ async function activateGcc(version: string, binDir: string) {
|
||||||
updateAptAlternatives("cc", `${binDir}/gcc-${majorVersion}`),
|
updateAptAlternatives("cc", `${binDir}/gcc-${majorVersion}`),
|
||||||
updateAptAlternatives("cxx", `${binDir}/g++-${majorVersion}`),
|
updateAptAlternatives("cxx", `${binDir}/g++-${majorVersion}`),
|
||||||
updateAptAlternatives("gcc", `${binDir}/gcc-${majorVersion}`),
|
updateAptAlternatives("gcc", `${binDir}/gcc-${majorVersion}`),
|
||||||
updateAptAlternatives("g++", `${binDir}/g++-${majorVersion}`)
|
updateAptAlternatives("g++", `${binDir}/g++-${majorVersion}`),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -233,7 +233,7 @@ async function activateGcc(version: string, binDir: string) {
|
||||||
updateAptAlternatives("cc", `${binDir}/gcc-${version}`),
|
updateAptAlternatives("cc", `${binDir}/gcc-${version}`),
|
||||||
updateAptAlternatives("cxx", `${binDir}/g++-${version}`),
|
updateAptAlternatives("cxx", `${binDir}/g++-${version}`),
|
||||||
updateAptAlternatives("gcc", `${binDir}/gcc-${version}`),
|
updateAptAlternatives("gcc", `${binDir}/gcc-${version}`),
|
||||||
updateAptAlternatives("g++", `${binDir}/g++-${version}`)
|
updateAptAlternatives("g++", `${binDir}/g++-${version}`),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@ describe("setup-graphviz", () => {
|
||||||
const installInfo = await setupGraphviz(
|
const installInfo = await setupGraphviz(
|
||||||
getVersion("graphviz", undefined, await ubuntuVersion()),
|
getVersion("graphviz", undefined, await ubuntuVersion()),
|
||||||
directory,
|
directory,
|
||||||
process.arch
|
process.arch,
|
||||||
)
|
)
|
||||||
|
|
||||||
await testBin("dot", ["-V"], (installInfo as InstallationInfo | undefined)?.binDir)
|
await testBin("dot", ["-V"], (installInfo as InstallationInfo | undefined)?.binDir)
|
||||||
|
|
|
@ -82,7 +82,7 @@ async function getCmake() {
|
||||||
const { binDir } = await setupCmake(
|
const { binDir } = await setupCmake(
|
||||||
getVersion("cmake", undefined, await ubuntuVersion()),
|
getVersion("cmake", undefined, await ubuntuVersion()),
|
||||||
join(untildifyUser(""), "cmake"),
|
join(untildifyUser(""), "cmake"),
|
||||||
""
|
"",
|
||||||
)
|
)
|
||||||
cmake = join(binDir, "cmake")
|
cmake = join(binDir, "cmake")
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,24 +29,24 @@ describe("setup-llvm", () => {
|
||||||
it("Finds URL for ubuntu version", async () => {
|
it("Finds URL for ubuntu version", async () => {
|
||||||
expect(
|
expect(
|
||||||
await getSpecificVersionAndUrl(VERSIONS, "linux", "13.0.0-ubuntu-16.04", (_plantform, version) =>
|
await getSpecificVersionAndUrl(VERSIONS, "linux", "13.0.0-ubuntu-16.04", (_plantform, version) =>
|
||||||
getLinuxUrl(version)
|
getLinuxUrl(version),
|
||||||
)
|
),
|
||||||
).toStrictEqual([
|
).toStrictEqual([
|
||||||
"13.0.0-ubuntu-16.04",
|
"13.0.0-ubuntu-16.04",
|
||||||
"https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz",
|
"https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz",
|
||||||
])
|
])
|
||||||
expect(
|
expect(
|
||||||
await getSpecificVersionAndUrl(VERSIONS, "linux", "13.0.1-ubuntu-18.04", (_plantform, version) =>
|
await getSpecificVersionAndUrl(VERSIONS, "linux", "13.0.1-ubuntu-18.04", (_plantform, version) =>
|
||||||
getLinuxUrl(version)
|
getLinuxUrl(version),
|
||||||
)
|
),
|
||||||
).toStrictEqual([
|
).toStrictEqual([
|
||||||
"13.0.1-ubuntu-18.04",
|
"13.0.1-ubuntu-18.04",
|
||||||
"https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.1/clang+llvm-13.0.1-x86_64-linux-gnu-ubuntu-18.04.tar.xz",
|
"https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.1/clang+llvm-13.0.1-x86_64-linux-gnu-ubuntu-18.04.tar.xz",
|
||||||
])
|
])
|
||||||
expect(
|
expect(
|
||||||
await getSpecificVersionAndUrl(VERSIONS, "linux", "13.0.0-ubuntu-20.04", (_plantform, version) =>
|
await getSpecificVersionAndUrl(VERSIONS, "linux", "13.0.0-ubuntu-20.04", (_plantform, version) =>
|
||||||
getLinuxUrl(version)
|
getLinuxUrl(version),
|
||||||
)
|
),
|
||||||
).toStrictEqual([
|
).toStrictEqual([
|
||||||
"13.0.0-ubuntu-20.04",
|
"13.0.0-ubuntu-20.04",
|
||||||
"https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-20.04.tar.xz",
|
"https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-20.04.tar.xz",
|
||||||
|
@ -77,7 +77,7 @@ describe("setup-llvm", () => {
|
||||||
"5",
|
"5",
|
||||||
"5.0.0",
|
"5.0.0",
|
||||||
"4",
|
"4",
|
||||||
].map((version) => testUrl(version))
|
].map((version) => testUrl(version)),
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -115,7 +115,7 @@ export async function activateLLVM(directory: string) {
|
||||||
updateAptAlternatives("clang++", `${directory}/bin/clang++`),
|
updateAptAlternatives("clang++", `${directory}/bin/clang++`),
|
||||||
updateAptAlternatives("lld", `${directory}/bin/lld`),
|
updateAptAlternatives("lld", `${directory}/bin/lld`),
|
||||||
updateAptAlternatives("ld.lld", `${directory}/bin/ld.lld`),
|
updateAptAlternatives("ld.lld", `${directory}/bin/ld.lld`),
|
||||||
updateAptAlternatives("llvm-ar", `${directory}/bin/llvm-ar`)
|
updateAptAlternatives("llvm-ar", `${directory}/bin/llvm-ar`),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ function nonInteractiveScript(givenScript: string) {
|
||||||
return givenScript.replace(
|
return givenScript.replace(
|
||||||
/add-apt-repository "\${REPO_NAME}"/g,
|
/add-apt-repository "\${REPO_NAME}"/g,
|
||||||
// eslint-disable-next-line no-template-curly-in-string
|
// eslint-disable-next-line no-template-curly-in-string
|
||||||
'add-apt-repository -y "${REPO_NAME}"'
|
'add-apt-repository -y "${REPO_NAME}"',
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ async function removeConflictingPAckages(givenScript: string) {
|
||||||
// fix conflicts between libclang-rt and libclang
|
// fix conflicts between libclang-rt and libclang
|
||||||
let script = givenScript.replace(
|
let script = givenScript.replace(
|
||||||
/apt-get install -y/g,
|
/apt-get install -y/g,
|
||||||
'apt-get install -o Dpkg::Options::="--force-overwrite" -y --fix-broken'
|
'apt-get install -o Dpkg::Options::="--force-overwrite" -y --fix-broken',
|
||||||
)
|
)
|
||||||
|
|
||||||
// check if these are installed and if so, remove them from the script as they conflict
|
// check if these are installed and if so, remove them from the script as they conflict
|
||||||
|
@ -67,7 +67,7 @@ async function removeConflictingPAckages(givenScript: string) {
|
||||||
info(`Removing conflicting package ${installingPack}`)
|
info(`Removing conflicting package ${installingPack}`)
|
||||||
script = script.replace(pack, "")
|
script = script.replace(pack, "")
|
||||||
}
|
}
|
||||||
})
|
}),
|
||||||
)
|
)
|
||||||
return script
|
return script
|
||||||
}
|
}
|
||||||
|
|
|
@ -286,7 +286,7 @@ export async function getLLVMPackageInfo(
|
||||||
version: string,
|
version: string,
|
||||||
platform: NodeJS.Platform,
|
platform: NodeJS.Platform,
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
_arch: string
|
_arch: string,
|
||||||
): Promise<PackageInfo> {
|
): Promise<PackageInfo> {
|
||||||
const [specificVersion, url] = await getSpecificVersionAndUrl(VERSIONS, platform, version, getUrl)
|
const [specificVersion, url] = await getSpecificVersionAndUrl(VERSIONS, platform, version, getUrl)
|
||||||
info(`specific llvm version: ${specificVersion}`)
|
info(`specific llvm version: ${specificVersion}`)
|
||||||
|
|
|
@ -17,7 +17,7 @@ export async function setupMSVC(
|
||||||
arch: string,
|
arch: string,
|
||||||
sdk?: string,
|
sdk?: string,
|
||||||
uwp?: boolean,
|
uwp?: boolean,
|
||||||
spectre?: boolean
|
spectre?: boolean,
|
||||||
) {
|
) {
|
||||||
if (process.platform !== "win32") {
|
if (process.platform !== "win32") {
|
||||||
return
|
return
|
||||||
|
|
|
@ -24,7 +24,7 @@ export async function setupNala(version: string, _setupDir: string, _arch: strin
|
||||||
// https://github.com/volitank/nala#-installation
|
// https://github.com/volitank/nala#-installation
|
||||||
const keyFileName = await addAptKeyViaDownload(
|
const keyFileName = await addAptKeyViaDownload(
|
||||||
"volian-archive-scar-unstable.gpg",
|
"volian-archive-scar-unstable.gpg",
|
||||||
"https://deb.volian.org/volian/scar.key"
|
"https://deb.volian.org/volian/scar.key",
|
||||||
)
|
)
|
||||||
execRootSync("/bin/bash", [
|
execRootSync("/bin/bash", [
|
||||||
"-c",
|
"-c",
|
||||||
|
|
|
@ -38,7 +38,7 @@ export async function installTool(
|
||||||
arch: string,
|
arch: string,
|
||||||
setupCppDir: string,
|
setupCppDir: string,
|
||||||
successMessages: string[],
|
successMessages: string[],
|
||||||
errorMessages: string[]
|
errorMessages: string[],
|
||||||
) {
|
) {
|
||||||
startGroup(`Installing ${tool} ${version}`)
|
startGroup(`Installing ${tool} ${version}`)
|
||||||
let hasLLVM = false
|
let hasLLVM = false
|
||||||
|
|
|
@ -30,7 +30,7 @@ const defaultAddEnvOptions: AddEnvOptions = {
|
||||||
export async function addEnv(
|
export async function addEnv(
|
||||||
name: string,
|
name: string,
|
||||||
valGiven: string | undefined,
|
valGiven: string | undefined,
|
||||||
options: AddEnvOptions = defaultAddEnvOptions
|
options: AddEnvOptions = defaultAddEnvOptions,
|
||||||
) {
|
) {
|
||||||
const val = escapeString(valGiven ?? "", options.shouldEscapeSpace)
|
const val = escapeString(valGiven ?? "", options.shouldEscapeSpace)
|
||||||
try {
|
try {
|
||||||
|
@ -126,7 +126,7 @@ async function addPathSystem(path: string) {
|
||||||
case "win32": {
|
case "win32": {
|
||||||
// We do not use `execaSync(`setx PATH "${path};%PATH%"`)` because of its character limit and also because %PATH% is different for user and system
|
// We do not use `execaSync(`setx PATH "${path};%PATH%"`)` because of its character limit and also because %PATH% is different for user and system
|
||||||
await execPowershell(
|
await execPowershell(
|
||||||
`$USER_PATH=([Environment]::GetEnvironmentVariable("PATH", "User")); [Environment]::SetEnvironmentVariable("PATH", "${path};$USER_PATH", "User")`
|
`$USER_PATH=([Environment]::GetEnvironmentVariable("PATH", "User")); [Environment]::SetEnvironmentVariable("PATH", "${path};$USER_PATH", "User")`,
|
||||||
)
|
)
|
||||||
info(`"${path}" was added to the PATH.`)
|
info(`"${path}" was added to the PATH.`)
|
||||||
return
|
return
|
||||||
|
|
|
@ -169,7 +169,7 @@ async function initApt(apt: string) {
|
||||||
// enable utf8 otherwise it fails because of the usage of ASCII encoding
|
// enable utf8 otherwise it fails because of the usage of ASCII encoding
|
||||||
promises.push(
|
promises.push(
|
||||||
addEnv("LANG", "C.UTF-8", { shouldAddOnlyIfNotDefined: true }),
|
addEnv("LANG", "C.UTF-8", { shouldAddOnlyIfNotDefined: true }),
|
||||||
addEnv("LC_ALL", "C.UTF-8", { shouldAddOnlyIfNotDefined: true })
|
addEnv("LC_ALL", "C.UTF-8", { shouldAddOnlyIfNotDefined: true }),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
await Promise.all(promises)
|
await Promise.all(promises)
|
||||||
|
@ -197,7 +197,7 @@ export async function addAptKeyViaServer(keys: string[], name: string, server =
|
||||||
key,
|
key,
|
||||||
])
|
])
|
||||||
await execRoot("chmod", ["644", fileName])
|
await execRoot("chmod", ["644", fileName])
|
||||||
})
|
}),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
return fileName
|
return fileName
|
||||||
|
@ -226,7 +226,7 @@ export async function updateAptAlternatives(name: string, path: string) {
|
||||||
await setupCppInProfile()
|
await setupCppInProfile()
|
||||||
return appendFile(
|
return appendFile(
|
||||||
cpprc_path,
|
cpprc_path,
|
||||||
`\nif [ $UID -eq 0 ]; then update-alternatives --install /usr/bin/${name} ${name} ${path} 40; fi\n`
|
`\nif [ $UID -eq 0 ]; then update-alternatives --install /usr/bin/${name} ${name} ${path} 40; fi\n`,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,7 +53,7 @@ export async function setupBin(
|
||||||
version: string,
|
version: string,
|
||||||
getPackageInfo: (version: string, platform: NodeJS.Platform, arch: string) => PackageInfo | Promise<PackageInfo>,
|
getPackageInfo: (version: string, platform: NodeJS.Platform, arch: string) => PackageInfo | Promise<PackageInfo>,
|
||||||
setupDir: string,
|
setupDir: string,
|
||||||
arch: string
|
arch: string,
|
||||||
): Promise<InstallationInfo> {
|
): Promise<InstallationInfo> {
|
||||||
info(`Installing ${name} ${version} ${arch} via direct downloading`)
|
info(`Installing ${name} ${version} ${arch} via direct downloading`)
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ export async function setupBin(
|
||||||
const { url, binRelativeDir, binFileName, extractedFolderName, extractFunction } = await getPackageInfo(
|
const { url, binRelativeDir, binFileName, extractedFolderName, extractFunction } = await getPackageInfo(
|
||||||
version,
|
version,
|
||||||
process.platform,
|
process.platform,
|
||||||
arch
|
arch,
|
||||||
)
|
)
|
||||||
|
|
||||||
// Restore from cache (if found).
|
// Restore from cache (if found).
|
||||||
|
@ -98,7 +98,7 @@ export async function setupBin(
|
||||||
() => {
|
() => {
|
||||||
return downloadTool(url)
|
return downloadTool(url)
|
||||||
},
|
},
|
||||||
{ name: url, max: 4, backoffBase: 2000, report: (err) => info(err) }
|
{ name: url, max: 4, backoffBase: 2000, report: (err) => info(err) },
|
||||||
)
|
)
|
||||||
|
|
||||||
if (!didInit) {
|
if (!didInit) {
|
||||||
|
|
|
@ -12,7 +12,7 @@ let hasBrew = false
|
||||||
export async function setupBrewPack(
|
export async function setupBrewPack(
|
||||||
name: string,
|
name: string,
|
||||||
version?: string,
|
version?: string,
|
||||||
extraArgs: string[] = []
|
extraArgs: string[] = [],
|
||||||
): Promise<InstallationInfo> {
|
): Promise<InstallationInfo> {
|
||||||
info(`Installing ${name} ${version ?? ""} via brew`)
|
info(`Installing ${name} ${version ?? ""} via brew`)
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ export async function setupBrewPack(
|
||||||
["install", version !== undefined && version !== "" ? `${name}@${version}` : name, ...extraArgs],
|
["install", version !== undefined && version !== "" ? `${name}@${version}` : name, ...extraArgs],
|
||||||
{
|
{
|
||||||
stdio: "inherit",
|
stdio: "inherit",
|
||||||
}
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
return { binDir }
|
return { binDir }
|
||||||
|
|
|
@ -19,7 +19,7 @@ export async function setupPipPackWithPython(
|
||||||
givenPython: string,
|
givenPython: string,
|
||||||
name: string,
|
name: string,
|
||||||
version?: string,
|
version?: string,
|
||||||
upgrade = false
|
upgrade = false,
|
||||||
): Promise<InstallationInfo> {
|
): Promise<InstallationInfo> {
|
||||||
info(`Installing ${name} ${version ?? ""} via pip`)
|
info(`Installing ${name} ${version ?? ""} via pip`)
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ export async function getSpecificVersionAndUrl(
|
||||||
versions: Set<string>,
|
versions: Set<string>,
|
||||||
platform: string,
|
platform: string,
|
||||||
version: string,
|
version: string,
|
||||||
getUrl: (platform: string, version: string) => string | null | Promise<string | null>
|
getUrl: (platform: string, version: string) => string | null | Promise<string | null>,
|
||||||
): Promise<[string, string]> {
|
): Promise<[string, string]> {
|
||||||
// specific ubuntu version
|
// specific ubuntu version
|
||||||
if (platform === "linux" && version.includes("ubuntu")) {
|
if (platform === "linux" && version.includes("ubuntu")) {
|
||||||
|
@ -57,8 +57,8 @@ export async function getSpecificVersionAndUrl(
|
||||||
if (!versions.has(version)) {
|
if (!versions.has(version)) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`Unsupported target! (platform='${platform}', version='${version}'). Try one of the following: ${JSON.stringify(
|
`Unsupported target! (platform='${platform}', version='${version}'). Try one of the following: ${JSON.stringify(
|
||||||
versions
|
versions,
|
||||||
)}`
|
)}`,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,8 +80,8 @@ export async function getSpecificVersionAndUrl(
|
||||||
|
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`Unsupported target! (platform='${platform}', version='${version}'). Try one of the following: ${JSON.stringify(
|
`Unsupported target! (platform='${platform}', version='${version}'). Try one of the following: ${JSON.stringify(
|
||||||
versions
|
versions,
|
||||||
)}`
|
)}`,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,7 +104,7 @@ export async function getBinVersion(file: string, versionRegex: RegExp = default
|
||||||
export async function isBinUptoDate(
|
export async function isBinUptoDate(
|
||||||
givenFile: string,
|
givenFile: string,
|
||||||
targetVersion: string,
|
targetVersion: string,
|
||||||
versionRegex: RegExp = defaultVersionRegex
|
versionRegex: RegExp = defaultVersionRegex,
|
||||||
) {
|
) {
|
||||||
const givenVersion = await getBinVersion(givenFile, versionRegex)
|
const givenVersion = await getBinVersion(givenFile, versionRegex)
|
||||||
if (givenVersion !== undefined && targetVersion !== "") {
|
if (givenVersion !== undefined && targetVersion !== "") {
|
||||||
|
|
|
@ -33,7 +33,7 @@ export async function cleanupTmpDir(testName: string) {
|
||||||
export async function testBin(
|
export async function testBin(
|
||||||
name: string,
|
name: string,
|
||||||
args: string[] | null = ["--version"],
|
args: string[] | null = ["--version"],
|
||||||
binDir: string | undefined = undefined
|
binDir: string | undefined = undefined,
|
||||||
) {
|
) {
|
||||||
try {
|
try {
|
||||||
let bin = name
|
let bin = name
|
||||||
|
|
|
@ -28,7 +28,7 @@ export async function setupVCVarsall(
|
||||||
toolset: string | undefined,
|
toolset: string | undefined,
|
||||||
sdk?: string,
|
sdk?: string,
|
||||||
uwp?: boolean,
|
uwp?: boolean,
|
||||||
spectre?: boolean
|
spectre?: boolean,
|
||||||
) {
|
) {
|
||||||
if (VCTargetsPath !== undefined && (await pathExists(VCTargetsPath))) {
|
if (VCTargetsPath !== undefined && (await pathExists(VCTargetsPath))) {
|
||||||
info(`Adding ${VCTargetsPath} to PATH`)
|
info(`Adding ${VCTargetsPath} to PATH`)
|
||||||
|
|
Loading…
Reference in New Issue