From be2818b1f97eb4a42499bad2e9afced269d28bd1 Mon Sep 17 00:00:00 2001 From: Asger F Date: Tue, 4 Nov 2025 15:11:43 +0100 Subject: [PATCH 1/5] Revert "JS: Fix check to account for override in tests" This reverts commit 81bb07a7ba0ee715df7c2dfd3e6344065489402d. --- .../extractor/src/com/semmle/js/extractor/AutoBuild.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/javascript/extractor/src/com/semmle/js/extractor/AutoBuild.java b/javascript/extractor/src/com/semmle/js/extractor/AutoBuild.java index 416fa237e97e..5deb786bc923 100644 --- a/javascript/extractor/src/com/semmle/js/extractor/AutoBuild.java +++ b/javascript/extractor/src/com/semmle/js/extractor/AutoBuild.java @@ -490,10 +490,7 @@ public int run() throws IOException { } // Fail extraction if no relevant files were found. - boolean seenRelevantFiles = EnvironmentVariables.isActionsExtractor() - ? seenFiles // assume all files are relevant for Actions extractor - : hasSeenCode(); - if (!seenRelevantFiles) { + if (!seenFiles || !hasSeenCode() && !EnvironmentVariables.isActionsExtractor()) { if (seenFiles) { warn("Only found JavaScript or TypeScript files that were empty or contained syntax errors."); } else { From 4988b801e00a601164ef664752336ca2cf96ed7f Mon Sep 17 00:00:00 2001 From: Asger F Date: Tue, 4 Nov 2025 15:11:45 +0100 Subject: [PATCH 2/5] Revert "Update javascript/extractor/src/com/semmle/js/extractor/AutoBuild.java" This reverts commit 105213df032e4427f6097a981ceb2c47dd3e4e3e. --- javascript/extractor/src/com/semmle/js/extractor/AutoBuild.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/javascript/extractor/src/com/semmle/js/extractor/AutoBuild.java b/javascript/extractor/src/com/semmle/js/extractor/AutoBuild.java index 5deb786bc923..23f15bcf35f2 100644 --- a/javascript/extractor/src/com/semmle/js/extractor/AutoBuild.java +++ b/javascript/extractor/src/com/semmle/js/extractor/AutoBuild.java @@ -489,7 +489,7 @@ public int run() throws IOException { diagnosticsToClose.forEach(DiagnosticWriter::close); } - // Fail extraction if no relevant files were found. + // Fail extraction is no relevant files were found. if (!seenFiles || !hasSeenCode() && !EnvironmentVariables.isActionsExtractor()) { if (seenFiles) { warn("Only found JavaScript or TypeScript files that were empty or contained syntax errors."); From 41f92083571795d5b40e9043a9fc311ab6ec9f43 Mon Sep 17 00:00:00 2001 From: Asger F Date: Tue, 4 Nov 2025 15:11:47 +0100 Subject: [PATCH 3/5] Revert "Actions: dont fail if no JS/TS code was found" This reverts commit c4d23d16edfde2566c4986e4dd7b7a177940886d. --- .../extractor/src/com/semmle/js/extractor/AutoBuild.java | 6 ++---- .../src/com/semmle/js/extractor/EnvironmentVariables.java | 7 ------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/javascript/extractor/src/com/semmle/js/extractor/AutoBuild.java b/javascript/extractor/src/com/semmle/js/extractor/AutoBuild.java index 23f15bcf35f2..8d00712b653b 100644 --- a/javascript/extractor/src/com/semmle/js/extractor/AutoBuild.java +++ b/javascript/extractor/src/com/semmle/js/extractor/AutoBuild.java @@ -489,15 +489,13 @@ public int run() throws IOException { diagnosticsToClose.forEach(DiagnosticWriter::close); } - // Fail extraction is no relevant files were found. - if (!seenFiles || !hasSeenCode() && !EnvironmentVariables.isActionsExtractor()) { + if (!hasSeenCode()) { if (seenFiles) { warn("Only found JavaScript or TypeScript files that were empty or contained syntax errors."); } else { warn("No JavaScript or TypeScript code found."); } - // Ensuring that the finalize steps detects that no code was seen. - // This is necessary to ensure we don't produce an overlay-base database without externs. + // ensuring that the finalize steps detects that no code was seen. Path srcFolder = Paths.get(EnvironmentVariables.getWipDatabase(), "src"); try { FileUtil8.recursiveDelete(srcFolder); diff --git a/javascript/extractor/src/com/semmle/js/extractor/EnvironmentVariables.java b/javascript/extractor/src/com/semmle/js/extractor/EnvironmentVariables.java index f2ac4227589f..39dfa70b285b 100644 --- a/javascript/extractor/src/com/semmle/js/extractor/EnvironmentVariables.java +++ b/javascript/extractor/src/com/semmle/js/extractor/EnvironmentVariables.java @@ -18,9 +18,6 @@ public class EnvironmentVariables { public static final String CODEQL_EXTRACTOR_JAVASCRIPT_WIP_DATABASE_ENV_VAR = "CODEQL_EXTRACTOR_JAVASCRIPT_WIP_DATABASE"; - public static final String CODEQL_EXTRACTOR_ACTIONS_WIP_DATABASE_ENV_VAR = - "CODEQL_EXTRACTOR_ACTIONS_WIP_DATABASE"; - public static final String CODEQL_DIST_ENV_VAR = "CODEQL_DIST"; /** @@ -97,8 +94,4 @@ public static String getCodeQLDist() { public static String getWipDatabase() { return Env.systemEnv().getNonEmpty(CODEQL_EXTRACTOR_JAVASCRIPT_WIP_DATABASE_ENV_VAR); } - - public static boolean isActionsExtractor() { - return Env.systemEnv().getNonEmpty(CODEQL_EXTRACTOR_ACTIONS_WIP_DATABASE_ENV_VAR) != null; - } } From 9bed94856d374e991e11881a47923dd0893906c0 Mon Sep 17 00:00:00 2001 From: Asger F Date: Tue, 4 Nov 2025 08:51:46 +0100 Subject: [PATCH 4/5] Revert "JS: Recursively delete source archive so emptiness detection works" This reverts commit 0acfacefbfd9fbf1d0230c09d51afa5143c86e81. --- .../extractor/src/com/semmle/js/extractor/AutoBuild.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/javascript/extractor/src/com/semmle/js/extractor/AutoBuild.java b/javascript/extractor/src/com/semmle/js/extractor/AutoBuild.java index 8d00712b653b..f5e998398f52 100644 --- a/javascript/extractor/src/com/semmle/js/extractor/AutoBuild.java +++ b/javascript/extractor/src/com/semmle/js/extractor/AutoBuild.java @@ -498,9 +498,12 @@ public int run() throws IOException { // ensuring that the finalize steps detects that no code was seen. Path srcFolder = Paths.get(EnvironmentVariables.getWipDatabase(), "src"); try { - FileUtil8.recursiveDelete(srcFolder); + // Non-recursive delete because "src/" should be empty. + FileUtil8.delete(srcFolder); } catch (NoSuchFileException e) { Exceptions.ignore(e, "the directory did not exist"); + } catch (DirectoryNotEmptyException e) { + Exceptions.ignore(e, "just leave the directory if it is not empty"); } return 0; } From 30096f3a945e71b3ccb0190348555899ecff0f5f Mon Sep 17 00:00:00 2001 From: Asger F Date: Tue, 4 Nov 2025 08:52:06 +0100 Subject: [PATCH 5/5] Revert "JS: Add compileForOverlayEval" This reverts commit 39f74d808be5cf89c48ec805212ff23121fce217. --- javascript/ql/lib/qlpack.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/javascript/ql/lib/qlpack.yml b/javascript/ql/lib/qlpack.yml index d8d53ef1c7ef..1ee1c8c78150 100644 --- a/javascript/ql/lib/qlpack.yml +++ b/javascript/ql/lib/qlpack.yml @@ -23,4 +23,3 @@ dataExtensions: - semmle/javascript/security/domains/**/*.model.yml - ext/*.model.yml warnOnImplicitThis: true -compileForOverlayEval: true