diff options
author | Nathan Harmata <nharmata@google.com> | 2016-02-25 01:12:22 +0000 |
---|---|---|
committer | Philipp Wollermann <philwo@google.com> | 2016-02-25 14:14:35 +0000 |
commit | 86c319e313529b52da0f0fc6062c27a7e75afe5b (patch) | |
tree | 8ae5b90ffc8fa2783c53b4af75bebe53769747b2 /src/test/java/com/google/devtools/build/lib/packages | |
parent | 63da2e7998720cf20d35a961e316c786f3f4ec87 (diff) |
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
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/packages')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/packages/PackageFactoryTest.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/packages/PackageFactoryTest.java b/src/test/java/com/google/devtools/build/lib/packages/PackageFactoryTest.java index d8d799afbc..d9c175bafe 100644 --- a/src/test/java/com/google/devtools/build/lib/packages/PackageFactoryTest.java +++ b/src/test/java/com/google/devtools/build/lib/packages/PackageFactoryTest.java @@ -590,6 +590,21 @@ public class PackageFactoryTest extends PackageFactoryTestBase { assertEvaluates( pkg, ImmutableList.of( + "BUILD", + "a.cc", + "foo", + "foo/bar.cc", + "foo/foo.cc", + "foo/wiz", + "foo/wiz/bam.cc", + "foo/wiz/bum.cc", + "foo/wiz/quid", + "foo/wiz/quid/gav.cc"), + "**"); + + assertEvaluates( + pkg, + ImmutableList.of( "a.cc", "foo/bar.cc", "foo/foo.cc", |