From bb5d5efb4b50710241b5b374eb67084f4bf08278 Mon Sep 17 00:00:00 2001 From: Nathan Harmata Date: Wed, 17 Aug 2016 18:10:35 +0000 Subject: RELNOTES: The string list returned by the skylark 'glob' function is now sorted. Previously, it would return a list formed by concatenating the sorted results of each pattern in the 'includes' list. A bunch of cleanups and one bug fix: -Remove the unused-except-for tests GlobCache#globsUpToDate. This code has been dead for a very very long time, ever since we switched to using Skyframe. -Change the semantics of the 'glob' function as described above. -Change UnixGlob to return unsorted results. Document this in UnixGlob and GlobCache. -Change LegacyGlobber to conditionally return sorted results. Have users other than PackageFunction get sorted results (as described above). Have PackageFunction's use case get completely unsorted results, and have PackageFunction do the sorting itself. -Have PackageFunction's HybridGlobber unconditionally sort the glob result list. This ensure deterministic glob results, fixing a bug where the order of the elements of the result depended on the contents of the Skyframe graph, which of course depends on the sequence of incremental Blaze commands. -- MOS_MIGRATED_REVID=130540152 --- .../build/docgen/templates/be/functions.vm | 2 +- .../devtools/build/lib/packages/GlobCache.java | 78 ++++++---------------- .../build/lib/packages/PackageFactory.java | 39 +++++++++-- .../build/lib/skyframe/PackageFunction.java | 67 +++++++++---------- .../google/devtools/build/lib/vfs/UnixGlob.java | 17 +++-- 5 files changed, 98 insertions(+), 105 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/com/google/devtools/build/docgen/templates/be/functions.vm b/src/main/java/com/google/devtools/build/docgen/templates/be/functions.vm index 780716cfe1..33e0a4634a 100644 --- a/src/main/java/com/google/devtools/build/docgen/templates/be/functions.vm +++ b/src/main/java/com/google/devtools/build/docgen/templates/be/functions.vm @@ -402,7 +402,7 @@ This wildcard can only be used as a complete path segment. For example, and "**.java" are both illegal. No other wildcards are supported.

-Glob returns a list of every file in the current package that: +Glob returns a sorted list of every file in the current package that: