Skip to content

Commit

Permalink
Unconditionally enable autobuild direct tracing feature
Browse files Browse the repository at this point in the history
  • Loading branch information
henrymercer committed May 13, 2024
1 parent 08487db commit c97b532
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 21 deletions.
5 changes: 2 additions & 3 deletions lib/autobuild.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/autobuild.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 4 additions & 5 deletions lib/tracer-config.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/tracer-config.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 2 additions & 5 deletions src/autobuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,18 +159,15 @@ export async function setupCppAutobuild(codeql: CodeQL, logger: Logger) {
export async function runAutobuild(
config: configUtils.Config,
language: Language,
features: FeatureEnablement,
_features: FeatureEnablement,
logger: Logger,
) {
logger.startGroup(`Attempting to automatically build ${language} code`);
const codeQL = await getCodeQL(config.codeQLCmd);
if (language === Language.cpp) {
await setupCppAutobuild(codeQL, logger);
}
if (
config.buildMode &&
(await features.getValue(Feature.AutobuildDirectTracing, codeQL))
) {
if (config.buildMode) {
await codeQL.extractUsingBuildMode(config, language);
} else {
await codeQL.runAutobuild(config, language);
Expand Down
11 changes: 5 additions & 6 deletions src/tracer-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as path from "path";

import { type CodeQL } from "./codeql";
import { type Config } from "./config-utils";
import { Feature, FeatureEnablement } from "./feature-flags";
import { FeatureEnablement } from "./feature-flags";
import { isTracedLanguage } from "./languages";
import { Logger } from "./logging";
import { ToolsFeature } from "./tools-features";
Expand All @@ -14,14 +14,13 @@ export type TracerConfig = {
};

export async function shouldEnableIndirectTracing(
codeql: CodeQL,
_codeql: CodeQL,
config: Config,
features: FeatureEnablement,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
_features: FeatureEnablement,
): Promise<boolean> {
return (
(!config.buildMode ||
config.buildMode === BuildMode.Manual ||
!(await features.getValue(Feature.AutobuildDirectTracing, codeql))) &&
(!config.buildMode || config.buildMode === BuildMode.Manual) &&
config.languages.some((l) => isTracedLanguage(l))
);
}
Expand Down

0 comments on commit c97b532

Please sign in to comment.