Update Buck
Buck changed export_deps from a boolean to be exported_deps, a list of
dependencies that are to be added to deps and also exported. This
allows libraries to have dependencies for implementation use only, but
not expose them to callers for linkage.
exported_deps aren't transparently transitive anymore. This mostly
impacts the plugin-api:lib rule.
This is the first time Gerrit is using upstream Buck with no patches.
- Java memory settings for Buck can now be supplied in a project
specific file using `.buckjavaargs` in the root directory. The file
replaces the `.buckrc` previously supported by Gerrit's fork.
- Temporary directories for java_application() invoked from genrule()
is now supplied as part of the arguments using $TMP. This removes
one of the patches Gerrit had for Buck.
- Unit tests use the system temporary directory during testing. This
can be faster if the temporary directory is a tmpfs. Unfortunately
not all passing tests clean up after themselves, making it possible
to exhaust system memory and swap with useless tmpfs contents.
Using the system temporary directory for tests removes another patch
Gerrit had on top of Buck.
Change-Id: I3a9fe4aab0a33a8673df727e618122027a742638
diff --git a/lib/prolog/java/BuckPrologCompiler.java b/lib/prolog/java/BuckPrologCompiler.java
index 0db6763..17d2d76 100644
--- a/lib/prolog/java/BuckPrologCompiler.java
+++ b/lib/prolog/java/BuckPrologCompiler.java
@@ -23,18 +23,21 @@
import java.util.jar.JarOutputStream;
public class BuckPrologCompiler {
+ private static File tmpdir;
+
public static void main(String[] argv) throws IOException, CompileException {
- File out = new File(argv[argv.length - 1]);
+ int i = 0;
+ tmpdir = new File(argv[i++]);
+ File out = new File(argv[i++]);
File java = tmpdir("java");
- for (int i = 0; i < argv.length - 1; i++) {
- File src = new File(argv[i]);
- new Compiler().prologToJavaSource(src.getPath(), java.getPath());
+ for (; i < argv.length; i++) {
+ new Compiler().prologToJavaSource(argv[i], java.getPath());
}
jar(out, java);
}
private static File tmpdir(String name) throws IOException {
- File d = File.createTempFile(name + "_", "");
+ File d = File.createTempFile(name + "_", "", tmpdir);
if (!d.delete() || !d.mkdir()) {
throw new IOException("Cannot mkdir " + d);
}
@@ -42,7 +45,7 @@
}
private static void jar(File jar, File classes) throws IOException {
- File tmp = File.createTempFile("prolog", ".jar", jar.getParentFile());
+ File tmp = File.createTempFile("prolog", ".jar", tmpdir);
try {
JarOutputStream out = new JarOutputStream(new FileOutputStream(tmp));
try {