aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Quist <partouf@gmail.com>2022-11-17 17:32:46 +0100
committerGitHub <noreply@github.com>2022-11-17 17:32:46 +0100
commitd180698be2983d3a34f1d6cf66f2cc3d46dc8a41 (patch)
treea42efc8090b144ca3c482e4e5a3425aa05307741
parentb67f5cfaa269433e679e36d3f5acdb038e746a11 (diff)
downloadcompiler-explorer-d180698be2983d3a34f1d6cf66f2cc3d46dc8a41.tar.gz
compiler-explorer-d180698be2983d3a34f1d6cf66f2cc3d46dc8a41.zip
Fix4293 (#4298)gh-4910
-rw-r--r--lib/base-compiler.ts37
-rw-r--r--lib/compilers/dosbox-compiler.ts2
-rw-r--r--lib/compilers/pascal-win.js2
-rw-r--r--lib/compilers/pascal.js2
4 files changed, 21 insertions, 22 deletions
diff --git a/lib/base-compiler.ts b/lib/base-compiler.ts
index ef2b026dc..2b10ab2dd 100644
--- a/lib/base-compiler.ts
+++ b/lib/base-compiler.ts
@@ -1395,8 +1395,6 @@ export class BaseCompiler {
await fs.writeFile(inputFilename, source);
if (files && files.length > 0) {
- filters.dontMaskFilenames = true;
-
await this.writeMultipleFiles(files, dirPath);
}
@@ -1412,8 +1410,6 @@ export class BaseCompiler {
await fs.writeFile(inputFilename, source);
if (files && files.length > 0) {
- filters.dontMaskFilenames = true;
-
await this.writeMultipleFiles(files, dirPath);
}
@@ -2102,18 +2098,7 @@ export class BaseCompiler {
return normalized;
}
- async compile(source, options, backendOptions, filters, bypassCache, tools, executionParameters, libraries, files) {
- const optionsError = this.checkOptions(options);
- if (optionsError) throw optionsError;
- const sourceError = this.checkSource(source);
- if (sourceError) throw sourceError;
-
- const libsAndOptions = {libraries, options};
- if (this.tryAutodetectLibraries(libsAndOptions)) {
- libraries = libsAndOptions.libraries;
- options = libsAndOptions.options;
- }
-
+ fixFiltersBeforeCacheKey(filters, options, files) {
// Don't run binary for unsupported compilers, even if we're asked.
if (filters.binary && !this.compiler.supportsBinary) {
delete filters.binary;
@@ -2128,10 +2113,30 @@ export class BaseCompiler {
}
}
+ if (files && files.length > 0) {
+ filters.dontMaskFilenames = true;
+ }
+ }
+
+ async compile(source, options, backendOptions, filters, bypassCache, tools, executionParameters, libraries, files) {
+ const optionsError = this.checkOptions(options);
+ if (optionsError) throw optionsError;
+ const sourceError = this.checkSource(source);
+ if (sourceError) throw sourceError;
+
+ const libsAndOptions = {libraries, options};
+ if (this.tryAutodetectLibraries(libsAndOptions)) {
+ libraries = libsAndOptions.libraries;
+ options = libsAndOptions.options;
+ }
+
+ this.fixFiltersBeforeCacheKey(filters, options, files);
+
const executeParameters = {
args: executionParameters.args || [],
stdin: executionParameters.stdin || '',
};
+
const key = this.getCacheKey(source, options, backendOptions, filters, tools, libraries, files);
const doExecute = filters.execute;
diff --git a/lib/compilers/dosbox-compiler.ts b/lib/compilers/dosbox-compiler.ts
index 3bb784e15..2d48d2c62 100644
--- a/lib/compilers/dosbox-compiler.ts
+++ b/lib/compilers/dosbox-compiler.ts
@@ -64,8 +64,6 @@ export class DosboxCompiler extends BaseCompiler {
await fs.writeFile(inputFilename, source.replaceAll(/\n/g, '\r\n'));
if (files && files.length > 0) {
- (filters as any).dontMaskFilenames = true;
-
await this.writeMultipleFiles(files, dirPath);
}
diff --git a/lib/compilers/pascal-win.js b/lib/compilers/pascal-win.js
index 41fc03c5b..11c4d54dc 100644
--- a/lib/compilers/pascal-win.js
+++ b/lib/compilers/pascal-win.js
@@ -131,8 +131,6 @@ export class PascalWinCompiler extends BaseCompiler {
await fs.writeFile(inputFilename, source);
if (files && files.length > 0) {
- filters.dontMaskFilenames = true;
-
await this.writeMultipleFiles(files, dirPath);
}
diff --git a/lib/compilers/pascal.js b/lib/compilers/pascal.js
index 33980a072..c1d48098e 100644
--- a/lib/compilers/pascal.js
+++ b/lib/compilers/pascal.js
@@ -154,8 +154,6 @@ export class FPCCompiler extends BaseCompiler {
}
if (files && files.length > 0) {
- filters.dontMaskFilenames = true;
-
await this.writeMultipleFiles(files, dirPath);
}