diff options
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/python/PythonUtils.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/python/PythonUtils.java b/src/main/java/com/google/devtools/build/lib/rules/python/PythonUtils.java index c524a3034c..7acd86c55a 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/python/PythonUtils.java +++ b/src/main/java/com/google/devtools/build/lib/rules/python/PythonUtils.java @@ -81,14 +81,14 @@ public final class PythonUtils { } /** - * Get the artifact generated by the 2to3 action. - * (There might be conflicts eg. when the input file is generated, but that case is unsupported - * because 2to3 is obsolete). + * Get the artifact generated by the 2to3 action. The artifact is in a python3 + * subdirectory to avoid conflicts (eg. when the input file is generated). */ private static Artifact get2to3OutputArtifact(RuleContext ruleContext, Artifact input) { ArtifactRoot root = ruleContext.getConfiguration().getGenfilesDirectory(ruleContext.getRule().getRepository()); - return ruleContext.getDerivedArtifact(input.getRootRelativePath(), root); + PathFragment path = PathFragment.create("python3").getRelative(input.getRootRelativePath()); + return ruleContext.getShareableArtifact(path, root); } /** |