Fix flaky construction of genrule $SRCDIR
When the project root is initialized to "." the absolute paths for
genrule() srcs can be constructed as /Users/self/src/./path. This
later confuses genrule when it looks for the prefix to strip when
creating the $SRCDIR, the canonical path of a source never contains
/./ as a component.
diff --git a/src/com/facebook/buck/cli/Main.java b/src/com/facebook/buck/cli/Main.java
index 1ce2d46..96faf8d 100644
--- a/src/com/facebook/buck/cli/Main.java
+++ b/src/com/facebook/buck/cli/Main.java
@@ -585,7 +585,7 @@
}
private void runMainThenExit(String[] args, Optional<NGContext> context) {
- File projectRoot = new File(".");
+ File projectRoot = new File("").getAbsoluteFile();
int exitCode = FAIL_EXIT_CODE;
try {
exitCode = tryRunMainWithExitCode(projectRoot, context, args);