Commit graph

356 commits

Author SHA1 Message Date
Logan Chien
65ab468452 Merge "Add BUILD_BROKEN_PREBUILT_ELF_FILES to dumpvars.go" 2019-10-03 15:51:09 +00:00
Colin Cross
1f6faeb50f Use ctx.Fatalln instead of log.Fatalln for absolute path errors
log.Fatalln calls os.Exit, which skips deferred functions and
leaves the console with the cursor disabled.  Use ctx.Fatalln
instead, which uses a panic to exit and calls the deferred
function to restore the cursor.

Test: DIST_DIR=/tmp/\test\ foo m dist
Change-Id: Ie92297075e37c171d5ba48848a0ddb19652b051c
2019-09-23 15:55:54 -07:00
Colin Cross
c0b9f6b9d2 Force dumpvars into dumb terminal mode and move log files
Force soong_ui in dumpvars mode to use a dumb terminal so that it
doesn't print an empty status table.  Also move the logs to files
that are prefixed with "dumpvars-" so that they don't rotate the
real build logs.

Fixes: 139307849
Test: lunch
Change-Id: If92421af07731fedc9ca42670f309e95922a2224
2019-09-23 14:24:57 -07:00
Colin Cross
f0b987ecba status table: don't write newlines in non-scrolling terminals
Multiple terminals have had issues with writing newlines into the
non-scrolling region, just set the cursor to the beginning of the
next line instead.

Test: m nothing in JediTerm
Change-Id: I2e434f4cc263ca13b82889a79d6a8bb48d084cb3
2019-09-20 15:03:31 -07:00
Colin Cross
bf8f57e2f6 status table: ANSI code rows and columns are 1-based
Don't pass 0 to setCursor or setScrollingMargins.  Passing 0 hasn't
caused any known issues, but 1 is correct.

Test: m nothing
Change-Id: I8735032eb3f1d46df4c41c4ea9ef95b5fd842824
2019-09-20 15:03:11 -07:00
Logan Chien
f9cf9acd7a Add BUILD_BROKEN_PREBUILT_ELF_FILES to dumpvars.go
This commit adds BUILD_BROKEN_PREBUILT_ELF_FILES to
`ui/build/dumpvars.go` so that its value can be printed to
`out/soong.log`.

Bug: 141176116
Test: lunch aosp_crosshatch-userdebug && make && \
      grep BUILD_BROKEN_PREBUILT_ELF_FILES out/soong.log

Change-Id: I99600a5b540be2bb93647ee8175b9f9afd1a6eb3
2019-09-20 11:40:49 -07:00
Roland Levillain
9c27df7d4d Merge "Add $ANDROID_HOST_OUT/apex to the file set removed by target installclean." 2019-09-18 10:47:06 +00:00
Elliott Hughes
26bce340e3 Track switch to toybox date for macOS.
Bug: http://b/139450866
Test: builds
Change-Id: I5ab0d20d761bcd03f3bee18b8343a2f8aa5e2275
2019-09-12 15:05:13 -07:00
Roland Levillain
e5f9ee56b5 Add $ANDROID_HOST_OUT/apex to the file set removed by target installclean.
Before this change, host APEX (`.zipapex`) packages would still be
there after `m installclean`.

Test: Run `m installclean` and check that host APEX packages are removed.
Change-Id: I446286ce700f12666be5aa90fbe3bbc648abd280
2019-09-11 14:50:08 +01:00
Elliott Hughes
34b49d1402 Use toybox md5sum instead of md5 on macOS.
Test: builds locally
Change-Id: I04aa52de96e0525a44331cb0c057a8e18a95891d
2019-09-06 14:42:24 -07:00
Elliott Hughes
ef19e01f96 Switch to toybox stat on macOS too.
Bug: http://b/139450866
Test: builds
Change-Id: I97af607a311aea5f97544bd3ce1d532d999126ff
2019-09-05 10:01:37 -07:00
Elliott Hughes
f1ff226cd4 Switch most of the darwin tools to toybox.
Bug: http://b/139450866
Test: treehugger
Test: "works for me on my machine" (last week)
Change-Id: I5dd00e6fda134b06967651007afb7565ce4f9e24
2019-08-27 15:17:32 -07:00
Treehugger Robot
2569cc5026 Merge "We have md5sum/sha1sum/sha256sum/sha512sum on Darwin now too." 2019-08-27 03:17:07 +00:00
Steven Moreland
0aabb11dd4 Add $ANDROID_PRODUCT_OUT/apex to installclean.
When removing dependencies from APEXes, the lib files were still there
even after installclean.

