From f8a1ae63ed616c4579db724a4d97effb8c216ceb Mon Sep 17 00:00:00 2001 From: Kristina Chodorow Date: Thu, 11 Aug 2016 14:44:40 +0000 Subject: Add the repository name as a parameter to the output path functions This doesn't do anything yet, it's in preparation for the execroot rearranging change. The execroot will have one bazel-out per repo, so it'll look like: execroot/ repo1/ bazel-out/ local-fastbuild/ bin/ repo2/ bazel-out/ local-fastbuild/ bin/ genfiles/ repo3/ bazel-out/ local-fastbuild/ testlogs/ and so on. Thus, any output path (getBinDirectory() & friends) needs to know what the repo name is. This changes so many places in the code I thought it would be good to do separately, then just flip the functionality in the execroot-rearranging commit. While I was poking around, I changed all of the refs I could from getPackageRelativeArtifact() to getBin/GenfilesArtifact(), so that 1) rule implementation don't have to know as much about roots and 2) they'll be more isolated from other output dir changes. `bazel info` and similar just return roots for the main repository. The only "change" is passing around a target label in the Java rules. Continues work on #1262. -- MOS_MIGRATED_REVID=129985336 --- .../java/com/google/devtools/build/lib/rules/cpp/CppLinkAction.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkAction.java') diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkAction.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkAction.java index 32782a70d8..ef5e4e474b 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkAction.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkAction.java @@ -85,7 +85,8 @@ public final class CppLinkAction extends AbstractAction implements ExecutionInfo @Override public Artifact create(RuleContext ruleContext, BuildConfiguration configuration, PathFragment rootRelativePath) { - return ruleContext.getDerivedArtifact(rootRelativePath, configuration.getBinDirectory()); + return ruleContext.getDerivedArtifact( + rootRelativePath, configuration.getBinDirectory(ruleContext.getRule().getRepository())); } }; -- cgit v1.2.3