Remove python3/ prefix to generated .pyc files.
That makes:
(a) merging PY2 and PY3 .runfiles impossible (which is incorrect anyway) and
(b) generated .py source files incompatible with 2to3 (src_version=PY2) - that's OK as we deprecate 2to3.
RELNOTES: n/a
@@ -81,14 +81,14 @@ public final class PythonUtils {
}
/**
- * 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).
+ * 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).
*/
private static Artifact get2to3OutputArtifact(RuleContext ruleContext, Artifact input) {
ArtifactRoot root =
ruleContext.getConfiguration().getGenfilesDirectory(ruleContext.getRule().getRepository());
- PathFragment path = PathFragment.create("python3").getRelative(input.getRootRelativePath());
- return ruleContext.getShareableArtifact(path, root);
+ return ruleContext.getDerivedArtifact(input.getRootRelativePath(), root);
}
/**