Bug: 139016109
Test: run installclean, see apex directories go away :D
Change-Id: I4dad8e3aa0042cdd5bbb76bd6fdd01b025b98495
2019-08-26 18:35:55 +00:00
Elliott Hughes
556a37585a We have md5sum/sha1sum/sha256sum/sha512sum on Darwin now too.
Bug: http://b/139450866
Test: treehugger
Change-Id: I654f706a18949d29c8688b1abe85d574b5315808
2019-08-26 11:15:15 -07:00
Dan Willemsen
70c1ff8dac Always set ASAN_SYMBOLIZER_PATH appropriately
Otherwise tools built with ASAN can't symbolize their dumps, as
llvm-symbolizer is not allowed to be used from $PATH.

Fixes: 139825736
Test: cherry-pick https://android-review.googlesource.com/c/platform/system/tools/aidl/+/1106532
  mmma ASAN_OPTIONS="" SANITIZE_HOST=address system/tools/aidl
Change-Id: Ib1eeec15ce6694d7bde54c7201b3280e38df3a83
2019-08-21 22:34:11 +00:00
Dan Willemsen
ce41e943be Remove support for ONE_SHOT_MAKEFILE
Test: treehugger
Change-Id: Icdbe62bcb7bc4717228c5d974962b939d8eafee6
2019-07-31 18:11:27 -07:00
Elliott Hughes
521602194b Merge "Switch to toybox egrep(1) and grep(1)." 2019-07-31 16:55:43 +00:00
Dan Willemsen
1eee154c3b Default to the status table output
For smart terminals, default to using the status table, using 1/4 of the
terminal height (with a min of 1 and a max of 10).

This behavior can still be overriden to a specific height with
SOONG_UI_TABLE_HEIGHT, and turned off by setting SOONG_UI_TABLE_HEIGHT
to 0.

Test: m   <adjust terminal height, see it shrink when it gets too short>
Test: SOONG_UI_TABLE_HEIGHT=20 m
Test: SOONG_UI_TABLE_HEIGHT=0 m
Change-Id: I224348a29a6e07f168c92cf5514a94bd27e32618
2019-07-30 13:44:03 -07:00
Dan Willemsen
a2a8ecb330 Remove reference to PRODUCT-*
The code still needs to exist, but for buildspec.mk files, not the
PRODUCT-* arguments.

Test: none
Change-Id: I60c6044ab2d1627af7e6e2e8831b77d9db12aa55
2019-07-29 15:14:11 -07:00
Kousik Kumar
61afb56e84 Add dist_dir to goma trigger
This is done so that prototype tooling can write logs inside the DIST_DIR.

Test: I wrote out all the environment variables being passed to
goma_ctl.py and the output is https://paste.googleplex.com/6663469954760704. It contains both DIST_DIR and other variables.

Change-Id: Ia5c70e58aa1b87db9777c59cf3e5df1c9e20f08c
2019-07-23 16:16:15 -04:00
Elliott Hughes
7ceddbae8e Merge "Switch to prebuilt bzip2." 2019-07-23 19:28:02 +00:00
Elliott Hughes
2ee8b33edc Switch to prebuilt bzip2.
Test: treehugger
Change-Id: I4953ff6f9ead5ad79519ac7fa71b557807f25851
2019-07-23 15:08:58 +00:00
Ramy Medhat
2b78fda705 Merge "Add USE_RBE support to soong." 2019-07-23 11:49:10 +00:00
Treehugger Robot
1ecfa940d1 Merge "Reland "Switch to toybox tar."" 2019-07-23 02:08:40 +00:00
Ramy Medhat
bbf2567cc1 Add USE_RBE support to soong.
Test: Built aosp_arm-user with and without USE_RBE. USE_RBE uses
a proxy script in place of rewrapper.

