From 86c319e313529b52da0f0fc6062c27a7e75afe5b Mon Sep 17 00:00:00 2001 From: Nathan Harmata Date: Thu, 25 Feb 2016 01:12:22 +0000 Subject: Update the glob documentation to reflect a semantic change made a very long time ago where glob(['**'], exclude_directories = 0) doesn't match the package's directory. Also add tests for this behavior. Also update Skyframe globbing to have these semantics. Any discrepancy has always been problematic, but now that we have Skyframe-hybrid globbing it's a lot more dangerous and consequential. Alternatives considered: do this the other way around (keep the stale documentation as-is and instead update legacy globbing). This would potentially require changing existing usages from stuff like 'data = glob(["**"], exclude_directories = 0)' to 'data = [x for x in glob(["**"], exclude_directories = 0) where x != '']'. I think this is too messy, so long as there is a valid use-case for globs matching directories in the first place. -- MOS_MIGRATED_REVID=115511504 --- .../java/com/google/devtools/build/lib/skyframe/GlobFunctionTest.java | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/test/java/com/google/devtools/build/lib/skyframe/GlobFunctionTest.java') diff --git a/src/test/java/com/google/devtools/build/lib/skyframe/GlobFunctionTest.java b/src/test/java/com/google/devtools/build/lib/skyframe/GlobFunctionTest.java index 0246f864e2..8fc2eb3393 100644 --- a/src/test/java/com/google/devtools/build/lib/skyframe/GlobFunctionTest.java +++ b/src/test/java/com/google/devtools/build/lib/skyframe/GlobFunctionTest.java @@ -458,7 +458,6 @@ public abstract class GlobFunctionTest { public void testDoubleStar() throws Exception { assertGlobMatches( "**", - "", "BUILD", "a1", "a1/b1", @@ -487,7 +486,6 @@ public abstract class GlobFunctionTest { public void testDoubleDoubleStar() throws Exception { assertGlobMatches( "**/**", - "", "BUILD", "a1", "a1/b1", -- cgit v1.2.3