mirror of
https://github.com/github/codeql-action.git
synced 2026-11-10 06:54:40 +00:00
Distinguish between Xcode and SDK version in messages
This commit is contained in:
31
lib/entry-points.js
generated
31
lib/entry-points.js
generated
@@ -194018,15 +194018,29 @@ async function checkSwiftCompatibility(config, codeql, darwinVersion2) {
|
||||
// src/languages/traced.ts
|
||||
var UNSUPPORTED_DARWIN_FOR_TRACED = 27;
|
||||
var UNSUPPORTED_XCODE_FOR_TRACED = 27;
|
||||
function diagnosticAttributeName(product) {
|
||||
switch (product) {
|
||||
case "macOS":
|
||||
return "darwinVersion";
|
||||
case "Xcode":
|
||||
return "xcodeVersion";
|
||||
case "Xcode SDK":
|
||||
return "xcodeSdkVersion";
|
||||
}
|
||||
}
|
||||
function handleUnsupportedVersion(logger2, config, tracedLanguages, abortUnsupportedTracedAnalysis, productVersion) {
|
||||
const { product, version } = productVersion;
|
||||
const unsupportedVersion = product === "macOS" ? UNSUPPORTED_DARWIN_FOR_TRACED : UNSUPPORTED_XCODE_FOR_TRACED;
|
||||
const unsupportedVersion = product === "macOS" ? UNSUPPORTED_DARWIN_FOR_TRACED : (
|
||||
// We use the same constant for both Xcode and the Xcode SDK since we treat them
|
||||
// as equivalent indicators for whether traced analysis is unsupported.
|
||||
UNSUPPORTED_XCODE_FOR_TRACED
|
||||
);
|
||||
const baseMessage = [
|
||||
`Traced analysis is not supported on ${product} ${unsupportedVersion} or above.`,
|
||||
`Configure your analysis to run on macOS ${UNSUPPORTED_DARWIN_FOR_TRACED - 1} or below`,
|
||||
`and Xcode ${UNSUPPORTED_XCODE_FOR_TRACED - 1} or below.`
|
||||
].join(" ");
|
||||
const attributeName = product === "macOS" ? "darwinVersion" : "xcodeVersion";
|
||||
const attributeName = diagnosticAttributeName(product);
|
||||
for (const language of tracedLanguages) {
|
||||
addDiagnostic(
|
||||
config,
|
||||
@@ -194117,14 +194131,21 @@ async function checkRunnerSupportsTracedAnalysis(action, config, codeql) {
|
||||
);
|
||||
return;
|
||||
}
|
||||
const xcodeVer = xcodeVersionFromLink(action.logger) ?? await xcodeVersionFromXcodeBuild(action.logger) ?? await xcodeSdkVersion(action.logger);
|
||||
if (xcodeVer !== void 0 && xcodeVer.major >= UNSUPPORTED_XCODE_FOR_TRACED) {
|
||||
const xcodeVer = xcodeVersionFromLink(action.logger) ?? await xcodeVersionFromXcodeBuild(action.logger);
|
||||
let xcodeProduct = void 0;
|
||||
if (xcodeVer !== void 0) {
|
||||
xcodeProduct = { product: "Xcode", version: xcodeVer };
|
||||
} else {
|
||||
const xcodeSdkVer = await xcodeSdkVersion(action.logger);
|
||||
xcodeProduct = xcodeSdkVer !== void 0 ? { product: "Xcode SDK", version: xcodeSdkVer } : void 0;
|
||||
}
|
||||
if (xcodeProduct !== void 0 && xcodeProduct.version.major >= UNSUPPORTED_XCODE_FOR_TRACED) {
|
||||
handleUnsupportedVersion(
|
||||
action.logger,
|
||||
config,
|
||||
tracedLanguages,
|
||||
abortUnsupportedTracedAnalysis,
|
||||
{ product: "Xcode", version: xcodeVer }
|
||||
xcodeProduct
|
||||
);
|
||||
} else if (xcodeVer === void 0) {
|
||||
action.logger.info(
|
||||
|
||||
Reference in New Issue
Block a user