mirror of https://github.com/aminya/setup-cpp
fix: fix mingw version satisfaction check
This commit is contained in:
parent
ed3b715dd5
commit
59c68f43d8
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
|
@ -1,6 +1,6 @@
|
||||||
|
import { join } from "path"
|
||||||
import { info, warning } from "ci-log"
|
import { info, warning } from "ci-log"
|
||||||
import { pathExists } from "path-exists"
|
import { pathExists } from "path-exists"
|
||||||
import { join } from "path/posix"
|
|
||||||
import { dirname } from "./gcc.ts"
|
import { dirname } from "./gcc.ts"
|
||||||
|
|
||||||
export async function addGccLoggingMatcher() {
|
export async function addGccLoggingMatcher() {
|
||||||
|
|
|
@ -104,12 +104,6 @@ export async function getMinGWPackageInfo(
|
||||||
ia32: "i386",
|
ia32: "i386",
|
||||||
} as Record<string, string | undefined>
|
} as Record<string, string | undefined>
|
||||||
|
|
||||||
// extract the base version by coercing the version
|
|
||||||
const versionCoerce = semverCoerce(version)
|
|
||||||
if (versionCoerce === null) {
|
|
||||||
throw new Error(`Invalid MinGW version requested '${version}'`)
|
|
||||||
}
|
|
||||||
|
|
||||||
const runtime = extractMinGWRuntime(version)
|
const runtime = extractMinGWRuntime(version)
|
||||||
const threadModel = extractMinGWThreadModel(version)
|
const threadModel = extractMinGWThreadModel(version)
|
||||||
const exceptionModel = extractMingwExceptionModel(version)
|
const exceptionModel = extractMingwExceptionModel(version)
|
||||||
|
@ -122,15 +116,11 @@ export async function getMinGWPackageInfo(
|
||||||
mingwArchMap[arch] ?? arch,
|
mingwArchMap[arch] ?? arch,
|
||||||
],
|
],
|
||||||
filterName: (assetName) => {
|
filterName: (assetName) => {
|
||||||
const assetRuntime = extractMinGWRuntime(assetName)
|
return (runtime === undefined || runtime === extractMinGWRuntime(assetName))
|
||||||
const assetThreadModel = extractMinGWThreadModel(assetName)
|
&& (threadModel === undefined || threadModel === extractMinGWThreadModel(assetName))
|
||||||
const assetExceptionModel = extractMingwExceptionModel(assetName)
|
&& (exceptionModel === undefined || exceptionModel === extractMingwExceptionModel(assetName))
|
||||||
|
|
||||||
return (runtime === undefined || runtime === assetRuntime)
|
|
||||||
&& (threadModel === undefined || threadModel === assetThreadModel)
|
|
||||||
&& (assetExceptionModel === undefined || assetExceptionModel === exceptionModel)
|
|
||||||
},
|
},
|
||||||
versionSatisfies: (assetVersion, _version) => {
|
versionSatisfies: (assetVersion, versionRange) => {
|
||||||
// extract the base version by coercing the version
|
// extract the base version by coercing the version
|
||||||
const assetCoerce = semverCoerce(assetVersion)
|
const assetCoerce = semverCoerce(assetVersion)
|
||||||
if (assetCoerce === null) {
|
if (assetCoerce === null) {
|
||||||
|
@ -139,7 +129,7 @@ export async function getMinGWPackageInfo(
|
||||||
|
|
||||||
// if the asset version is satisfied by the version
|
// if the asset version is satisfied by the version
|
||||||
// and the runtime and thread model match or not specified
|
// and the runtime and thread model match or not specified
|
||||||
return semverSatisfies(assetCoerce, `^${versionCoerce}`)
|
return semverSatisfies(assetCoerce, versionRange)
|
||||||
&& (runtime === undefined || runtime === extractMinGWRuntime(assetVersion))
|
&& (runtime === undefined || runtime === extractMinGWRuntime(assetVersion))
|
||||||
&& (threadModel === undefined || threadModel === extractMinGWThreadModel(assetVersion))
|
&& (threadModel === undefined || threadModel === extractMinGWThreadModel(assetVersion))
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue