Commit graph

475 commits

Author SHA1 Message Date
Jim Tang
a881a257ca Add Atest tab completion script.
Now Atest can autocomplete module names, dir and filenames with
tab completion, and zsh users can benefit from it.

Bug: 110629292
Test: In both bash and zsh environments:
    source build/envsetup.sh && lunch aosp_arm-eng
    atest <tab><tab>  # has candidates
    adb <tab><tab>    # has candidates
    ENVSETUP_NO_COMPLETION=atest:adb . build/envsetup.sh && lunch aosp_arm-eng
    atest <tab><tab>  # no candidates
    adb <tab><tab>    # no candidates

Change-Id: Ib1c9e02feeb8aaf75c0b97821ae26e13ba8df350
2018-07-17 14:27:32 +08:00
Makoto Onuki
da97106284 Envsetup: Add way to skip installing completions
Skip installing completion if ENVSETUP_NO_COMPLETIONS is set to 1.

Test: Following command with debug log added:
$ ENVSETUP_NO_COMPLETION=adb:fastboot:bit . build/envsetup.sh -> no completion installed
$ ENVSETUP_NO_COMPLETION=adb . build/envsetup.sh -> adb completion isn't installed
$ ENVSETUP_NO_COMPLETION=a . build/envsetup.sh -> all completions installed
$ ENVSETUP_NO_COMPLETION=fastboot . build/envsetup.sh -> fastboot completion isn't installed

Change-Id: I9f907585a1d2413f55ffcb6c7c01e49d1b55a3e0
2018-06-18 15:35:40 -07:00
Treehugger Robot
b6a2565382 Merge "Move pid, stacks from envsetup.sh to dedicated scripts." 2018-06-15 15:43:37 +00:00
Treehugger Robot
4f22abd334 Merge "Fix stacks for Java processes." 2018-06-15 00:31:07 +00:00
Josh Gao
896a546663 Move pid, stacks from envsetup.sh to dedicated scripts.
Make it so that these can be used in other scripts by moving them from
functions defined in envsetup.sh to standalone scripts.

Test: stacks zygote64
Change-Id: Id8e5ce5b4da80e57f4226eb34edaf82b87393834
2018-06-14 16:36:56 -07:00
Josh Gao
ab1e09a6b0 Fix stacks for Java processes.
Fix stacks for the change in ANR trace location by using `debuggerd -j`
instead of manually fetching the traces file.

Also, dump zygote/zygote64 as native processes, since they don't
respond to SIGQUIT.

Test: stacks zygote
Test: stacks adbd
Test: stacks com.android.settings
Change-Id: I015458bdc2dd45624940204d42614365aacf8304
2018-06-14 15:35:53 -07:00
Steven Moreland
3b99ecfbab mma in dirs w/o Android.(mk|bp) in ancestor dir
Many Android.bp files are now no longer needed (since they
are all scanned and subdirs are deprecated), so there are many
places in a tree where they aren't hit.

This still suffers from one bug, given this directory structure:
 A/B/Android.bp
 A/B/C/D/Android.bp
 A/B/C/
 A/B/C/E/Android.bp

if you call 'mma' from 'A/B/C', then it will make
MODULES-IN-A-B.

However, for now, this change makes it so given the following
directory structure:
 A/B/C/D/Android.bp
 A/B/C/
 A/B/C/E/Android.bp

if you call 'mma' from 'A/B/C', then it will make
MODULES-IN-A-B-C as expected (since there are no makefiles in
parent directories). This is the expected behavior in this case
and it is common in directories where Android.bps have been
removed (since they only referenced subdirs) or outside of
git projects.

The reason why this usecase is supported is so that given this:
A/B/C/D/Android.bp
A/B/C/D/include/D/foo.h

You can, from A/B/C/D/include/D/ (for instance) do an mma, and
it will still make the modules defined in A/B/C/D/ which are
presumably related to this.

This change doesn't fix mm or other binaries. In the long term,
either we should just consider mma to make the current directory
(and not look for parent directories for the above 'feature') or
we should move more of the complexity in the build system itself
so that it can intelligently find the first parent directory
which contains a makefile in a subdirectory.

