Automated rollback of commit
*** Reason for rollback ***
This CL likely triggers a severe caching bug causing b/115864356. Rolling back to obtain a patch release of Blaze as an alternative to rolling back the Blaze release.
*** Original change description ***
Skip __init__.py in __pycache__ dir.
RELNOTES: None.
@@ -36,7 +36,6 @@ import java.util.Set;
public final class PythonUtils {
public static final PathFragment INIT_PY = PathFragment.create("__init__.py");
public static final PathFragment INIT_PYC = PathFragment.create("__init__.pyc");
- public static final PathFragment PYCACHE = PathFragment.create("__pycache__");
private static final FileType REQUIRES_INIT_PY = FileType.of(".py", ".so", ".pyc");
@@ -65,11 +64,9 @@ public final class PythonUtils {
for (PathFragment source : manifestFiles) {
// If we have a python or .so file at this level...
if (REQUIRES_INIT_PY.matches(source)) {
- // ...then record that we need an __init__.py in this and all parents directories...
+ // ...then record that we need an __init__.py in this directory...
while (source.segmentCount() > 1) {
source = source.getParentDirectory();
- // ...unless it's a Python .pyc cache or we already have __init__ there.
- if (!source.endsWith(PYCACHE)) {
PathFragment initpy = source.getRelative(INIT_PY);
PathFragment initpyc = source.getRelative(INIT_PYC);
@@ -79,7 +76,6 @@ public final class PythonUtils {
}
}
}
- }
return ImmutableSet.copyOf(result);
}
