@@ -10,7 +10,10 @@ import * as analyses from "./analyses";
1010import { setupCppAutobuild } from "./autobuild" ;
1111import { type CodeQL } from "./codeql" ;
1212import * as configUtils from "./config-utils" ;
13- import { getJavaTempDependencyDir } from "./dependency-caching" ;
13+ import {
14+ getCsharpTempDependencyDir ,
15+ getJavaTempDependencyDir ,
16+ } from "./dependency-caching" ;
1417import { addDiagnostic , makeDiagnostic } from "./diagnostics" ;
1518import {
1619 DiffThunkRange ,
@@ -98,6 +101,7 @@ async function setupPythonExtractor(logger: Logger) {
98101
99102export async function runExtraction (
100103 codeql : CodeQL ,
104+ features : FeatureEnablement ,
101105 config : configUtils . Config ,
102106 logger : Logger ,
103107) {
@@ -122,7 +126,7 @@ export async function runExtraction(
122126 await setupCppAutobuild ( codeql , logger ) ;
123127 }
124128
125- // The Java `build-mode: none` extractor places dependencies (.jar files) in the
129+ // The Java and C# `build-mode: none` extractors place dependencies in the
126130 // database scratch directory by default. For dependency caching purposes, we want
127131 // a stable path that caches can be restored into and that we can cache at the
128132 // end of the workflow (i.e. that does not get removed when the scratch directory is).
@@ -133,6 +137,15 @@ export async function runExtraction(
133137 process . env [ "CODEQL_EXTRACTOR_JAVA_OPTION_BUILDLESS_DEPENDENCY_DIR" ] =
134138 getJavaTempDependencyDir ( ) ;
135139 }
140+ if (
141+ language === KnownLanguage . csharp &&
142+ config . buildMode === BuildMode . None &&
143+ ( await features . getValue ( Feature . CsharpCacheBuildModeNone ) )
144+ ) {
145+ process . env [
146+ "CODEQL_EXTRACTOR_CSHARP_OPTION_BUILDLESS_DEPENDENCY_DIR"
147+ ] = getCsharpTempDependencyDir ( ) ;
148+ }
136149
137150 await codeql . extractUsingBuildMode ( config , language ) ;
138151 } else {
@@ -177,13 +190,14 @@ export function dbIsFinalized(
177190
178191async function finalizeDatabaseCreation (
179192 codeql : CodeQL ,
193+ features : FeatureEnablement ,
180194 config : configUtils . Config ,
181195 threadsFlag : string ,
182196 memoryFlag : string ,
183197 logger : Logger ,
184198) : Promise < DatabaseCreationTimings > {
185199 const extractionStart = performance . now ( ) ;
186- await runExtraction ( codeql , config , logger ) ;
200+ await runExtraction ( codeql , features , config , logger ) ;
187201 const extractionTime = performance . now ( ) - extractionStart ;
188202
189203 const trapImportStart = performance . now ( ) ;
@@ -597,6 +611,7 @@ export async function runQueries(
597611}
598612
599613export async function runFinalize (
614+ features : FeatureEnablement ,
600615 outputDir : string ,
601616 threadsFlag : string ,
602617 memoryFlag : string ,
@@ -615,6 +630,7 @@ export async function runFinalize(
615630
616631 const timings = await finalizeDatabaseCreation (
617632 codeql ,
633+ features ,
618634 config ,
619635 threadsFlag ,
620636 memoryFlag ,
0 commit comments