Fixes: 65407300
Test: mma from following dirs
    system/tools/hidl/test/hash_test/bad/hash/1.0 MODULES-IN-system-tools-hidl-test-hash_test
    system/tools/hidl/test/hash_test/             MODULES-IN-system-tools-hidl-test-hash_test
    system/                                       MODULES-IN-system
    hardware/ril/                                 MODULES-IN-hardware-ril

Change-Id: I072d3f382d40cd360ec3d14f8f5b060a4bde9289
2018-06-13 15:34:19 -07:00
Elliott Hughes
2f9152618f Stop being noisy about including the bash completions.
Now most of the other noise is gone, we should probably quiet down too.

Bug: N/A
Test: `source build/envsetup.sh`
Change-Id: Ic5b169b1771163488e70d732276372efbf304bae
2018-05-04 13:21:16 -07:00
Ng Zhi An
cd2b3869f8 Remove settitle
settitle always had a bug in the PROMPT_COMMAND, it used "\033]0;",
where it should be "\033[0m". It was opt-in, and changed to opt-out, and
no one really complained that it didn't work. So we are just going to
remove this.

References:
- http://www.termsys.demon.co.uk/vtansi.htm
- https://en.wikipedia.org/wiki/ANSI_escape_code

Test: lunch and see no change in prompt
Change-Id: I777c87b4d8e80c0e9437e5d2628f6df020883389
2018-05-04 08:21:22 -07:00
Dan Willemsen
af2e1f8487 Start moving add_lunch_combo to Make
Start deprecating add_lunch_combo, preferring a list of common choices
in each AndroidProducts.mk file.

This list will be validated so that we don't have typos:

https://android-review.git.corp.google.com/c/device/generic/car/+/619533

Or targets that no longer exist.

Bug: 77599627
Test: lunch
Test: lunch 34
Test: lunch aosp_x86_64-eng
Test: lunch aosp_<tab>
Change-Id: Ie0ddaa94cbd6cee26584f56f1706a8ec1333f87e
2018-04-04 17:14:47 -07:00
Elliott Hughes
ce18dd448f Move adb/fastboot bash completion to their projects.
Bug: http://b/74443706
Test: bash completion still works
Change-Id: I21e6407f5114b438f5548be259a65d903ea73b62
2018-04-03 13:49:48 -07:00
Chih-Hung Hsieh
7ed0db8d1d Remove core/clang/versions.mk and scan-build wrapper
* Use the definitions of ClangDefaultBase and ClangDefaultVersion
  in build/soong/cc/config/global.go.
* scan-build is too old;
  replaced by better clang-tidy's -clang-analyzer-* checks.
* WITH_STATIC_ANALYZER is still effective
  to invoke ccc-analyzer or c++-analyzer.

Test: make checkbuild
Change-Id: Ifd159dd28e529d5d3c9807f5e391911365da8cdb
2018-02-15 13:38:50 -08:00
Treehugger Robot
c10bd0d859 Merge "envsetup.sh: don't assume 'cd' is builtin" 2018-01-11 03:52:46 +00:00
Dan Willemsen
dd3a27394f Remove armv5te
This architecture only existed for unbundled use, but even the NDK is
removing support in their r17 release, so just remove support for it.

Test: build/soong/build_test.bash -only-config
Test: check buildserver configs, I don't see anything still using armv5
Change-Id: Ic183b510c9ada94438bd4cc2b9362fa438a29ced
2018-01-08 15:26:16 -08:00
Steven Moreland
0540296e9f envsetup.sh: don't assume 'cd' is builtin
Some parts of envsetup.sh aren't very happy with things like
this:
function cd() {
    builtin cd "$@" && pwd && ls -l
}

here, I have s/cd/builtin cd/ one such case where envsetup
is trying to execute the output of cd.

Test: manual
Change-Id: I2774481dfbd958410682a4f773f1b8f12a0080aa
2018-01-05 20:15:36 +00:00
Elliott Hughes
7a6ef87cbe Get off my lawn forever!
Let folks opt in if they want the custom title.

