From dc30dcf1f875fdbcb98ac68865a8444c0e46d67a Mon Sep 17 00:00:00 2001 From: Asger Feldthaus Date: Thu, 23 Jan 2020 12:39:19 +0000 Subject: [PATCH] TS: Only require SCRATCH_DIR when installing dependencies --- .../extractor/src/com/semmle/js/extractor/AutoBuild.java | 6 ++---- 1 file changed, 2 insertions(+), 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 1db32a43fcc..4de435ea6f2 100644 --- a/javascript/extractor/src/com/semmle/js/extractor/AutoBuild.java +++ b/javascript/extractor/src/com/semmle/js/extractor/AutoBuild.java @@ -202,7 +202,6 @@ public class AutoBuild { private final Set xmlExtensions = new LinkedHashSet<>(); private ProjectLayout filters; private final Path LGTM_SRC, SEMMLE_DIST; - private final Path scratchDir; private final TypeScriptMode typeScriptMode; private final String defaultEncoding; private ExecutorService threadPool; @@ -216,7 +215,6 @@ public class AutoBuild { public AutoBuild() { this.LGTM_SRC = toRealPath(getPathFromEnvVar("LGTM_SRC")); this.SEMMLE_DIST = Paths.get(EnvironmentVariables.getExtractorRoot()); - this.scratchDir = Paths.get(EnvironmentVariables.getScratchDir()); this.outputConfig = new ExtractorOutputConfig(LegacyLanguage.JAVASCRIPT); this.trapCache = mkTrapCache(); this.typeScriptMode = @@ -643,7 +641,7 @@ public class AutoBuild { * Some packages must be downloaded while others exist within the same repo ("monorepos") * but are not in a location where TypeScript would look for it. *

- * Downloaded packages are intalled under {@link #scratchDir}, in a mirrored directory hierarchy + * Downloaded packages are intalled under SCRATCH_DIR, in a mirrored directory hierarchy * we call the "virtual source root". * Each package.json file is rewritten and copied to the virtual source root, * where yarn install is invoked. @@ -662,7 +660,7 @@ public class AutoBuild { } final Path sourceRoot = Paths.get(".").toAbsolutePath(); - final Path virtualSourceRoot = this.scratchDir.toAbsolutePath(); + final Path virtualSourceRoot = Paths.get(EnvironmentVariables.getScratchDir()).toAbsolutePath(); // Read all package.json files and index them by name. Map packageJsonFiles = new LinkedHashMap<>();