Skip to content

Commit

Permalink
Fix4293 (#4298)
Browse files Browse the repository at this point in the history
  • Loading branch information
partouf committed Nov 17, 2022
1 parent b67f5cf commit d180698
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 22 deletions.
37 changes: 21 additions & 16 deletions lib/base-compiler.ts
Expand Up @@ -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);
}

Expand All @@ -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);
}

Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions lib/compilers/dosbox-compiler.ts
Expand Up @@ -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);
}

Expand Down
2 changes: 0 additions & 2 deletions lib/compilers/pascal-win.js
Expand Up @@ -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);
}

Expand Down
2 changes: 0 additions & 2 deletions lib/compilers/pascal.js
Expand Up @@ -154,8 +154,6 @@ export class FPCCompiler extends BaseCompiler {
}

if (files && files.length > 0) {
filters.dontMaskFilenames = true;

await this.writeMultipleFiles(files, dirPath);
}

Expand Down

0 comments on commit d180698

Please sign in to comment.