Bug: https://issuetracker.google.com/38402256
Test: hitting enter no longer flashes this title
Change-Id: I8c1e1b22cc47ab9496797328fb1b13c0827840b0
2017-12-07 13:51:23 -08:00
Torne (Richard Coles)
129ab63392 resolve merge conflicts of 0c8b471be3 to stage-aosp-master
Test: I solemnly swear I tested this conflict resolution.
Change-Id: I81ec8e0660100eabdc0664cfc37198e95be95ae2
2017-10-23 11:41:58 -04:00
Treehugger Robot
0c8b471be3 Merge "Don't add empty entry to PATH." 2017-10-23 15:02:24 +00:00
Colin Cross
bce301801f Merge "Update references to build/core to build/make/core"
am: 6db8597174

Change-Id: I4be5bc1805d1900991966d24fda15f2705ee248d
2017-10-20 23:49:17 +00:00
Colin Cross
6db8597174 Merge "Update references to build/core to build/make/core" 2017-10-20 23:41:12 +00:00
Colin Cross
6cdc5d20f3 Update references to build/core to build/make/core
sed -i -e 's"\([^/]\)build/core"\1build/make/core"g' $(git grep -l build/core)

Test: m checkbuild
Change-Id: Idf3a2fed79aee5d2c07bd8e42f0c0660f253ddc2
2017-10-20 12:49:28 -07:00
Jeff Gaston
d58fb067a5 Merge "Support 'tapas help' for more-detailed tapas help"
am: 4f7fd556ae

Change-Id: I040a51338678883e42361bfdfd147554e77ba094
2017-10-19 22:20:10 +00:00
Treehugger Robot
4f7fd556ae Merge "Support 'tapas help' for more-detailed tapas help" 2017-10-19 22:12:05 +00:00
Dan Willemsen
114bf62d39 Merge "Switch envsetup.sh dumpvars to soong_ui"
am: 2023783f4f

Change-Id: I060c886c8d52a339969e43469dae5cce8cd9e198
2017-10-18 01:04:45 +00:00
Dan Willemsen
af88c41795 Switch envsetup.sh dumpvars to soong_ui
Use soong_ui instead of make&config.mk directly. This way we use a
consistent make parser and sandboxing configurations.

Test: printconfig
Test: get_build_var TARGET_DEVICE
Test: get_abs_build_var PRODUCT_OUT
Test: get_abs_build_var ALL_PRODUCTS
Test: lunch aosp_marlin-userdebug
Test: build_build_var_cache; set | grep var_cache (diff before/after)
Change-Id: I22abdf95669b7a4fb8162377e013a9013155f249
2017-10-17 13:13:30 -07:00
Torne (Richard Coles)
0091bae1ad Don't add empty entry to PATH.
When ANDROID_TOOLCHAIN_2ND_ARCH is unset (all arches except ARM64) the
PATH was being extended with an empty entry, which is interpreted as the
current directory (rarely desirable).

Test: lunch aosp_arm-eng; echo $PATH; lunch aosp_arm64-eng; echo $PATH
Change-Id: I31661241c10b06165dcf555c8b3e799fe54cc0dc
2017-10-04 12:58:30 -04:00
Jeff Gaston
9fb05d8c9f Support 'tapas help' for more-detailed tapas help
Bug: 64844028
Test: tapas help
Change-Id: I5629ca781e8cacfa6bb09828acf4160bbca3c3a5
2017-09-11 15:03:50 -07:00
Simran Basi
97053a075c Merge "Add shortcut to atest after envsetup.sh is sourced."
am: 6417aa89e4

Change-Id: Ib6ce6fa0aa878cd3bd552979fcef1a2d8c284e86
2017-08-25 18:50:32 +00:00
Simran Basi
424b876778 Add shortcut to atest after envsetup.sh is sourced.
Bug: None
Test: On master, atest points to atest in tradefed.
Change-Id: Iad6e48a12c4180f77b483cadd4c316820ede87cd
2017-08-23 12:05:36 -07:00
Jeff Gaston
d28e18c2b4 Merge "Consolidate build system usage documentation into source control" am: ea98ab2d3c am: 0f4e0a981e
am: 0339379733