Change-Id: I5bf008a940513872d70b5b215bd6209f759826ae
2019-07-17 18:46:47 +00:00
Patrice Arruda
19bd53e39c soong_ui: Do not clean the OutDir path multiple times.
If OUT_DIR has been specified through the command line arguments,
it is sanitized first and NewConfig sets the OUT_DIR in the build
environment. When calling OutDir from Config instance, the out
was being sanitized again which is unnecessary.

Bug: b/118730755
Test: Ran unit test cases, "lunch" followed by "m" command.
Change-Id: Ieb4ffa1026c802c76c7369e8cdb3923a4c70f4b3
2019-07-16 11:22:22 -07:00
Patrice Arruda
0dcf27f639 soong_ui: Construct the proper MODULES-IN-<dir name> for m* build commands.
Previously, any of the build commands (mma, mmma, etc...) would traverse
up the directory path until an Android build file has been found. That
directory path would eventually become the MODULES-IN-<dir name> build
target. The directory where the m* command was executed may contain a
build file in a sub directory. For that case, the build target is the
MODULES-IN-<dir name> where dir is the directory of the executed m*
command since the target has been constructed by the core makefile.

Bug: b/118730755
Test: Wrote and ran unit test cases. Ran "lunch", "m". Went to a
      directory in AOSP that had build files in sub directories and
      executed mma. Went to a directory that had only build files in
      parent directories and executed mma.

Change-Id: I9458cbc4bf0fc25bfb0848e96e92d261442d5cb0
2019-07-16 11:19:05 -07:00
Elliott Hughes
a6d1d373ae Reland "Switch to toybox tar."
This reverts commit afeb6cb817.

Change-Id: I67733254fd7edad51ac3fbb18c929b109e86d32e
2019-07-12 15:57:33 +00:00
Patrice Arruda
9450d0b226 soong_ui: Do not find a build file if targets are specified.
For mmma and mmm, the findBuildFile function in config.go is invoked every time
for specified directories and directories with targets. For directories with
targets, an Android build file must exist in the directory where mmma and mmm
was invoked. There is no need to invoke findBuildFile function as a
simple check of the build file exists in the specified directory.

This is also refactoring the code for b/118730755

Bug: b/118730755
Test: Executed unit test cases through Intellij and executed mmma
command: "mmma external/protobuf:aprotoc external/bzip2".

Change-Id: I5428e3a3c36f77ff740617564b7853705521f29f
2019-07-11 14:38:19 -07:00
Elliott Hughes
c5a34551e1 Switch to toybox egrep(1) and grep(1).
Test: treehugger
Change-Id: I9053f45d591a8cb53eb36e258ecb97b591d806a1
2019-07-09 08:51:30 -07:00
Justin Yun
d5f6c8261a Rename product_services to system_ext
Bug: 134359158
Test: build and check if system_ext.img is created
Change-Id: Ice3229baf97a94c24a6eea22e7d4571941d7f843
2019-07-09 08:57:05 +00:00
Treehugger Robot
f67e1bee4a Merge changes Icfc893c8,I40f03fc0
* changes:
  Allow debugging with SOONG_DELVE=<listen addr>
  Print ninja stdout live during the build
2019-07-04 03:34:22 +00:00
Colin Cross
aa812d122c Allow debugging with SOONG_DELVE=<listen addr>
Allow running Soong in a headless delve debugger by passing
SOONG_DELVE=<listen addr> in the environment.

Bug: 80165685
Test: SOONG_DELVE=:1234 m nothing
Change-Id: Icfc893c8a8354a9bbc99112d9c83259cb41906d1
2019-07-03 16:33:31 -07:00
Colin Cross
7b97ecd1f5 Print ninja stdout live during the build
When running ninja stream stdout to the status writer.  This improves
the ninja -d explain behavior, and will also allow Soong to be put
into the ninja console pool letting it print timely output to the
console.

Bug:  80165685
Test: NINJA_ARGS="-d explain" m
Change-Id: I40f03fc01d837ad91d400eae378007a7ce807705
2019-07-03 16:33:10 -07:00
Patrice Arruda
baba9a9be6 soong_ui: Build under a path that contains a symbolic link.
The build directory passed in to soong_ui can contain a
symbolic link. soong_ui was not evaluating the build
directory to retrieve the true path, hence failing to
execute the internal soong.

