diff options
author | Damien Martin-Guillerez <dmarting@google.com> | 2016-03-31 08:24:37 +0000 |
---|---|---|
committer | Lukacs Berki <lberki@google.com> | 2016-03-31 11:44:47 +0000 |
commit | 585c87b0fce06a452976ce0d0a3091b28ed01dbd (patch) | |
tree | 90fe1b93c26b34ee7c14d0ca0c4e1f920e50607a /src/main/java/com/google/devtools/build/lib/skyframe/WorkspaceASTFunction.java | |
parent | bbb4291baf188c941965ecd894463b6ff043fe92 (diff) |
Make C++ autoconfigured toolchain the default for Linux and OS X.
This is done by adding a default workspace suffix.
--
MOS_MIGRATED_REVID=118656979
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/WorkspaceASTFunction.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/skyframe/WorkspaceASTFunction.java | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/WorkspaceASTFunction.java b/src/main/java/com/google/devtools/build/lib/skyframe/WorkspaceASTFunction.java index 46f5d0d9d1..d101139028 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/WorkspaceASTFunction.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/WorkspaceASTFunction.java @@ -52,10 +52,10 @@ public class WorkspaceASTFunction implements SkyFunction { } Path repoWorkspace = workspaceRoot.getRoot().getRelative(workspaceRoot.getRelativePath()); - PathFragment pathFragment = new PathFragment("/DEFAULT.WORKSPACE"); try { BuildFileAST ast = BuildFileAST.parseBuildFile( - ParserInputSource.create(ruleClassProvider.getDefaultWorkspaceFile(), pathFragment), + ParserInputSource.create(ruleClassProvider.getDefaultWorkspacePrefix(), + new PathFragment("/DEFAULT.WORKSPACE")), env.getListener(), false); if (ast.containsErrors()) { throw new WorkspaceASTFunctionException( @@ -69,6 +69,17 @@ public class WorkspaceASTFunction implements SkyFunction { new IOException("Failed to parse WORKSPACE file"), Transience.PERSISTENT); } } + ast = BuildFileAST.parseBuildFile( + ParserInputSource.create(ruleClassProvider.getDefaultWorkspaceSuffix(), + new PathFragment("/DEFAULT.WORKSPACE.SUFFIX")), + ast.getStatements(), + env.getListener(), + false); + if (ast.containsErrors()) { + throw new WorkspaceASTFunctionException( + new IOException("Failed to parse default WORKSPACE file suffix"), + Transience.PERSISTENT); + } return new WorkspaceASTValue(splitAST(ast)); } catch (IOException ex) { throw new WorkspaceASTFunctionException(ex, Transience.TRANSIENT); |