Change-Id: I29e6b47a92e35344b36b28632893b16dafd46edc
2017-08-09 22:52:24 +00:00
Jeff Gaston
0f4e0a981e Merge "Consolidate build system usage documentation into source control"
am: ea98ab2d3c

Change-Id: I1a8a6189f8ae791329c7da87e78b67e8c46e20d7
2017-08-09 22:30:38 +00:00
Jeff Gaston
c6dfc4e95a Consolidate build system usage documentation into source control
Bug: 62201421

Test: make help
Change-Id: I7a7c917f767590657761396dd0545224ff98f27b
2017-08-09 12:58:30 -07:00
Dan Willemsen
f7b6dc8b24 Merge "Continue using the real make if -C is used" am: 218a0c0c70 am: 56a2bb9ec9
am: 4a1a1fc21d

Change-Id: I726a8cf5bde267b8ef881972f19f601c405e827f
2017-07-29 08:24:23 +00:00
Dan Willemsen
56a2bb9ec9 Merge "Continue using the real make if -C is used"
am: 218a0c0c70

Change-Id: I8239d2bbf96fd9d2d99a05592ce4770e18ac4187
2017-07-29 08:18:52 +00:00
Dan Willemsen
e984224899 Continue using the real make if -C is used
To allow building other make-based systems from the top of the android
tree.

Bug: 64145979
Test: get_make_command
Test: get_make_command -C
Test: get_make_command -C.
Test: get_make_command -C .
Test: get_make_command -j test
Test: get_make_command test-C
Test: get_make_command " -C"
Test: make
Test: make -C.
Change-Id: I406dd2706f19e5d2a6afdff441335f4e01ba6d12
2017-07-28 21:08:12 +00:00
Colin Cross
19bd3427d0 Merge "Use java prebuilts" am: 45d2ef40f2 am: d35fe2c55e
am: 1589539f10

Change-Id: Ie701576175eef2469de22e68623a6914ca20239d
2017-07-25 00:52:37 +00:00
Colin Cross
d35fe2c55e Merge "Use java prebuilts"
am: 45d2ef40f2

Change-Id: Icb9e7cd6ad37a5ff37fb72d12a058be79dbabf68
2017-07-25 00:47:17 +00:00
Colin Cross
e97e69359a Use java prebuilts
Point the make java variables at JDK prebuilts in
prebuilts/jdk/jdk8, add them to the path, and clean up
some old overrides.

Reapplies Ibbeb30fab96e45aedd5bb6d710d1170f85789982 after updating
some more manifests to include the prebuilts.

Bug: 62956999
Test: m -j checkbuild
Change-Id: I9e27aa5cb04d1ed09e43b798e5d654843afc000f
(cherry picked from commit 1931750940)
2017-07-20 15:14:26 +00:00
Colin Cross
f2da657628 Merge "Revert "Use java prebuilts"" am: 4d69df5191 am: f4e78ccf25
am: 96018b3d10

Change-Id: Ib54b8c0fbb95179bff97abe028d133da3528380f
2017-07-19 22:58:23 +00:00
Colin Cross
f4e78ccf25 Merge "Revert "Use java prebuilts""
am: 4d69df5191

Change-Id: I978bf3d25e0be2a2a6b40c5b396821cc2a8d9365
2017-07-19 22:52:21 +00:00
Colin Cross
02112900cc Revert "Use java prebuilts"
This reverts commit 1931750940.

Change-Id: I7a99fd6c53d35a2a674f2d60b113a727f3c453ce
2017-07-19 22:42:46 +00:00
Colin Cross
1a05e52e6d Merge "Merge "Use java prebuilts" am: 26e1b6d6c2 am: fcbaa25380" into oc-dev-plus-aosp
am: 7b38914e4e

Change-Id: I61313e8009c964868cf4984a7f86811748e98819
2017-07-19 22:19:03 +00:00
Colin Cross
fcbaa25380 Merge "Use java prebuilts"
am: 26e1b6d6c2