Fixes: b/135995632
Test: Unit test case and executed the scenario in the bug
      description.

Change-Id: I5779c6aa3f3183810437dbe2b2d4e40acbafb205
2019-07-03 13:03:23 -07:00
Mikhail Naganov
9d42425f25 Perform TERM check for file writers only
Tests use fakeSmartTerminal, this case must not be affected
by the TERM setting.

Test: TERM=dumb make
Change-Id: Ib926a1c6ba2d8c4117d412fe351d872ccfc1c799
2019-07-02 09:51:42 -07:00
Mikhail Naganov
b073581441 Improve dumb terminal detection
When figuring out terminal type, check whether TERM=dumb is set.

Test: m nothing
Test: TERM=dumb m nothing
Test: m nothing | tee log
Change-Id: Ie13ca99eb84b798644d618ad1c8c1fb8ec8bb049
2019-06-27 10:54:53 -07:00
Colin Cross
7b6245388c Compute critical path when ninja finishes
Keep a running map of the critical path to each edge as it
finishes.  At the end of the build, find the edge with the
longest critical path and print the path to out/soong.log.

Test: critical_path_test.go
Change-Id: Ie01d26b068b768156b166bff00cdc3273e8124ca
2019-06-26 11:31:17 -07:00
Treehugger Robot
ba9a51979d Merge "Revert "Switch to toybox tar."" 2019-06-25 05:24:44 +00:00
Elliott Hughes
afeb6cb817 Revert "Switch to toybox tar."
This reverts commit 3b584b7861.

Reason for revert: missing --mode.

Change-Id: I0cde94c38905e26c79c31a03fd0177d7d57daa32
2019-06-25 01:40:42 +00:00
Treehugger Robot
7d7cae85ab Merge "Soong: Add build_error proto raw file to $(OUT_DIR)." 2019-06-24 22:59:33 +00:00
Colin Cross
bbeb2c1a50 Merge "Color long running durations when using action table output" 2019-06-24 21:38:51 +00:00
Elliott Hughes
9b74dfe96c Merge "Switch to toybox tar." 2019-06-24 21:24:53 +00:00
Patrice Arruda
297cebad26 Soong: Add build_error proto raw file to $(OUT_DIR).
Soong_ui produces a build_error raw file to $(OUT_DIR) where
the file contains a list of build action errors. Each build action
error represents an error raised by a command. The build_error file
is populated if there was a build error.

Bug: b/132969697
Test: Ran m for successful build. Introduced a broken build change,
      ran m and verified using printproto that build_error was
      generated successfully.

Change-Id: I690ca1778b4e56f144a3173ba1d16d8494c32c15
2019-06-24 13:02:35 -07:00
Colin Cross
5137de0bdd Color long running durations when using action table output
When printing the action table, color the duration of commands that
have been running for 30 seconds yellow, and commands that have been
running for 60 seconds red.

Test: manual
Change-Id: I61cb21b0dae10811d345cb9f62cd07915cfc69ee
2019-06-24 10:49:11 -07:00
Treehugger Robot
45cdb71290 Merge "Soong: Add BUILD_MODULES build action in soong_ui." 2019-06-21 03:11:34 +00:00
Patrice Arruda
3928206ecc Soong: Add BUILD_MODULES build action in soong_ui.
There was one case that did not work:
  1) Create dir in root source tree
  2) Run "m libc"

The build would fail as it was using the mma logic. A separate
one named BUILD_MODULES was added to allow building specific
modules in any directories using the "m" command.

Bug: b/130049705
Test: unit test cases, ran "m libc" in a tmp directory inside
      of the source tree.

Change-Id: I8d23e685a673a311001ee8edd89bd73b662392dd
2019-06-20 16:35:12 -07:00
Elliott Hughes
63e70530d3 Merge "Allow gzcat as an alias for gzip's -dc mode." 2019-06-20 21:03:11 +00:00
Elliott Hughes
e671f5a397 Allow gzcat as an alias for gzip's -dc mode.
This gets us closer to toybox tar (and toybox gzip/gzcat).

Test: treehugger
Change-Id: If934270439b258eae55cdd3e97ac0e83b1c79c70
2019-06-19 14:02:02 -07:00