Commit graph

717 commits

Author SHA1 Message Date
Treehugger Robot
cbc5cc8500 Merge "[Bugfix][Coredump] Fix coredump_enable() in envsetup.sh" am: f6aae1608d
Original change: https://android-review.googlesource.com/c/platform/build/+/2107828

Change-Id: Ic93e452300e3b919dcdcd92c165838bedb5d4e52
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-02 22:15:30 +00:00
Treehugger Robot
f6aae1608d Merge "[Bugfix][Coredump] Fix coredump_enable() in envsetup.sh" 2022-06-02 21:53:40 +00:00
Anton Hansson
ee35c25629 Merge "Change default arch for banchan to arm64" am: 3f65d6d834 am: 10129759b5
Original change: https://android-review.googlesource.com/c/platform/build/+/2105084

Change-Id: I5ae8d4e3bb2cacd79380e9dbd86e3f13d176d462
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-31 11:16:17 +00:00
Anton Hansson
10129759b5 Merge "Change default arch for banchan to arm64" am: 3f65d6d834
Original change: https://android-review.googlesource.com/c/platform/build/+/2105084

Change-Id: I71afcacff56545940e25a92ab26c9914c2bdf353
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-31 09:32:52 +00:00
Anton Hansson
3f65d6d834 Merge "Change default arch for banchan to arm64" 2022-05-31 09:12:24 +00:00
xi yu
addf4833b6 [Bugfix][Coredump] Fix coredump_enable() in envsetup.sh
-P means PID to affect (default $PPID), while -p means Pipe buffer (512 bytes), we should use -P here.

Bug: 234049197

Test: Perform ". build/envsetup.sh" in host, then run "coredump_enable $PID".

Change-Id: Id373f2a7adc56d6a40720ec900b2561c9dbea2b1
2022-05-27 04:58:22 +00:00
Usta Shrestha
8c2f467697 Merge "Allow sourcing envsetup from anywhere" am: 0e46244250 am: 596a630c65
Original change: https://android-review.googlesource.com/c/platform/build/+/2097636

Change-Id: I1470f163980b57d0c56f9dcb00f3692b3f8c8cc7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-24 18:08:31 +00:00
Usta Shrestha
596a630c65 Merge "Allow sourcing envsetup from anywhere" am: 0e46244250
Original change: https://android-review.googlesource.com/c/platform/build/+/2097636

Change-Id: Ifd8b3f9d5556a05713ae6d9043d7047b42fb5b27
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-24 17:29:31 +00:00
Anton Hansson
0328e32621 Change default arch for banchan to arm64
Devices that only support 32-bit are very uncommon. Default
to the arch that module authors are most likely to be using.

Test: banchan com.android.sdkext | grep TARGET_PRODUCT
Test: banchan com.android.sdkext arm | grep TARGET_PRODUCT
Test: banchan com.android.sdkext arm64 | grep TARGET_PRODUCT
Change-Id: I31734660318eabbe3279214980b5cdecb55ab80b
2022-05-24 15:47:40 +00:00
Usta Shrestha
1433fb357b Allow sourcing envsetup from anywhere
Bug: 232555676
Test: cd build && source envsetup.sh
Change-Id: I8491628406e494f31589249d1cc851b672dd7cae
2022-05-23 18:50:52 +00:00
Treehugger Robot
10e1b73e6e Merge "Checkpoint new build orchestrator" am: a96be433c4 am: c7de0493f1
Original change: https://android-review.googlesource.com/c/platform/build/+/2096153

Change-Id: Iea29dc64f0a6dc2a7859e4aad16261635641a002
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-12 23:59:16 +00:00
Treehugger Robot
c7de0493f1 Merge "Checkpoint new build orchestrator" am: a96be433c4
Original change: https://android-review.googlesource.com/c/platform/build/+/2096153

Change-Id: Id670437d8bb08dff6cac932cee28986a3c0bd20a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-12 23:37:59 +00:00
Joe Onorato
7cf6f97775 Checkpoint new build orchestrator
Test: rm -rf out && multitree_build
Change-Id: Ic274182f0925f30d56227597b65e5b9ef3b19707
2022-05-12 12:12:38 -07:00
Treehugger Robot
9a37e45746 Merge "envsetup.sh: fix adb tab completion" am: 1ef63b944e am: d436fa704b
Original change: https://android-review.googlesource.com/c/platform/build/+/2087123

Change-Id: I025a3b394d5c877426136f26d0a8ebc8e0f0d882
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-05 09:28:18 +00:00
Treehugger Robot
d436fa704b Merge "envsetup.sh: fix adb tab completion" am: 1ef63b944e
Original change: https://android-review.googlesource.com/c/platform/build/+/2087123

Change-Id: I9324867e6b23d6288150ac045bcfb724a381de08
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-05 09:07:17 +00:00
Mårten Kongstad
cb5c73fd9e envsetup.sh: fix adb tab completion
The adb module has been moved from system/core to packages/modules/adb.
Update the path to the adb tab completion script accordingly.

Also teach envsetup.sh to complain if completion files are not found.

Test: manual: adb tab completion works
Test: source build/envsetup.sh && declare -F _adb
Change-Id: I7d6fda3813b95e64de7b1953675f66659e750c31
2022-05-04 14:47:20 +00:00
Treehugger Robot
ed826115b7 Merge "revert addition of --skip-soong-test flag" am: 9bc50689c9 am: 3cbef527f0 am: def5eefbb7
Original change: https://android-review.googlesource.com/c/platform/build/+/2060119

Change-Id: I7f60617cc3da425444049cb8f7786a858181f3e2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-11 17:22:14 +00:00
Treehugger Robot
3cbef527f0 Merge "revert addition of --skip-soong-test flag" am: 9bc50689c9
Original change: https://android-review.googlesource.com/c/platform/build/+/2060119

Change-Id: I5bea9a572c1257509131f042df2efc196cd87fa3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-11 16:37:41 +00:00
Sam Delmerico
9d67a905b7 revert addition of --skip-soong-test flag
aosp/2045666 attempted to permit passing the `--skip-soong-tests` flag
through the `b` command to `soong_ui`, but it has been causing problems.

Test: b build '...' --skip-soong-tests is not recognized
Test: build/bazel/ci/bp2build.sh
Change-Id: I02487841d8081218dc941cb04bfa1a9e148ab6af
2022-04-11 12:27:10 +00:00
Treehugger Robot
b233bcfe39 Merge "Implement multitree lunch" am: 9d1b28ed10 am: 1080b9f3f6 am: 9ebe2e2729
Original change: https://android-review.googlesource.com/c/platform/build/+/2060107

Change-Id: Iec70a4739c1b93050b3d4827b409c554da0dd2d5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-09 03:13:22 +00:00
Treehugger Robot
1080b9f3f6 Merge "Implement multitree lunch" am: 9d1b28ed10
Original change: https://android-review.googlesource.com/c/platform/build/+/2060107

