Fail find parsing for \*

Android hit a few cases where we were searching for *.pyc or
verifiedboot*, and escaping the * as \*. In most cases the entire
argument was just quoted instead.

Kati understands and handles the quotes just fine, but it didn't realize
that \* was special, so it was searching for files that started with a
literal '\'.

We have no good way of freeing allocated memory in the find parser, so
just support stripping a leading \ (\*.pyc works, along with '\('), and
fall back to the system find if another \ is found in a token.
2 files changed
tree: 2a82ba6f5a3826685a7761082cbcf90673e472ba
  1. cmd/
  2. make-c/
  3. testcase/
  4. .clang-format
  5. .gitignore
  6. .travis.yml
  7. affinity.cc
  8. affinity.h
  9. Android.bp
  10. ast.go
  11. AUTHORS
  12. bootstrap.go
  13. buf.go
  14. buf_test.go
  15. command.cc
  16. command.h
  17. CONTRIBUTING.md
  18. CONTRIBUTORS
  19. dep.cc
  20. dep.go
  21. dep.h
  22. depgraph.go
  23. doc.go
  24. eval.cc
  25. eval.go
  26. eval.h
  27. evalcmd.go
  28. exec.cc
  29. exec.go
  30. exec.h
  31. expr.cc
  32. expr.go
  33. expr.h
  34. expr_test.go
  35. file.cc
  36. file.h
  37. file_cache.cc
  38. file_cache.h
  39. fileutil.cc
  40. fileutil.go
  41. fileutil.h
  42. fileutil_bench.cc
  43. find.cc
  44. find.h
  45. find_test.cc
  46. flags.cc
  47. flags.go
  48. flags.h
  49. func.cc
  50. func.go
  51. func.h
  52. func_test.go
  53. INTERNALS.md
  54. io.cc
  55. io.h
  56. LICENSE
  57. loc.h
  58. log.cc
  59. log.go
  60. log.h
  61. m2n
  62. main.cc
  63. make-c.sh
  64. Makefile
  65. Makefile.ckati
  66. Makefile.kati
  67. ninja.cc
  68. ninja.go
  69. ninja.h
  70. ninja_test.cc
  71. ninja_test.go
  72. pack.sh
  73. parser.cc
  74. parser.go
  75. parser.h
  76. pathutil.go
  77. pathutil_test.go
  78. query.go
  79. README.md
  80. regen.cc
  81. regen.h
  82. regen_dump.cc
  83. rule.cc
  84. rule.h
  85. rule_parser.go
  86. rule_parser_test.go
  87. runtest.rb
  88. serialize.go
  89. shellutil.go
  90. shellutil_test.go
  91. stats.cc
  92. stats.go
  93. stats.h
  94. stmt.cc
  95. stmt.h
  96. string_piece.cc
  97. string_piece.h
  98. string_piece_test.cc
  99. stringprintf.cc
  100. stringprintf.h
  101. strutil.cc
  102. strutil.go
  103. strutil.h
  104. strutil_bench.cc
  105. strutil_test.cc
  106. strutil_test.go
  107. symtab.cc
  108. symtab.go
  109. symtab.h
  110. testutil.h
  111. thread_local.h
  112. thread_pool.cc
  113. thread_pool.h
  114. timeutil.cc
  115. timeutil.h
  116. var.cc
  117. var.go
  118. var.h
  119. version.go
  120. version.h
  121. version_unknown.cc
  122. worker.go
README.md

kati

Build Status

kati is an experimental GNU make clone. The main goal of this tool is to speed-up incremental build of Android.

Currently, kati does not offer a faster build by itself. It instead converts your Makefile to a ninja file.

How to use for Android

Now AOSP has kati and ninja, so all you have to do is

% export USE_NINJA=true

All Android's build commands (m, mmm, mmma, etc.) should just work.

How to use for Android (deprecated way)

Set up kati:

% cd ~/src
% git clone https://github.com/google/kati
% cd kati
% make

Build Android:

% cd <android-directory>
% source build/envsetup.sh
% lunch <your-choice>
% ~/src/kati/m2n --kati_stats  # Use --goma if you are a Googler.
% ./ninja.sh

You need ninja in your $PATH.

More usage examples (deprecated way)

"make clean"

% ./ninja.sh -t clean

Note ./ninja.sh passes all parameters to ninja.

Build a specific target

For example, the following is equivalent to "make cts":

% ./ninja.sh cts

Or, if you know the path you want, you can do:

% ./ninja.sh out/host/linux-x86/bin/adb