Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@
<version>${rascal-maven.version}</version>
<configuration>
<bootstrapRascalVersion>0.41.0-RC70</bootstrapRascalVersion>
<modulesFromFile>true</modulesFromFile>
<parallel>true</parallel>
<parallelPreChecks>
<pre>${project.basedir}/src/org/rascalmpl/library/Prelude.rsc</pre>
Expand Down
12 changes: 11 additions & 1 deletion src/org/rascalmpl/compiler/lang/rascalcore/check/Checker.rsc
Original file line number Diff line number Diff line change
Expand Up @@ -596,8 +596,18 @@ int main(
bool warnUnusedPatternFormals = true,
bool infoModuleChecked = false,
bool errorsAsWarnings = false,
bool warningsAsErrors = false
bool warningsAsErrors = false,
bool readModulesFromFile = false // if this is true, `modules` points to file(s) that we should read the module locations to compile from
) {

if (readModulesFromFile) {
list[loc] actualModules = [];
for (m <- modules) {
actualModules += readBinaryValueFile(#list[loc], m);
}
modules = actualModules;
}

if (verbose) {
println("PathConfig:");
iprintln(pcfg);
Expand Down
22 changes: 21 additions & 1 deletion src/org/rascalmpl/shell/RascalCompile.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,27 @@ private static int parallelMain(Map<String, IValue> parsedArgs, IList preChecks,
final var chunk = chunks.get(index);
final var chunkBin = bins.get(index);
final Map<String,IValue> chunkArgs = new HashMap<>(parsedArgs);
chunkArgs.put("modules", chunk);
if (modulesArgFromFile) {
try {
var modulesFile = File.createTempFile("rascal-modules-" + i, ".txt");
modulesFile.deleteOnExit();

// Write all module paths to a file
try (IValueOutputStream w = new IValueOutputStream(new FileOutputStream(modulesFile), vf)) {
w.write(chunk);
}

var modulesFileLoc = URIUtil.assumeCorrectLocation(modulesFile.toURI().toString());
chunkArgs.remove("modules");
chunkArgs.put("modulesFileLoc", modulesFileLoc);
chunkArgs.put("readModulesFromFile", vf.bool(true));
} catch (IOException e) {
err.println("Could not write module locations to file; passing as arguments instead.");
chunkArgs.put("modules", chunk);
}
} else {
chunkArgs.put("modules", chunk);
}
chunkArgs.put("bin", chunkBin);

workers.add(exec.submit(() -> {
Expand Down
Loading