Change-Id: If761856f9fd509d2c5694844b6bb10966717e0b1
2017-07-19 22:13:09 +00:00
Colin Cross
1931750940 Use java prebuilts
Point the make java variables at JDK prebuilts in
prebuilts/jdk/jdk8, add them to the path, and clean up
some old overrides.

Bug: 62956999
Test: m -j checkbuild
Change-Id: Ibbeb30fab96e45aedd5bb6d710d1170f85789982
2017-07-14 14:18:53 -07:00
Dan Willemsen
4d62a6bfde Merge "Stop using make wrapper around soong_ui" am: 80c05c518b am: 757926d509
am: f734d09753

Change-Id: I1ab7eba7edab3f19af08fc4ed4ec7887347c3c9e
2017-07-13 21:49:25 +00:00
Dan Willemsen
757926d509 Merge "Stop using make wrapper around soong_ui"
am: 80c05c518b

Change-Id: I74b69fd1c6f6fd2a9feb9807770577b523656fb8
2017-07-13 21:41:26 +00:00
Dan Willemsen
d41ec5a3bc Stop using make wrapper around soong_ui
Instead of running make -> makeparallel -> soong_ui, just run soong_ui.
Soong_ui now handles user-facing argument parsing.

The user visible changes should only be:
* Most `make` command line options are no longer supported. Many didn't
do anything useful before this change either.
* `-j` is now implied, so not specifying it will default to full
parallelism instead of a single-threaded build.
* `make` debug messages are removed:
  make: Entering directory ...
  make: Leaving directory ...
  make: *** [run_soong_ui] Error 1

We still support the make workflow for users that don't use envsetup.sh
-- the build servers primarily, but also various helper scripts. These
will be converted later.

Test: in $TOP; make nothing
Test: in $TOP/bionic; make (runs real make, fails w/no makefile)
Test: in $TOP; m nothing
Test: in $TOP; mm nothing
Test: in $TOP; mma nothing
Test: in bionic/libc; m nothing
Test: in bionic/libc; mm
Test: in bionic/libc; mma
Test: in $TOP; mmm bionic/libc
Test: in $TOP; mmma bionic/libc
Test: in bionic; mmm libc
Test: in bionic; mmma libc
Test: set WITH_STATIC_ANALYZER=1, repeat above
Change-Id: Ic00190ac65a6aa924dad35d3d540c11d653b9c53
2017-07-12 17:16:49 -07:00
David Gross
832b31512b Merge "Teach mgrep to find soong/*.go files." am: 46d9bf8f9a am: bb67e3ae54 am: f515b91b3f
am: d5b0f9abe6

Change-Id: I1ea056d5997e31791153aafd149412a5e75953ce
2017-05-18 18:29:40 +00:00
David Gross
d5b0f9abe6 Merge "Teach mgrep to find soong/*.go files." am: 46d9bf8f9a am: bb67e3ae54
am: f515b91b3f

Change-Id: Idfa23df410e92a6afa7953cceb2286b3b994bbee
2017-05-18 18:25:39 +00:00
David Gross
d1d6fc5cff Teach mgrep to find soong/*.go files.
Test: $ cd $ANDROID_BUILD_TOP
      $ mgrep FORCE_BUILD_LLVM_DEBUG
      ./external/llvm/llvm-host-build.mk:24:ifeq ($(FORCE_BUILD_LLVM_DEBUG),true)
      ./external/llvm/soong/llvm.go:44:       if ctx.AConfig().IsEnvTrue("FORCE_BUILD_LLVM_DEBUG") {
      $ cd external/llvm
      $ mgrep FORCE_BUILD_LLVM_DEBUG
      ./llvm-host-build.mk:24:ifeq ($(FORCE_BUILD_LLVM_DEBUG),true)
      ./soong/llvm.go:44:     if ctx.AConfig().IsEnvTrue("FORCE_BUILD_LLVM_DEBUG") {

Change-Id: Ibe114550a8022d792a0c10c766c964a67721a6ba
2017-05-10 10:49:44 -07:00