mirror of
https://github.com/aminya/setup-cpp
synced 2024-11-30 21:22:30 +08:00
Compare commits
3 Commits
70e50f97d5
...
e77865a1bd
Author | SHA1 | Date | |
---|---|---|---|
|
e77865a1bd | ||
|
9f44eb2c24 | ||
|
f85ad55d63 |
2
dist/legacy/setup-cpp.js
vendored
2
dist/legacy/setup-cpp.js
vendored
File diff suppressed because one or more lines are too long
2
dist/legacy/setup-cpp.js.map
vendored
2
dist/legacy/setup-cpp.js.map
vendored
File diff suppressed because one or more lines are too long
2
dist/legacy/versions.json
vendored
2
dist/legacy/versions.json
vendored
@ -1 +1 @@
|
|||||||
{"ninja":"1.12.1","cmake":"3.30.4","task":"3.39.2","powershell":"7.4.5","pip":"22.2.0","python":"3.7.9","meson":{"linux":{"ubuntu":{"20":"1.5.2","18":"0.61.4","else":"0.61.4"},"else":"1.5.2"},"else":"1.5.2"},"kcov":{"linux":{"ubuntu":{"22":"42-binary","20":"40-binary","14":"40","else":"42"},"else":"42"},"else":"42"},"doxygen":{"linux":{"archlinux":"1.12.0-2","ubuntu":{"22":"1.12.0","18":"1.10.0","else":"1.10.0"},"else":"1.12.0"},"else":"1.12.0"},"gcc":{"win32":"14.2.0posix-18.1.8-12.0.0-ucrt-r1","else":""},"mingw":{"win32":"14.2.0posix-18.1.8-12.0.0-ucrt-r1","linux":{"ubuntu":{"22":"8.0.0-1","20":"7.0.0-2","else":"7.0.0-2"}},"else":""},"gcovr":{"linux":{"ubuntu":{"20":"","18":"5.0","else":"5.0"}},"else":""},"nala":{"linux":{"ubuntu":{"22":"","21":"legacy","else":"legacy"}},"else":""},"llvm":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"18.1.8"},"clang":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"18.1.8"},"clang++":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"18.1.8"},"clang-tidy":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"18.1.8"},"clangtidy":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"18.1.8"},"clang-format":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"18.1.8"},"clangformat":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"18.1.8"}}
|
{"ninja":"1.12.1","cmake":"3.30.4","task":"3.39.2","powershell":"7.4.5","pip":">=22.2.0","python":">=3.7.9","meson":{"linux":{"ubuntu":{"20":"1.5.2","18":"0.61.4","else":"0.61.4"},"else":"1.5.2"},"else":"1.5.2"},"kcov":{"linux":{"ubuntu":{"22":"42-binary","20":"40-binary","14":"40","else":"42"},"else":"42"},"else":"42"},"doxygen":{"linux":{"archlinux":"1.12.0-2","ubuntu":{"22":"1.12.0","18":"1.10.0","else":"1.10.0"},"else":"1.12.0"},"else":"1.12.0"},"gcc":{"win32":"14.2.0posix-18.1.8-12.0.0-ucrt-r1","else":""},"mingw":{"win32":"14.2.0posix-18.1.8-12.0.0-ucrt-r1","linux":{"ubuntu":{"22":"8.0.0-1","20":"7.0.0-2","else":"7.0.0-2"},"else":""},"else":""},"gcovr":{"linux":{"ubuntu":{"20":"","18":"5.0","else":"5.0"},"else":""},"else":""},"nala":{"linux":{"ubuntu":{"22":"","21":"legacy","else":"legacy"},"else":""},"else":""},"llvm":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"18.1.8"},"clang":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"18.1.8"},"clang++":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"18.1.8"},"clang-tidy":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"18.1.8"},"clangtidy":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"18.1.8"},"clang-format":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"18.1.8"},"clangformat":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"18.1.8"}}
|
2
dist/modern/setup-cpp.mjs
vendored
2
dist/modern/setup-cpp.mjs
vendored
File diff suppressed because one or more lines are too long
2
dist/modern/setup-cpp.mjs.map
vendored
2
dist/modern/setup-cpp.mjs.map
vendored
File diff suppressed because one or more lines are too long
2
dist/modern/versions.json
vendored
2
dist/modern/versions.json
vendored
@ -1 +1 @@
|
|||||||
{"ninja":"1.12.1","cmake":"3.30.4","task":"3.39.2","powershell":"7.4.5","pip":"22.2.0","python":"3.7.9","meson":{"linux":{"ubuntu":{"20":"1.5.2","18":"0.61.4","else":"0.61.4"},"else":"1.5.2"},"else":"1.5.2"},"kcov":{"linux":{"ubuntu":{"22":"42-binary","20":"40-binary","14":"40","else":"42"},"else":"42"},"else":"42"},"doxygen":{"linux":{"archlinux":"1.12.0-2","ubuntu":{"22":"1.12.0","18":"1.10.0","else":"1.10.0"},"else":"1.12.0"},"else":"1.12.0"},"gcc":{"win32":"14.2.0posix-18.1.8-12.0.0-ucrt-r1","else":""},"mingw":{"win32":"14.2.0posix-18.1.8-12.0.0-ucrt-r1","linux":{"ubuntu":{"22":"8.0.0-1","20":"7.0.0-2","else":"7.0.0-2"}},"else":""},"gcovr":{"linux":{"ubuntu":{"20":"","18":"5.0","else":"5.0"}},"else":""},"nala":{"linux":{"ubuntu":{"22":"","21":"legacy","else":"legacy"}},"else":""},"llvm":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"18.1.8"},"clang":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"18.1.8"},"clang++":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"18.1.8"},"clang-tidy":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"18.1.8"},"clangtidy":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"18.1.8"},"clang-format":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"18.1.8"},"clangformat":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"18.1.8"}}
|
{"ninja":"1.12.1","cmake":"3.30.4","task":"3.39.2","powershell":"7.4.5","pip":">=22.2.0","python":">=3.7.9","meson":{"linux":{"ubuntu":{"20":"1.5.2","18":"0.61.4","else":"0.61.4"},"else":"1.5.2"},"else":"1.5.2"},"kcov":{"linux":{"ubuntu":{"22":"42-binary","20":"40-binary","14":"40","else":"42"},"else":"42"},"else":"42"},"doxygen":{"linux":{"archlinux":"1.12.0-2","ubuntu":{"22":"1.12.0","18":"1.10.0","else":"1.10.0"},"else":"1.12.0"},"else":"1.12.0"},"gcc":{"win32":"14.2.0posix-18.1.8-12.0.0-ucrt-r1","else":""},"mingw":{"win32":"14.2.0posix-18.1.8-12.0.0-ucrt-r1","linux":{"ubuntu":{"22":"8.0.0-1","20":"7.0.0-2","else":"7.0.0-2"},"else":""},"else":""},"gcovr":{"linux":{"ubuntu":{"20":"","18":"5.0","else":"5.0"},"else":""},"else":""},"nala":{"linux":{"ubuntu":{"22":"","21":"legacy","else":"legacy"},"else":""},"else":""},"llvm":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"18.1.8"},"clang":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"18.1.8"},"clang++":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"18.1.8"},"clang-tidy":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"18.1.8"},"clangtidy":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"18.1.8"},"clang-format":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"18.1.8"},"clangformat":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"18.1.8"}}
|
@ -25,7 +25,7 @@ import { setupPacmanPack } from "../utils/setup/setupPacmanPack.js"
|
|||||||
import { hasPipx, setupPipPackSystem, setupPipPackWithPython } from "../utils/setup/setupPipPack.js"
|
import { hasPipx, setupPipPackSystem, setupPipPackWithPython } from "../utils/setup/setupPipPack.js"
|
||||||
import { isBinUptoDate } from "../utils/setup/version.js"
|
import { isBinUptoDate } from "../utils/setup/version.js"
|
||||||
import { unique } from "../utils/std/index.js"
|
import { unique } from "../utils/std/index.js"
|
||||||
import { getVersionDefault } from "../versions/versions.js"
|
import { getVersionDefault, isMinVersion } from "../versions/versions.js"
|
||||||
|
|
||||||
export async function setupPython(
|
export async function setupPython(
|
||||||
version: string,
|
version: string,
|
||||||
@ -89,7 +89,10 @@ async function setupWheel(foundPython: string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function findOrSetupPython(version: string, setupDir: string, arch: string): Promise<InstallationInfo> {
|
async function findOrSetupPython(givenVersion: string, setupDir: string, arch: string): Promise<InstallationInfo> {
|
||||||
|
// if a version range specified, use the default version, and later check the range
|
||||||
|
const version = isMinVersion(givenVersion) ? "" : givenVersion
|
||||||
|
|
||||||
let installInfo: InstallationInfo | undefined
|
let installInfo: InstallationInfo | undefined
|
||||||
let foundPython = await findPython(setupDir)
|
let foundPython = await findPython(setupDir)
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@ import { info } from "ci-log"
|
|||||||
import { isUrlOnline } from "is-url-online"
|
import { isUrlOnline } from "is-url-online"
|
||||||
import semverCoerce from "semver/functions/coerce"
|
import semverCoerce from "semver/functions/coerce"
|
||||||
import semverCompare from "semver/functions/compare"
|
import semverCompare from "semver/functions/compare"
|
||||||
|
import semverSatisfies from "semver/functions/satisfies"
|
||||||
import semverValid from "semver/functions/valid"
|
import semverValid from "semver/functions/valid"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -112,7 +113,15 @@ export async function isBinUptoDate(
|
|||||||
) {
|
) {
|
||||||
const givenVersion = await getBinVersion(givenFile, versionRegex)
|
const givenVersion = await getBinVersion(givenFile, versionRegex)
|
||||||
if (givenVersion !== undefined && targetVersion !== "") {
|
if (givenVersion !== undefined && targetVersion !== "") {
|
||||||
return semverCompare(givenVersion, targetVersion) !== -1
|
try {
|
||||||
|
// if -1, it means the given version is newer than the target version
|
||||||
|
// this requires the target version to be a valid semver range
|
||||||
|
return semverCompare(givenVersion, targetVersion) !== -1
|
||||||
|
} catch {
|
||||||
|
// check if the given version satisfies the target version
|
||||||
|
// this works even if the target version is not a valid semver range (e.g. >=1.2.3)
|
||||||
|
return semverSatisfies(givenVersion, targetVersion)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// assume given version is old
|
// assume given version is old
|
||||||
return false
|
return false
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
"cmake": "3.30.4",
|
"cmake": "3.30.4",
|
||||||
"task": "3.39.2",
|
"task": "3.39.2",
|
||||||
"powershell": "7.4.5",
|
"powershell": "7.4.5",
|
||||||
"pip": "22.2.0",
|
"pip": ">=22.2.0",
|
||||||
"python": "3.7.9",
|
"python": ">=3.7.9",
|
||||||
"meson": {
|
"meson": {
|
||||||
"linux": {
|
"linux": {
|
||||||
"ubuntu": {
|
"ubuntu": {
|
||||||
@ -51,7 +51,8 @@
|
|||||||
"22": "8.0.0-1",
|
"22": "8.0.0-1",
|
||||||
"20": "7.0.0-2",
|
"20": "7.0.0-2",
|
||||||
"else": "7.0.0-2"
|
"else": "7.0.0-2"
|
||||||
}
|
},
|
||||||
|
"else": ""
|
||||||
},
|
},
|
||||||
"else": ""
|
"else": ""
|
||||||
},
|
},
|
||||||
@ -61,7 +62,8 @@
|
|||||||
"20": "",
|
"20": "",
|
||||||
"18": "5.0",
|
"18": "5.0",
|
||||||
"else": "5.0"
|
"else": "5.0"
|
||||||
}
|
},
|
||||||
|
"else": ""
|
||||||
},
|
},
|
||||||
"else": ""
|
"else": ""
|
||||||
},
|
},
|
||||||
@ -71,7 +73,8 @@
|
|||||||
"22": "",
|
"22": "",
|
||||||
"21": "legacy",
|
"21": "legacy",
|
||||||
"else": "legacy"
|
"else": "legacy"
|
||||||
}
|
},
|
||||||
|
"else": ""
|
||||||
},
|
},
|
||||||
"else": ""
|
"else": ""
|
||||||
},
|
},
|
||||||
|
@ -171,3 +171,7 @@ export function syncVersions(
|
|||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function isMinVersion(version: string) {
|
||||||
|
return version.startsWith(">")
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user