Change-Id: I8f1f7fc98a0e521a9e3347d1b140eefa657857a7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-09 00:41:56 +00:00
Treehugger Robot
9d1b28ed10 Merge "Implement multitree lunch" 2022-04-09 00:19:03 +00:00
Joe Onorato
824608c33d Implement multitree lunch
Test: (cd build/make/orchestrator/core ; ./test_lunch.py)
Change-Id: I4ba36a79abd13c42b986e3ba0d6d599c1cc73cb0
2022-04-08 13:42:55 -07:00
Treehugger Robot
4e72e7557f Merge "prevent unintended m bp2build "" when running b" am: 54dbc8c36a am: 83cd363614 am: 7a1cca449f
Original change: https://android-review.googlesource.com/c/platform/build/+/2055109

Change-Id: I32e8c53f9dfd4f7e2dd5edccaf118fec9a513f36
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-05 20:44:35 +00:00
Treehugger Robot
83cd363614 Merge "prevent unintended m bp2build "" when running b" am: 54dbc8c36a
Original change: https://android-review.googlesource.com/c/platform/build/+/2055109

Change-Id: I654dd587a07486f03d8ab1aa761c1f972e3fada1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-05 19:47:47 +00:00
Sam Delmerico
89a4702555 prevent unintended m bp2build "" when running b
cl/2045666 allowed the --skip-soong-tests flag to pass through
invocations of the `b` command to soong_ui. But when the flag was
missing, an extra `""` argument was passed instead which caused soong_ui
to invoke a build of the droid target.

Test: m clean && b build '...'  # verify Soong does not run a build
Change-Id: I7b99437d225786eb1698a88d0c755ce897550e70
2022-04-05 13:47:32 +00:00
Treehugger Robot
a92032b7c6 Merge "add flag to skip soong tests for b command" am: 375dd60d5a am: 9244deabb0 am: 6fa65aef1c
Original change: https://android-review.googlesource.com/c/platform/build/+/2045666

Change-Id: I9b51987a12706961df931277d186c5a467c239bc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-03-30 20:43:50 +00:00
Treehugger Robot
6fa65aef1c Merge "add flag to skip soong tests for b command" am: 375dd60d5a am: 9244deabb0
Original change: https://android-review.googlesource.com/c/platform/build/+/2045666

Change-Id: Ia62bc9642e7f2d2a688a19e5ca166987acb36057
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-03-30 20:20:13 +00:00
Sam Delmerico
ef43149136 add flag to skip soong tests for b command
Sometimes it is very handy during testing to temporarily skip Soong
tests, but there is not easy method to allow this without changing the
envsetup.sh file and re-sourcing before/after enabling/disabling the
skip-tests flag.

Test: b build '...' --skip-soong-tests
Change-Id: I6dcad3ba0336cfd1c4d2c4357b852900792445c3
2022-03-29 14:39:33 +00:00
Will Burr
79626450f0 Merge "envsetup.sh: Update text in lunch menu for clarity" am: 44adfa7f8c am: 0b828a50c7 am: c838e15827 am: 0bc5e16871
Original change: https://android-review.googlesource.com/c/platform/build/+/1974422

Change-Id: I20ec8376a69d29454a5d365d9e45052cba5e7ddf
2022-02-09 20:37:03 +00:00
Will Burr
0bc5e16871 Merge "envsetup.sh: Update text in lunch menu for clarity" am: 44adfa7f8c am: 0b828a50c7 am: c838e15827
Original change: https://android-review.googlesource.com/c/platform/build/+/1974422

Change-Id: I6f2c3d6aa414773e6aa737800a886762801112cd
2022-02-09 20:22:05 +00:00
Will Burr
404012020f envsetup.sh: Update text in lunch menu for clarity
Updates the lunch menu text to make it clearer that the choices in lunch
menu are not fully comprehensive. As the list comes from common lunch
choices the text now refers to 'common combinations' and informs that
you can 'specify your own'. This should help developers who are unsure
why they cannot find their desired lunch target in the list.

Change-Id: Ib9d55ee46b7037c30a8f4b43fdd552ea66e887e8
Test: source build/envsetup.sh && lunch
2022-02-09 15:25:17 +00:00
Presubmit Automerger Backend
4dd821f386 [automerge] Add a keys argument to tapas 2p: 5ff4380b5d
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/+/16804130

Bug: 216553104
Change-Id: Ibc4ef4f682bbdb50c3aef23ee9cf4e68c247f7de
Merged-In: I2161be9e15f99713e11d22901d6eb7ad3c420093
2022-02-07 18:50:33 +00:00
Colin Cross
5ff4380b5d Add a keys argument to tapas
Add a keys argument to tapas that allows specifying devkeys to
use internal aosp_devkeys_* products that use the internal
devkeys, which will allow building unbundled apps that use platform
keys for testing.

Bug: 216553104
Test: tapas CarMediaApp devkeys
Change-Id: I2161be9e15f99713e11d22901d6eb7ad3c420093
Merged-In: I2161be9e15f99713e11d22901d6eb7ad3c420093
2022-02-07 18:50:22 +00:00
Colin Cross
7f49a67d0d Add a keys argument to tapas
Add a keys argument to tapas that allows specifying devkeys to
use internal aosp_devkeys_* products that use the internal
devkeys, which will allow building unbundled apps that use platform
keys for testing.

Bug: 216553104
Test: tapas CarMediaApp devkeys
Change-Id: I2161be9e15f99713e11d22901d6eb7ad3c420093
2022-01-28 16:56:43 +00:00
Treehugger Robot
2495360637 Merge "Ensure there are no empty paths in ANDROID_BUILD_PATHS and PATH." am: 46bd6ec0f6 am: 1ec033c132 am: 8676adc660 am: fd8a495fff
Original change: https://android-review.googlesource.com/c/platform/build/+/1900564

Change-Id: I5557c20f12bb9d17c9a09ee4b1a325bcd66f0515
2021-11-24 20:35:52 +00:00
Martin Stjernholm
6a012266a1 Ensure there are no empty paths in ANDROID_BUILD_PATHS and PATH.
Test: lunch armv8
      - Check that PATH has no "::".
      - Check that an executable script in CWD doesn't get executed.
Change-Id: I3a97eb661c614ff2e09723e9ccca0bdeb63dbdc5
2021-11-24 14:59:15 +00:00
Kousik Kumar
d086b0918a Merge "Remove unnecessary RBE sourcing in envsetup.sh" am: 8bd19a4143 am: 49433fefde am: 3a42b842ba am: 49fd1bb0b3 am: 2fb7d4ab03
Original change: https://android-review.googlesource.com/c/platform/build/+/1877136

Change-Id: I237f25a6ba0f0a32b42742b83164861d13862825
2021-11-09 21:39:54 +00:00
Kousik Kumar
bd9b9b0226 Remove unnecessary RBE sourcing in envsetup.sh
We no longer need these since we switched to config files and I missed removing them. So removing them now

Bug: b/202340353
Change-Id: Ibab8ab8d4a45e01d2c98632ccee2684ea600ff69
2021-11-01 01:36:03 -04:00
Treehugger Robot
7f5cee09f9 Merge "Support -s in installmod command" am: 8cdc80bc24 am: 12f85f31e3 am: e7af6fa1e6 am: 493776ffd7 am: 82a39a7d70
Original change: https://android-review.googlesource.com/c/platform/build/+/1869665

Change-Id: Ia6ce242ae4012af90def209d8c6fe5d4cf78809c
2021-10-26 02:27:14 +00:00
Cole Faust
3e1923867a Support -s in installmod command
The -s flag must be passed before the adb command,
as in `adb -s emulator-5554 install myapp.apk`
instead of `adb install -s emulator-5554 myapp.apk`.
Parse it and move it to the correct location if it
exists.

Test: Manually
Change-Id: I4b296d7fe4efbe3b25d21d33a8082b321787651a
2021-10-25 13:43:48 -07:00
Treehugger Robot
eb94295e66 Merge "Remove removed selinux prebuilts from $PATH" am: 472833c0dc am: 7418e06869 am: a3d538864e am: e99a5383e7 am: 6b03f45367
Original change: https://android-review.googlesource.com/c/platform/build/+/1842319

Change-Id: Iaafd915aef68bd0785592f8ded95f6cef33cd4da
2021-10-01 07:20:31 +00:00
Dan Willemsen
838dcece45 Remove removed selinux prebuilts from $PATH
These were removed in https://android-review.googlesource.com/c/platform/external/selinux/+/1807296

Change-Id: If13bbeff5e14dc0bcc2e1f30ba5d7eab8d0ff6e3
2021-09-30 22:40:38 +00:00
Jingwen Chen
0dc9e9aee0 Merge "Remove module_name_to_label short circuit from m." am: 4528968faf am: 6492201d28 am: 12b73bc1f5 am: 685f419e0f am: 457d4dbda7
Original change: https://android-review.googlesource.com/c/platform/build/+/1829694

Change-Id: I459026895d210c9e7dbf2b46191600fa43815558
2021-09-20 12:32:59 +00:00
Jingwen Chen
0e4eba1544 Remove module_name_to_label short circuit from m.
This wasn't adding much value, let's remove it for now until we decide
on how mixed builds will be exposed for users later.

Test: USE_BAZEL_ANALYSIS=1 m droid
Change-Id: I16465fd7759646964ea8c50aab6ab91f47c5e8d1
2021-09-17 08:45:30 +00:00
Treehugger Robot
0fa85301dc Merge "Replace GENERATE_BAZEL_FILES=1 with "m bp2build"." am: f673d10736 am: af7f572207 am: d6d5fbd463 am: 375370fdaa am: d10de8bd7d
Original change: https://android-review.googlesource.com/c/platform/build/+/1818098

Change-Id: If9ca0f92a1dd6edce46dc4d3e803b9d4231ae4a5
2021-09-07 11:01:34 +00:00
Lukacs T. Berki
3fef660fae Replace GENERATE_BAZEL_FILES=1 with "m bp2build".
This should have been submitted in the pertinent topic, but I messed by
git repositories up.

Test: Presubmits.
Change-Id: I7f3e9648c1961169ff40c8e2ddaf3d893498f625
2021-09-07 08:20:33 +02:00
Treehugger Robot
6bba054440 Merge "Add a prompt to try out RBE for local builds" am: f72c0facd3 am: 859caa8d1e am: ac007172d0 am: 33de4bbe25 am: 11dd7c70d6
Original change: https://android-review.googlesource.com/c/platform/build/+/1806336

Change-Id: I92c3a4e359267ad9a03197f1a3bd63b7fda0e5c4
2021-08-23 22:10:38 +00:00
Kousik Kumar
09af254c8f Add a prompt to try out RBE for local builds
This is to nudge developers to use RBE especially when they run into
long builds and do NOT have RBE turned on.

Change-Id: I7da94763f5387310e522931bf650f9d7c01dc7f2
2021-08-23 14:55:35 -04:00
Kousik Kumar
743c4a0e6a Merge "Add the ability to source RBE related scripts from envsetup.sh" am: 660fdcd664 am: 2a678d73ab am: d66723fbe6 am: 53d07e9f0d
Original change: https://android-review.googlesource.com/c/platform/build/+/1766185

Change-Id: Iffe667b37563c1fc587e567af3449e5d34b8123c
2021-07-14 19:51:56 +00:00
Kousik Kumar
721533e0d6 Add the ability to source RBE related scripts from envsetup.sh
This is so that developers don't have to remember to source a separate
script to source RBE related variables.
I'll modify the docs once this change is submitted.

Test:
Ran forrest build with fix for previous build failure - https://android-build.googleplex.com/builds/abtd/run/L72300000950316038

Bug: b/193407413
Change-Id: I16f057086e2ee4f5918816ea70dbb33d0f5e99ab
2021-07-14 11:31:54 -04:00
Ahaan Ugale
04a01c67d6 Merge "Revert "Add the ability to source RBE related scripts from envsetup.sh"" am: 203c72ee23 am: 3fafb9b720 am: b84510e31e am: a98c3d76c3
Original change: https://android-review.googlesource.com/c/platform/build/+/1764839

Change-Id: Ie229b1ccac498c5a1df30b1a25a3aeefae84637c
2021-07-13 23:20:26 +00:00
Ahaan Ugale
678f26c1e7 Revert "Add the ability to source RBE related scripts from envsetup.sh"
This reverts commit 9aa9e47b8c.

Reason for revert: DroidMonitor-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?branch=git_rvc-qpr-dev-plus-aosp&target=ndk&lkgb=7546337&lkbb=7546521&fkbb=7546426, bug https://buganizer.corp.google.com/issues/193566521

Fix: 193566521
Change-Id: I7196a00006499f729baa86a252b0df6535c6aeaa
2021-07-13 22:12:24 +00:00
Treehugger Robot
3cdbcac1a6 Merge "Add the ability to source RBE related scripts from envsetup.sh" am: 10935cf315 am: 85382dcfec am: 955e561ffa am: 1023e9f615
Original change: https://android-review.googlesource.com/c/platform/build/+/1763565

Change-Id: I2bd1d35db99b204e4bb406609b0d0fbc33b03f2c
2021-07-13 21:15:15 +00:00
Kousik Kumar
9aa9e47b8c Add the ability to source RBE related scripts from envsetup.sh
This is so that developers don't have to remember to source a separate
script to source RBE related variables.
I'll modify the docs once this change is submitted.

Test:
USE_RBE=true source build/envsetup.sh sources RBE variables.
USE_RBE=false source build/envsetup.sh does NOT source RBE variables.
source build/envsetup.sh does NOT source RBE variables.

Bug: b/193407413
Change-Id: Ib8abf4c307b02fbb0c63b8a62d7aeda8be42d0fb
2021-07-12 14:05:13 -04:00
Treehugger Robot
3299f7e724 Merge "Direct Bazel builds from m." am: 186c7779f1 am: 65b4bb73cc am: 3cd5e84603 am: c9ed94626c
Original change: https://android-review.googlesource.com/c/platform/build/+/1737506

Change-Id: I321d571acddffa88f53085beceda85c8f0cc7a15
2021-06-21 19:54:34 +00:00
Jingwen Chen
bfa114d05b Direct Bazel builds from m.
This CL extends the `m` function to short circuit to Bazel iff:

1) USE_BAZEL_ANALYSIS is set to 1 or true
2) There is only 1 Soong module requested to be built
3) The Soong module has a corresponding Bazel alias target in @soong_injection//targets/BUILD to the real target in out/soong/workspace.

Test: TH
Change-Id: I976ffa53106c0b52c75b71f1e0e1e8b3ef5cb3d1
2021-06-21 06:12:33 +00:00
Treehugger Robot
6cd53418f8 Merge "Show bazel help for b called without args." am: bb53fe394b am: 541174975b am: 561e16a0a5 am: bbdac0940c
Original change: https://android-review.googlesource.com/c/platform/build/+/1737501

Change-Id: I5defbca387879b6913cd04b993a500630dfb7678
2021-06-17 03:22:29 +00:00
Jingwen Chen
69f9ed14a9 Show bazel help for b called without args.
This is less surprising than trying to use --config=bp2build as the only args, which is invalid.

Test: source build/envsetup.sh; b
Change-Id: I0b3724d05b8cc149268e660eb672192fe9bad19d
2021-06-16 09:44:57 +00:00
Anton Hansson
43e582a0c0 Merge "Add help message for likely typo to lunch" am: 757e2e1fc1 am: 47bebaca8b am: e444a5c3fb am: 86eac1d610
Original change: https://android-review.googlesource.com/c/platform/build/+/1736893

Change-Id: Id6a3738ea35587f36b1fb8f3669e91ac378c6b19
2021-06-15 17:47:46 +00:00
Anton Hansson
32fa7ee8c3 Add help message for likely typo to lunch
Test: lunch aosp_blueline_userdebug
Change-Id: Ieb8059d1717a98f66d61387d6bfd28470835eb6e
2021-06-14 17:21:22 +01:00
Jingwen Chen
0b7f33bbdb Merge "Improve bazel() warning in envsetup.sh." am: c137b8520b am: e0b4775fed am: c9e50e33b1 am: 62aec15055
Original change: https://android-review.googlesource.com/c/platform/build/+/1732933

Change-Id: I340d0dda6e074a1dd256c5b373a425a6bb14125a
2021-06-10 11:33:01 +00:00
Jingwen Chen
17d569940f Improve bazel() warning in envsetup.sh.
Fixes: 190688038

Test: source ~/aosp/build/envsetup.sh && cd / && bazel
Change-Id: I309a77e109d8b3a65c4b28aeb5fbf2a059006ee0
2021-06-10 08:17:54 +00:00
Jingwen Chen
14e8d673a1 Merge "Introduce b into envsetup.sh." am: ec11d42e3b am: eb5ad873b7 am: 75941f99fe am: 88ca5a67c0
Original change: https://android-review.googlesource.com/c/platform/build/+/1710468

Change-Id: Id5a27695451f071d853cfa24b44a9becdb2e24c7
2021-05-20 02:46:29 +00:00
Jingwen Chen
d728ee1a06 Introduce b into envsetup.sh.
`b` is a function that combines:

1. Integrated generation of a synthetic bazel workspace, containing
symlinks to BUILD and bzl files alongside symlinks to the source tree.
This is the --package_path of the bazel build.
2. Running the Bazel build itself with b's entire argv.

A user accustomed to typing `bazel build <targets>` would
now type `b build <targets>`.

Test: source build/envsetup.sh; b build //bionic/...; b cquery --output=label_kind //bionic/...
Fixes: 188490434
Change-Id: I36e366108b024c09945d764a1115786658e03681
2021-05-18 23:37:39 +00:00
Kousik Kumar
41dacd1870 Add a warning to lunch command for metrics collection
When metrics collection is enabled but
there's no gcert, print a warning and ask the user to run gcert so that
metrics collection can work.

Bug: b/184040091
Change-Id: Ib79c61e89a42dc7da9ef452b7101dac955859a7d
2021-05-12 09:56:20 -04:00
Joe Onorato
0bac4fe09d Make verifymodinfo in envsetup.sh quiet on errors during tab completion
Test: m <tab><tab> before having done a full build.
Test: m <tab><tab> after having done a full build.
Change-Id: I35154151e6902d0337a26eab27d9d4fc797beed7
2021-04-29 15:44:29 -07:00
Joe Onorato
4acbe3b416 Use python3 specifically for envsetup.sh
Test: . build/envsetup.sh ; m <tab>
Change-Id: I94152c567f179fd7829bc675766e764624e5b7a3
2021-04-29 15:44:29 -07:00
Colin Cross
fa50d406bb Clear TARGET_PRODUCT and TARGET_BUILD_VARIANT when getting lunch menu
An old TARGET_PRODUCT value pointing to a removed product or an invalid
TARGET_BUILD_VARIANT value cause lunch to fail to read
COMMON_LUNCH_CHOICES, clear them before calling into the build with
get_build_var.

Test: TARGET_PRODUCT=foobar TARGET_BUILD_VARIANT=foobar lunch
Change-Id: I53d205784149ba7e32cc093f9d81d1a82c08bfc0
2021-04-22 13:05:41 -07:00
Martin Stjernholm
215596dd59 Merge "Allow selecting a different product in banchan." 2021-04-20 11:22:00 +00:00
Treehugger Robot
9dbecd650f Merge "envsetup: fix indent" 2021-04-19 18:16:08 +00:00
Martin Stjernholm
2b8d923a09 Allow selecting a different product in banchan.
Necessary since the products used for APEX modules are different in
internal builds.

Test: banchan com.android.art
Test: banchan com.android.art arm
Test: banchan com.android.art art_module_arm
Test: banchan com.android.art module_arm
Test: banchan com.android.art x86_64
Test: banchan com.android.art art_module_x86_64
Bug: 179779520
Change-Id: Ib59a86b70e409537aaad7258465b6874b589b858
2021-04-19 18:32:00 +01:00
Timi
0469c3f91c envsetup: fix indent
Test: . build/envsetup.sh
Change-Id: I829dafc707dc02d5a31899a784f88a367ec95e94
Signed-off-by: Timi <timi.rautamaki@gmail.com>
2021-04-19 17:07:53 +02:00
Martin Stjernholm
f692c756f7 Add new user setup command banchan for module building.
It currently uses TARGET_BUILD_APPS just like tapas, but the use case is
different and it may diverge more in the future.

Test: banchan com.android.art
Test: banchan help
Test: banchan
Test: hmm
Bug: 179779520
Change-Id: Iae718e65a2a7212c741c397e03c6f9a6d5ee8951
2021-04-13 02:07:04 +01:00
Taesu Lee
ea0cecd9e4 Add "ktgrep" for Kotlin
New ktgrep is added and sgrep/treegrep also scan *.kt files.

Test: kgrep/sgrep/treegrep for Kotlin files.

Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
Change-Id: Ie615aa86c4958310785392f18ee7bddaf64706a9
2021-03-16 15:10:34 +09:00
Joe Onorato
2c1aa47057 Add dirmods command to envsetup.sh
It will query module-info.json for modules inside a given directory.

Test: . build/envsetup.sh ; dirmods frameworks/base
Change-Id: Iad3dcb038315f49c156764e34fb5f52ec3ad29be
2021-02-26 08:57:23 -08:00
Alistair Delva
176e534edb Rename rgrep to rsgrep
rgrep is a common alias for 'grep -r' and this new macro was confusing.

Test: cd external/rust/crates
    rsgrep test
Change-Id: If71cdcc926455983a04a80982356e9feb61968fe
2021-02-22 13:32:07 -08:00
Jeff Vander Stoep
1431ab8cf9 envsetup: add rgrep for local Rust files
Test: cd external/rust/crates
    rgrep test
Change-Id: I69fa770742c0dc20259346acaf1184c19675b3a7
2021-02-02 19:18:26 +01:00
Cole Faust
24c36dbeec Add outmod and installmod commands
These are analogs to pathmod/gomod that find/install
the module's apk instead of cd'ing to its source
directory.

Bug: None
Change-Id: Iad750e154397f7cfcdd620f1ed6478b05c1225bb
Test: Manually, with bash and zsh
2021-01-26 01:50:18 +00:00
Jingwen Chen
c8b5e196ce Pipe bazel() note text to stderr.
This allows subshell-ing bazel, e.g. bazel build $(bazel query //...)

Test: . build/envsetup.sh; bazel build $(bazel query <expression>)
Change-Id: If28b63769032b61e150422cb5b9b4e55c14cd13d
2020-12-14 18:51:50 -05:00
Jiyong Park
c02b1c463e Export SOONG_HOST_OUT as ANDROID_SOONG_HOST_OUT
Some host tools (launch_cvd, etc.) have been using HOST_OUT.
As their dependencies are now installed by soong, the tools should refer
to SOONG_HOST_OUT. Export it as ANDROID_SOONG_HOST_OUT.

Bug: 172065015
Test: build aosp_cf_x86_phone, execute launch_cvd
Change-Id: Ie175049f15b89485feec0d33d82e756b12a7ad8a
2020-11-03 11:06:39 +09:00
Alessandro Astone
c8771bef56 build: allow refreshmod with external out directory
Get a relative path to out by using $(get_build_var PRODUCT_OUT)
instead of hardcoding it to out/target/product/$TARGET_DEVICE.
That will correctly return the path to the out directory
when setting an external OUT_DIR_COMMON_BASE.

Change-Id: I8a990b710222bc72755c6b6b88fd0c9e80711e14
2020-10-27 13:39:59 +01:00
Rupert Shuttleworth
5d60d02454 Rename abazel() to bazel(), give a warning if clobbering an existing Bazel, and have it call tools/bazel (aka build/bazel/bazel.sh) to start Bazel.
Test: Manually.
Change-Id: I5605571147db33c6b6a008cedbf279bb909ecdee
2020-10-26 09:21:55 +00:00
Patrice Arruda
aa4b824d25 Source vendorsetup.sh scripts anywhere within the repo.
When sourcing the envsetup.sh script from a deep directory
inside of the repo, the vendorsetup.sh scripts are not being
sourced. This was causing the ANDROID_ENABLE_METRICS_UPLOAD
not to be set and developer's metrics were not being uploaded.
Provided the top directory to each directory path. Also cleaned
up the function to handle whitespacing correctly.

Bug: b/169699936
Test: *Ran source ../../build/envsetup.sh from external/libchrome dir
      *Renamed repo dir to "aosp master" and source build/envsetup.sh
      *Ran the script in zsh command line interpretor
      *Ran the script in MacOS
Change-Id: I96eb73d50a1923cdda782792778b0d185a341cf9
2020-10-14 15:33:44 +00:00
Rupert Shuttleworth
131fa7d866 Add abazel() function to envsetup.
Test: Tested manually on Linux and macOS.

Change-Id: I17f061c2d9135a7a309fc0750cc44cb30d455bc7
2020-10-13 04:26:09 +00:00
Ben Taitelbaum
8c2c9cfa9d Fix conflict with common zsh alias
oh-my-zsh common-aliases plugin defines `alias -g T='| tail'`, which causes an
error with the line `local T dir f`.

Making these lines more explicit resolves this issue, while also being clearer
that the intent is to clear out the local variables.

Bug: 169191000
Fix: 169191000
Test: source build/envsetup.sh; lunch <target>; m
Change-Id: Ief27aa3d9f541d0c39c6c11d7d771818d6493d31
2020-09-29 20:50:57 +00:00
Treehugger Robot
cecc644055 Merge "envsetup.sh: add 'syswrite' function" 2020-09-22 18:34:24 +00:00
Steven Moreland
74114f1e69 envsetup.sh: add 'syswrite' function
This function:
- disables verity on the device
- reboots the device only if it is needed
- remounts partitions on the device

Bug: 167697453
Test: syswrite
Change-Id: I23c3e88daaa2b334233f4faf7fe8f8244cd56225
2020-09-17 01:42:32 +00:00
Dan Albert
bab814f330 Add a showcommands function to envsetup.
This is similar to the old `m showcommands`, but operates on specific
output paths instead and does not require a build aside from the
initial invocation of soong to generate the ninja files. The
`--regenerate` option is accepted that causes the ninja file to be
regenerated first, but this is not the default because it is slow.
Just note that without this flag results may be stale.

It unfortunately doesn't work for everything in out. For example,
`$OUT/system/lib/libc.so` won't work because it is a symlink that
isn't in the build graph, but `$OUT/system/lib/bootstrap/libc.so`
works.

Test: showcommands out/target/product/walleye/system/lib/libz.so
Bug: None
Change-Id: I4cfded3db994044870fc71ae4bcf9a69224b1e15
2020-09-16 16:20:59 -07:00
Sasha Smundak
90d07bc72d Do not print environment variables if ANDROID_QUIET_BUILD is set.
Test: manual
Change-Id: I17c24beb9f0008e038a739a06027266b57e17e7a
2020-06-04 10:48:15 -07:00
Matt Alexander
d9c56568de Revert "Minor cleanup for script consistency and adherence to Google shell style guide."
This reverts commit d92718356d.

Reason for revert: Adding the opening brace to the end of the function breaks lunch.  

Change-Id: Ia3a9ff01964de0e616a534058d568150de32558a
2020-05-21 10:49:17 +00:00
Matt Alexander
d92718356d Minor cleanup for script consistency and adherence to Google shell style guide.
Test: manual

Change-Id: Ie9fd197cee5e934a0b89898b85d1a97adcec6348
2020-05-20 19:21:38 +00:00
Steven Moreland
ab25c7a30f Update refreshmod docs.
This also affects pathmod here.

Since it's updating module-info.json, we could say that as well (this
should affect any tools which parse this file), but I haven't seen any
indication it's necessary in this context.

Bug: N/A
Test: N/A
Change-Id: Iecb6f454112b5c0095ee7063bc5442fdb1e3bd09
2020-04-09 12:05:34 -07:00
Roland Levillain
23c46cf424 Print a user-friendly message when lunch cannot use the default product.
In some environments (e.g. with the master-art branch), the default
product (aosp_arm-eng) cannot be built, and thus prevents `lunch` from
printing the lunch menu (as it cannot initialize the build system in
order to fetch the common lunch choices). When this happens, show an
explicit error message from `lunch` instead of a Soong UI error.

Test: Check that this command line displays the expected error message:
        unset TARGET_PRODUCT && . build/envsetup.sh && lunch
Bug: 152762648
Change-Id: I40c66bca5b075d88dbc8364b36b2db713e6ad93e
2020-04-08 13:09:49 +01:00
Elliott Hughes
f71c05a8e5 Remove unused mips workarounds.
This was never really finished, and hasn't been supported for years.

Test: treehugger
Change-Id: I7668088d1449f33025aaf36fae0817894c84a877
2020-03-06 16:46:59 -08:00
Christopher Tate
e2fe95903b Include .proto in sgrep()
Test: use in frameworks/base
Change-Id: I8104822cf69b09b3d11edb9261b8ab43029549d7
2020-03-05 11:34:16 -08:00
Steven Moreland
92793dc56c lunch: error on >1 arg (before ignored)
Bug: N/A
Test: lunch w/ 0, 1, and 2 args
Change-Id: Icbeb511e836b08cbd64b08a23b0e4820039b12ab
2020-02-25 18:33:53 -08:00
Stephen Hines
aa8d72c93f Add ASAN_SYMBOLIZER_PATH for SANITIZE_HOST=address builds.
Bug: http://b/30877494
Test: source build/envsetup.sh && echo $ASAN_SYMBOLIZER_PATH --version
Change-Id: I669a5762cc2cea26c0c29f935abde6c14eb0ced7
2020-02-04 09:16:28 -08:00
LuK1337
b6a7819be6 Make allmod() and pathmod() py3 compatible
Change-Id: I8d58f2f64c03d54449844269974367f31de6ad31
2020-01-12 03:12:17 +01:00
Treehugger Robot
49aa6fc009 Merge "Update the docs for 'mm[m][a]'" 2019-11-01 06:42:14 +00:00
Dan Willemsen
67074fec61 Update the docs for 'mm[m][a]'
Make it explicit that we will build *and* install all the modules under
the directories. And that 'mm[m]' is now the same as 'mm[m][a]'.

Test: hmm
Change-Id: I86c42229f8cdc24922fb3014777ad13d72a1c0ea
2019-10-30 12:35:34 -07:00
Orion Hodson
831472dee1 Update finding go files
Add gogrep for grepping golang files.

Extend mgrep to search for files in subfolders of build and soong
directories.

Test: source build/envsetup.sh && gogrep DepsMutators
Test: source build/envsetup.sh && mgrep ProductPrivateSepolicyDirs

Change-Id: I26fd9ba5ba0b81b202154aa527ed4a0aa60c1c54
2019-10-30 10:07:17 +00:00
Treehugger Robot
3da3191366 Merge "Fix zsh compatibility issue in build/envsetup.sh" 2019-10-08 11:41:26 +00:00
Dan Willemsen
91763e93e6 Fix lunch choices w/zsh
zsh doesn't split variables (by default), but it will split command
output. bash will split both. Apparently a portable way to do this in
both is to just turn it into another command: "$(echo $var)".

Test: source build/envsetup.sh; lunch (see list; repeat in bash and zsh)
Change-Id: I9716a8d77aefdf05da8923deb9e37e0b6132b549
2019-10-03 15:15:37 -07:00
Guillaume Chelfi
ce000fdc4d Fix zsh compatibility issue in build/envsetup.sh
Arrays are zero indexed in bash and one indexed in zsh by default. This
leads to an off-by-one issue in the `godir` and `choosevariant` commands: when
prompted to chose an option, in order to pick option "n" you have to input
"n+1".

In those two specific instances, by using "substring expansion" instead of
array indexing, one can get consistent behaviour between bash and zsh
(equivalent to zero indexing).

Test: manual -
 # godir
 $ zsh
 $ source build/envsetup.sh
 $ godir SurfaceFlinger # There should be many options
 # Pick 1, check that you end up in the right location
 $ godir SurfaceFlinger.cpp # There should be only one possibility
 # make sure you end up in the right location
 # repeat with bash (to ensure compatibility is not broken)

 # choosevariant
 $ zsh
 $ source build/envsetup.h
 $ choosevariant # pick whatever variant you want
 $ printconfig # make sure the variant matches your choice
 # repeat with bash (to ensure compatibility is not broken)

Change-Id: I998d8fb48b708066b6db28a2129a2b09785fb0b1
2019-10-03 12:02:46 +02:00
Steven Moreland
115d1f58d7 Update SANITIZE_HOST documentation.
Should be set to 'address' not 'true'.

Bug: N/A
Test: `hmm`
Change-Id: I29c0105f0b29c51a6e3d7ce75756d7d25b7fc7e7
2019-09-27 19:20:33 +00:00
Steven Moreland
8f0a62ab3f Detect leaks on host by default.
Right now, leaks are disabled globally on host. This is problematic
because:
a). people write leaks in new code
b). if we fix leaks in old code, it doesn't get tested
c). fixing leaks in old code is harder because when we set
    ASAN_OPTIONS="" locally, other targets start hitting errors,
    and we have to set __asan_default_options there

Fixes: 141313466
Test: host ASAN build passes
Change-Id: I89298c7518c016e6a30884c75d7b791db16a5217
2019-09-24 18:28:39 -07:00
Colin Cross
cb8337ddcb Gather lunch choices before printing prompt
Get the lunch choices before starting to print the lunch menu prompt
so that it doesn't sit at `Lunch menu... pick a combo:` with no
choices for a few seconds.

Fixes: 138719635
Test: lunch
Change-Id: I2bb373ec037bff0ab1d7e4f5ff8a8bd3b57f3263
2019-09-23 12:52:32 -07:00
Jeff Sharkey
f17cddfa5b Add "owngrep" shell utility.
Bug: 132612223
Test: manual
Change-Id: Ibe27e419caaf4ebcbb5d48ab50cc71730c320e1c
2019-08-21 13:55:52 -06:00
Jim Tang
c4dba1d56e Filter out VENDOR_PYTHONPATH from PYTHONPATH in aosp.
Currently when switching between internal to aosp, PYTHONPATH will be
contaminated. This CL is to ensure PYTHONPATH will be as clean as
opening a new terminal and source/lunch.

Bug: 121106770

Test: internal:
$ source build/envsetup.sh; lunch; echo $PYTHONPATH| sed 's/:/\n/g'
will see VENDOR_PYTHONPATH in PYTHONPATH.

switch to aosp:
$ source build/envsetup.sh; lunch; echo $PYTHONPATH| sed 's/:/\n/g'
won't see VENDOR_PYTHONPATH in PYTHONPATH.

Change-Id: Id1916673000ee3fad55e9611d0c47cc80de86645
2019-08-06 09:17:24 +08:00
Ryan Prichard
8426a19969 envsetup: avoid adding "::" (the cwd) to the PATH
Fix this error:

    rprichard@cashew:/x/aosp/out/target/product/walleye/system/bin$ ls
    bash: ./ls: cannot execute binary file: Exec format error

Bug: none
Test: lunch a target, "echo $PATH | grep ::"
Test: lunch an arm target, cd $OUT/system/bin, ls (
Change-Id: I2c0d5ece85964dffa14d6ac8df168dd4e733162e
2019-07-15 18:16:35 -07:00
Patrice Arruda
fa7204b0e1 Revert "Revert "Deprecate bash m* commands and use the soong's modules-in* build commands instead.""
This reverts commit c4dae4d7ab.

Reason for revert: Fix available: go/aog/987391

Change-Id: I0a6cd679699488da716c30b95c62af89b6aa4f1a
2019-06-20 23:40:33 +00:00
Patrice Arruda
c4dae4d7ab Revert "Deprecate bash m* commands and use the soong's modules-in* build commands instead."
This reverts commit 610b6302cf.

Reason for revert: m mlibc from root dir works. Create a tmp dir and then cd in to tmp. Run the same command and it fails.

Change-Id: I0f0c056d7e668da621ae99d347a055ecdf2dec07
2019-06-20 22:32:46 +00:00
Patrice Arruda
610b6302cf Deprecate bash m* commands and use the soong's modules-in* build commands instead.
The functionality of m* envsetup.sh commands has been implemented in
soong_ui. The bash functionality of m* commands can be replaced by
soong's modules-in* build commands.

Fixes: b/130049705
Test: * Loaded the envsetup.sh on a new environment
      * Executed each m* command.
      * Verified with "type <build command>" to make sure
        the function generation is correct.
      * Ran on Darwin environment.

Change-Id: I8792e4f1f1727aba2ca6ee4bdfe657f6ac42302a
2019-06-19 14:16:38 -07:00
Yi Kong
dfd00b1ba1 Add LLVM binutils prebuilds in PATH
Test: lunch; manually examine $PATH
Bug: 133170927
Change-Id: Iceb0add1bfde052acf547402f8d932b87cdf0a2d
2019-05-22 23:36:53 -07:00
Jaewoong Jung
892d0fe1dd Update hmm text for mgrep.
mgrep also scans *.bp files.

Test: hmm
Change-Id: Ie7bf79d42958b269f4d2fb55d7728a22a52bf908
2019-05-04 10:06:28 -07:00
Treehugger Robot
0201a19ba8 Merge "Add Asuite prebuilds in PATH and remove functions." 2019-02-20 04:51:03 +00:00
Dan Willemsen
d855a72ebe Support loading only approved vendorsetup.sh files
Very few vendorsetup.sh files are needed anymore, since add_lunch_combo
has been deprecated. So add a way so that only approved vendorsetup.sh
files can be loaded into the shell, and others will be skipped.

This further limits the amount of code that can run outside the build
sandbox, and makes this list more visible to tree maintainers before
they're used instead of after.

Test: no allowed-vendorsetup_sh-files
Test: empty allowed-vendorsetup_sh-files
Test: one file in allowed-vendorsetup_sh-files
Test: two files in allowed-vendorsetup_sh-files
Test: non-present file in allowed-vendorsetup_sh-files
Change-Id: Ia23d1c9d11a7295d5be5abd10cf56edbdec80483
2019-02-12 15:52:36 -08:00
Dan Willemsen
5436c7e583 Obsolete add_lunch_combo
Bug: 77599627
Test: source build/envsetup.sh with add_lunch_combo calls in bash & zsh
Change-Id: If12b41d8f9a2f56efdb64ad0dccc25a1e342fdd1
2019-02-11 21:36:25 -08:00
Jim Tang
b3fda301c2 Add Asuite prebuilds in PATH and remove functions.
Remove atest/acloud/aidegen functions and append prebuilt path
in PATH. Use local built by default; if there is no local built,
use the prebuilt one instead.

Bug:

Test: $ source build/envsetup.sh; lunch
      $ echo $PATH|sed 's/:/\n/g' | egrep "out|asuite"
      # will see out/host prioritises prebuilts/asuite.

Change-Id: I1e5869bcb81cf7058cf8971f480a47d2c8f8b6f0
2019-02-12 11:29:28 +08:00
Chen Xu
aaf8cdf59d Merge "Revert "Add Asuite prebuilds in PATH and remove functions."" 2019-02-08 21:58:33 +00:00
Chen Xu
a1cc558cdd Revert "Add Asuite prebuilds in PATH and remove functions."
This reverts commit dda51d42da.

Reason for revert: This change caused AOSP build breakage on NDK

Change-Id: I27973e8e0f08e5d71a405208ae4a6a855c751932
2019-02-08 21:52:59 +00:00
Treehugger Robot
fc58ed2fb7 Merge "Add Asuite prebuilds in PATH and remove functions." 2019-02-08 20:56:37 +00:00
Anton Hansson
ece9c48e4d Tab completion for the croot function
Test: bash 3.2
Test: bash 4.4
Change-Id: Ie35ea05c4dd5ea246c005559bb5f36a9c05ef7c4
2019-02-08 08:24:26 +00:00
Sasha Smundak
9f27cc0af5 Provide an option to reduce build verbosity
If ANDROID_QUIET_BUILD environment variable is set, do not print
build timing and colorized summary result.

Test: treehugger
Change-Id: I7ae3f8eb407df470837560706f06e5785911828c
2019-01-31 13:30:26 -08:00
Rett Berg
78d1c93e12 add pathmod to envsetup.sh for making finding paths to modules easier
Change-Id: Ice1f2ff6d46a61bca5a4ddc1163af36c89947822
Test: gomod vsoc_lib && pwd
Test: pathmod vsoc_lib
Test: pathmod foobar  # get error message
Test: gomod foobar    # get error message, directory doesn't change
2019-01-30 12:47:13 -08:00
Jim Tang
dda51d42da Add Asuite prebuilds in PATH and remove functions.
Remove atest/acloud/aidegen functions and append prebuilt path
in PATH. Use local built by default; if there is no local built,
use the prebuilt one instead.

Bug:

Test: $ source build/envsetup.sh; lunch
      $ echo $PATH|sed 's/:/\n/g' | egrep "out|asuite"
      # will see out/host prioritises prebuilts/asuite.

Change-Id: I16c3e85c195b878d3c629149afbd96636ed1f0e1
2019-01-17 14:44:31 +08:00
Kevin Cheng
f0497e4e51 Update acloud alias to support mac via workaround in go/acloud-mac.
Bug: 113557161
Test: acloud on mac, (m acloud and running prebuilt)
Change-Id: Iee6abb6751e8b265dfffdf9c425f073443db2531
2019-01-11 11:00:29 -08:00
Jaewoong Jung
66b9774525 Merge "Improve mmm behavior when targets are specified." 2019-01-03 18:18:35 +00:00
Jaewoong Jung
b6112cdcc5 Improve mmm behavior when targets are specified.
When target directories are specified, mmm now scans their parent
direcotries to when searching for build config files. Also make it look
more like mm as minor refactoring.

Bug: 62899341
Test: Manual builds.
Change-Id: Ic9c081090e1baeb0849508e9086f2976b108c0ee
2019-01-02 14:19:40 -08:00
Jim Tang
22f4c322d6 Prevent PYTHONPATH from accumulatively growing.
After running "lunch" multiple times, the global variable
PYTHONPATH grows larger and larger with repetively content.
This patch is to prevent PYTHONPATH from prepending redundant path.

Bug: b/121110600

Test: $ source build/envsetup.sh && lunch
      $ echo $PYTHONPATH | sed 's/:/\n/g'
      $ lunch; lunch
      $ echo $PYTHONPATH | sed 's/:/\n/g' # not growing.

Change-Id: Ifc36d071fb63bb1494bb0a94fdff477a41708c74
2018-12-22 11:19:40 +08:00
dimitry
73b8481edf Rename _complete-android-module-names
A function name with dashes is apparently not universally recognized
by shell versions/variants(?). Using underscore in place of dashes
solves this problem.

Test: ./development/vndk/tools/header-checker/utils/create_reference_dumps.py -l libGLESv1_CM
Change-Id: Id7d701600760140dae9e4762a11f4abd64947d10
2018-12-11 18:06:00 +01:00
Treehugger Robot
4ea66801b2 Merge "Add functions to jump to specific modules." 2018-12-07 20:47:40 +00:00
Steven Moreland
62054a43fa Add functions to jump to specific modules.
Usage:
...aosp/$ gomod libbase
...aosp/system/core/base$

Using in alias:
alias g=gomod
complete -F _complete-android-module-names g

...aosp/$ g libbase
...aosp/system/core/base$

Nothing in Android keeps an up to date index of all Android modules
and their locations between builds. However, there is a target
'module-info.json' which is used to contain some of that information.
This module can be updated using the command 'refreshmod' added
here, but it will also be updated during a normal Android build.

This also adds auto-complete for m.

Bug: N/A
Test: manual
Change-Id: I06b0b87c308b9fe2798dbc29225906cc30fe59fe
2018-12-06 18:28:50 -08:00
patricktu
345c9ae44f AIDEGen: Adopt prebuilt mechanism to bypass 'm aidegen'.
Bug: 119642842
Test: m clean;aidegen tradefed
Change-Id: Ib25591de77762ffdcc72ea4a064a50cfb3e5015e
2018-11-29 15:25:40 +08:00
Elliott Hughes
d3e472569a envsetup.sh: say -p for plain, not -ps.
toybox xxd treats -ps as -p -s with a missing argument to -s, rather
than as a bizarre synonym for -p.

Test: manual
Change-Id: Ia576861588a4ddeac9885bce8d718929b74f31b1
2018-11-15 16:32:14 -08:00
Treehugger Robot
4c969fa22a Merge "Add atest shortcut in envsetup.sh." 2018-11-14 10:58:18 +00:00
Aurelio Jargas
67edd15196 Add .hpp files to sgrep and treegrep
There are plenty of .hpp files in the AOSP sources.

    $ find . -name \*.hpp | wc -l
    2430

They were already grepped in cgrep(), but were missing in
sgrep and treegrep.

Test: manual - run the script

Change-Id: I1fb3f576f6cdcc2b492e2beadf11ced98cb3938e
2018-11-06 17:36:46 +01:00
Jim Tang
f258e7e424 Add atest shortcut in envsetup.sh.
Atest will run in the sequence of built -> prebuilt -> source code.

Bug: b/118801769

Test: source build/envsetup.sh; lunch
     and atest will run in the appearing sequence above.
Change-Id: I0494aeab99c390c31bb02641c6c1c11afd5642a2
2018-11-06 13:41:01 +08:00
Patrik Fimml
df248e60e5 Don't override zsh users' compinit options.
I call "compinit -i" in my .zshrc, to allow loading autocompletion from
"unsafe" locations. envsetup.sh breaks that. Change behavior to only
call compinit if bash-style completion is not already enabled.

This is a minimal fix; an alternative would be to rely on the user
to call 'bashcompinit' in their .zshrc instead, and just skip all
autocomplete functionality if they don't.

Test: manual - source ./envsetup.sh in {bash, zsh, zsh -f} and test
	completion for lunch
Change-Id: Ibb10eb68a96d69c19b9db9b21e0546fe8ae299b2
2018-10-16 13:36:23 +02:00
Kevin Cheng
bf89aff251 Add acloud shortcut in envsetup.sh
Bug: None
Test: source envsetup.sh and ran acloud successfully.
Change-Id: Ie75c2a6ea002fe3d909afd1760f4ab05c7c94a26
2018-10-08 16:23:40 -07:00
Jim Tang
0e3397b225 Envsetup: Fix lunch choice with number in zsh
(zsh)$ source build/envsetup.sh; lunch 23
will result in selecting #22 because array in zsh starts from 1
instead of 0. This CL is to fix this issue.

Bug: b/117202855
Test: below commands should have the same output:
    (zsh)$ source build/envsetup.sh; lunch 23
    (zsh)$ source build/envsetup.sh; lunch aosp_walleye-userdebug

Change-Id: I0570585417878bc7c73eda0e1a416232fe147fb4
2018-10-03 18:35:37 +08:00
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