aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/vfs/UnixGlob.java
Commit message (Collapse)AuthorAge
* Use ConcurrentHashMap instead of Cache where we aren't using any of theGravatar Googler2018-08-15
| | | | | | | | LoadingCache's capabilities. According to profiles, using ConcurrentHashMap is about 3x more efficient. RELNOTES: None PiperOrigin-RevId: 208874176
* Slightly improve UnixGlob implementation. For recursive patterns, the currentGravatar Googler2018-07-31
| | | | | | | | | | | | | | | implementation leads to two identical recursive calls. This isn't harmful as there is a cache that will make the second call very cheap, but does not seem right. As a consequence, a cache is only needed if there are two recursive patterns in a single glob-path, e.g. /a/b/**/c/**/d/... as either "**" can expand to 0 or more directories (so /a/b/c/c/d could be reached in two different ways). If there is only a single recursive pattern, even with "*" placeholders, there is always a unique expansion (a "*" always represents exactly one path element). RELNOTES: None. PiperOrigin-RevId: 206753919
* Add AutoProfiler-like API to ProfilerGravatar ulfjack2018-06-11
| | | | | | - migrate all startTask/completeTask pairs to the new API PiperOrigin-RevId: 200038703
* Change profiling to only accept strings for its "description" argument. ↵Gravatar janakr2018-04-01
| | | | | | Profiling can hold onto objects for the duration of the build, and some of those objects may be temporary that should not be persisted. In particular, UnixGlob and its inner classes should not outlive loading and analysis. For the most part, care was taken in this CL to only use strings that required no additional construction, mainly to minimize garbage (retaining references to newly created strings is not as great a concern since only the strings corresponding to the slowest K tasks are retained, for some relatively small values of K). Action descriptions for actually executing actions are eagerly expanded because that work is minimal compared to the work of actually executing an action. PiperOrigin-RevId: 191251488
* Optimize Path (and the underlying String) allocations in UnixGlob for the ↵Gravatar nharmata2018-02-27
| | | | | | | | | case where a pattern like '*.blah' doesn't match all the dirents. Before the recent Path.java rewrite, the unconditional allocation here was free/amortized (in the sense that if Blaze ever had to consider the path in question, then we'd be doing the Path allocation anyway and caching the object). But now it's potentially GC churny, especially in the case where a single BUILD file has multiple glob expressions. RELNOTES: None PiperOrigin-RevId: 187185573
* Address post-commit comments in ↵Gravatar nharmata2018-01-18
| | | | | | | https://github.com/bazelbuild/bazel/commit/6f35e2d81a4d10359d39643bd03887d1b87f4224. RELNOTES: None PiperOrigin-RevId: 182415982
* Have UnixGlob explicitly handle RuntimeExceptions encountered by individual ↵Gravatar nharmata2018-01-16
| | | | | | | glob tasks. RELNOTES: None PiperOrigin-RevId: 182125500
* Replace all usages of Blaze's Preconditions class with guava.Gravatar tomlu2017-11-09
| | | | | | | | Blaze had its own class to avoid GC from varargs array creation for the precondition happy path. Guava now (mostly) implements these, making it unnecessary to maintain our own. This change was almost entirely automated by search-and-replace. A few BUILD files needed fixing up since I removed an export of preconditions from lib:util, which was all done by add_deps. There was one incorrect usage of Preconditions that was caught by error prone (which checks Guava's version of Preconditions) that I had to change manually. PiperOrigin-RevId: 175033526
* Automated conversion to Java 8Gravatar laurentlb2017-06-30
| | | | | | | With a few manual fixes for readability. RELNOTES: None. PiperOrigin-RevId: 160582556
* Allow "[", "]", "{", and "}" in globs in BUILD files. (#3048)Gravatar Jonathan Bluett-Duncan2017-06-22
| | | | | | | | | | | | PR #2679 allowed parentheses ("(" and ")") in globs, but other bracket style characters were not allowed at the time. It was decided in issues #2583 and #3048 that other bracket characters should be allowed as well, since there is no apparent historical reason for disallowing them in the first place. Closes #3166. PiperOrigin-RevId: 159691498
* Migrate UnixGlob to Path#statIfFound() instead of #statNullable(). The ↵Gravatar felly2017-04-18
| | | | | | | | | latter swallows all filesystem failures, and does not disambiguate missing files from filesystem problems. The syscall cache now tracks IOExceptions if they are present, just as it does with readdir(). RELNOTES: None PiperOrigin-RevId: 153185433
* fix: Allow parentheses in glob patternsGravatar Harmandeep Kaur2017-04-11
| | | | | | | More info here #2583 Closes #2679. PiperOrigin-RevId: 152685327
* Replace UnixGlob's package glob prefetching functionality with anGravatar Googler2016-12-02
| | | | | | | | optional method in FileSystem. Custom FileSystem implementations can use this to provide their own implementation of glob prefetching. -- MOS_MIGRATED_REVID=140736304
* Add the option --experimental_max_directories_to_eagerly_visit_in_globbing. ↵Gravatar Janak Ramakrishnan2016-10-05
| | | | | | | The first legacy glob that a package requires will, if this option is enabled, cause up to that many directories to be eagerly visited by a glob(['**']). The results are thrown away for memory reasons. -- MOS_MIGRATED_REVID=135148361
* Automated [] rollback of commit 846a5ab98fc26d72024890fdb79a5d3bc6a5a1ba + ↵Gravatar Nathan Harmata2016-08-23
| | | | | | | | | | | | | | | manual rollback of [] *** Reason for rollback *** Depot has been fixed / is in the process of being fixed. See the work tracked on [] *** Original change description *** Automated [] rollback of commit bb5d5efb4b50710241b5b374eb67084f4bf08278. -- MOS_MIGRATED_REVID=131095905
* Rollback of commit bb5d5efb4b50710241b5b374eb67084f4bf08278.Gravatar Tobias Werth2016-08-23
| | | | | -- MOS_MIGRATED_REVID=130941264
* RELNOTES: The string list returned by the skylark 'glob' function is now ↵Gravatar Nathan Harmata2016-08-18
| | | | | | | | | | | | | | 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
* Refactor UnixGlob by consolidating the context of a glob subtask into a ↵Gravatar Nathan Harmata2016-06-07
| | | | | | | GlobTaskContext object. Also dedupe identical recursive calls that arise from our naive implementation of the glob algorithm. -- MOS_MIGRATED_REVID=124159729
* Remove the dead UnixGlob#Builder#addExcludes and move some existing tests ↵Gravatar Nathan Harmata2016-06-07
| | | | | | | around so that we still have good test coverage for 'excludes' in globs. -- MOS_MIGRATED_REVID=124152499
* Use Bazel Preconditions variant which avoids varargs array creationGravatar Mark Schaller2015-12-10
| | | | | | | Reduces garbage. -- MOS_MIGRATED_REVID=109914243
* Rationalize copyright headersGravatar Damien Martin-Guillerez2015-09-25
| | | | | | | | | | | The headers were modified with `find . -type f -exec 'sed' '-Ei' 's|Copyright 201([45]) Google|Copyright 201\1 The Bazel Authors|' '{}' ';'` And manual edit for not Google owned copyright. Because of the nature of ijar, I did not modified the header of file owned by Alan Donovan. The list of authors were extracted from the git log. It is missing older Google contributors that can be added on-demand. -- MOS_MIGRATED_REVID=103938715
* In GlobVisitor, use a ConcurrentHashSet and sort the results at the end ↵Gravatar Nathan Harmata2015-08-31
| | | | | | | | | rather than use a synchronized TreeSet that maintains the result in sorted order. Consider M adds to the set resulting in N unique elements (so M >= N). The old approach was O(MlogN) and the new approach is O(M + NlogN) and has less lock contention; the time spent holding the lock is O(N) vs O(MlogN) - and actually ought to be small in practice because of the internal striping in CHS. -- MOS_MIGRATED_REVID=101784791
* Refactor the legacy globbing thread pool to make use of more modern ↵Gravatar Eric Fellheimer2015-06-29
| | | | | | | | | concurrency abstractions. Care is taken to maintain the invariant that the glob result returns after all of the work is done, even if there was an exception that cuts the task short. Interruption is an exception to this: In this case, the GlobCache later cancels the task and ensures it is done. -- MOS_MIGRATED_REVID=97000506
* Minor cleanup: Unnecessary "static" on interface.Gravatar Eric Fellheimer2015-06-18
| | | | | -- MOS_MIGRATED_REVID=96302792
* Deal properly with IOExceptions when globbing in a single thread.Gravatar Janak Ramakrishnan2015-06-17
| | | | | -- MOS_MIGRATED_REVID=96204334
* Change UnixGlob#matcher to treat "**/" and "/**" as matching zero or more ↵Gravatar Janak Ramakrishnan2015-05-18
| | | | | | | directories, as is specified in various places, not one or more. -- MOS_MIGRATED_REVID=93758086
* Some cleanup changes.Gravatar Ulf Adams2015-03-05
| | | | | -- MOS_MIGRATED_REVID=87821306
* Update from Google.Gravatar Han-Wen Nienhuys2015-02-25
-- MOE_MIGRATED_REVID=85702957