aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
Commit message (Collapse)AuthorAgeFilesLines
* Deprecate ONE_SHOT_MAKEFILEDan Willemsen2019-09-041-1/+20
| | | | | | | | | | mm is now doing the same thing as mma. Now print a deprecation message for other tools that may be setting ONE_SHOT_MAKEFILE directly (or users that are still using a very old envsetup.sh). Test: mm # does not print Test: ONE_SHOT_MAKEFILE=bionic m Change-Id: I98221657024d824a61c0d721d5c7dd1a2ea2fb1e
* soong-ui: Redirect mm to mma.Patrice Arruda2019-09-041-1/+4
| | | | | | | | | This is the first part of deprecating the mm command. mm will simply be redirected to mma by building the modules and their dependencies. Bug: b/135187558 Test: Ran mm in external/protobuf directory. Change-Id: Idad40f89e3768aeb459172f632a44fd7b0a201bc
* soong-ui: Redirect mmm to mmma.Patrice Arruda2019-09-041-1/+4
| | | | | | | | | | This is the first part of deprecating the mmm command. mmm will simply be redirected to mmma by building the list of modules with their dependencies. Bug: b/135187558 Test: Ran mmm external/libusb:libusb. Change-Id: I50cf0d6a07197556ab6130e612561c6d5a3fb31e
* Soong: Add build_error proto raw file to $(OUT_DIR).Patrice Arruda2019-09-041-0/+1
| | | | | | | | | | | | | | 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
* Soong: Add BUILD_MODULES build action in soong_ui.Patrice Arruda2019-09-041-1/+1
| | | | | | | | | | | | | | | | 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
* Soong: Use ctx.Writer in flag usage for dumpVar and dumpVars in soong_ui.Patrice Arruda2019-09-041-15/+15
| | | | | | | | | | ctx.Writer is recommended stream to use for standard io. Fixes: b/135487952 Test: Lunch and executed ./out/soong_ui --dumpvar-mode and --dumpvars-mode to check the usage is output to the console. Change-Id: I38351ebdb05f49f92d6b4bfb0423092299d1c5ea
* soong_ui: Add --build-mode flag in soong_uiPatrice Arruda2019-09-041-4/+94
| | | | | | | | | | | | | | | The --build-mode flag is a new flag in soong_ui that accepts a build action (m, mm, mmm, mma, mmma), the directory where the build action is occuring and an optional list of build arguments and invokes the build option. This is to deprecate the build actions behavior in envsetup.sh and start using the one defined in soong_ui. Bug: b/130049705 Test: Ran lunch and ran all the build action commands in soong_ui. Ran a bunch of invalid commands such as no Android.mk file in a specific directory, invalid target name, etc... Change-Id: I88e9e59f47f8c5cdc872fb83a0f3f0a0919885b6
* Soong: Fix the package name in metrics.proto filePatrice Arruda2019-09-041-1/+1
| | | | | | | | | | | | | | The metrics.proto needs to be imported to Google3 in order to unmarshal the build metrics data from bigstore. Cleaned up the enum names to use the Camel naming convention and renamed the build_metrics to soong_metrics to be more specific to soong and to allow quering soong_metrics files from bigstore. Bug: b/135280521 Test: lunch andf m -j. Checked if soong_metrics was generated correctly by using printproto command. Change-Id: I998c8d05db592e94a653d6ca32250b80df3c9b21
* Move all output through StatusOutputColin Cross2019-09-042-9/+18
| | | | | | | | Write log output through StatusOutput so that the status implementation can synchronize it with its own output. Test: status_test.go Change-Id: I917bdeeea4759a12b6b4aa6d6d86ee18a2771723
* Remove terminal.WriterColin Cross2019-09-042-20/+16
| | | | | | | | | terminal.Writer is now just a wrapper around stdio.Stdout() without any useful functionality. Replace it with stdio.Stdout() as an io.Writer. Test: ui/terminal/status_test.go Change-Id: I5bc5476afdca950b505642f0135a3af9d37fbe24
* Soong: Refactor the soong_ui arguments processing to be more like bazel.Patrice Arruda2019-09-041-45/+123
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, the command line argments is being processed in multiple places. In the main soong_ui arguments, there are several if statements that checks if a specific argument was specified in order to execute the requested operation. This does not scale well when adding or removing a command in the near future. In order to support the build commands (m, mma, etc...) from the envsetup.sh in soong_ui, a refactor was required in order to add a command rather quickly and to have the flexibiity to unit test the command. The soong_ui arguments format is as follows: soong_ui <command> [<arg 1> <arg 2> ... <arg n>] The <command> is a specific operation to be executed. The arguments after the command are processed by the command itself. Below is the list of changes made in this commit: * Created a new command infrastructure that allows adding or deprecating a command easily. * Fixed a bug when running ./soong_ui.bash directly would cause a panic due to index being out of range for args list. Bug: b/130049705 Test: Below is the list of testing done on this commit: * Ran lunch and verified that the output is the same as the the output without the modifications. lunch indirectly runs soong_ui passing in the --dumpvar-mode (to read makefile variables such as TARGET_PRODUCT) and --dumpvars-mode (to build the build cache). * Ran ./soong_ui.bash directly (with unsupported flags and no flags) and the proper message appeared that soong native UI is not yet available. * Ran m, mm, mmm, mma, mmma commands. * Ran the make installclean command: make -j80 TARGET_PRODUCT=aosp_arm64 TARGET_BUILD_VARIANT=eng dist DIST_DIR=/tmp/helloworld installclean * Ran ./out/soong_ui -j80 --make-mode PRODUCT-aosp_arm64-eng dist checkbuild tests Change-Id: Iee4de7ec0fa4661206fda8ae1fe6fa4487d9bb22 Merged-In: Iee4de7ec0fa4661206fda8ae1fe6fa4487d9bb22
* Embed CSS entries in soong_build.html.Jaewoong Jung2019-04-161-1/+93
| | | | | | | | | | This will prevent it from being affected by future css location changes. Test: m soong_docs Fixes: 130567020 Change-Id: I80fd7b8a12a32bcea7b270423b8d8f8dc0976177 Merged-In: I80fd7b8a12a32bcea7b270423b8d8f8dc0976177 (cherry picked from commit 5f867c058082ec13e828d9f065058d94e21a4c42)
* Fix package path of android/soong/android pctxColin Cross2019-04-101-1/+1
| | | | | | | | | | | | android/soong/common was renamed to android/soong/android long ago, but the pctx package path was still "android/soong/common". This required all users of rules defined in android/soong/android to import "android/soong/android" and then pctx.Import("android/soong/common"). Bug: 130298888 Test: m checkbuild Change-Id: I20d096522760538f7cfc2bec3d4bfeba99b275d4
* Merge changes I7dd4ba7f,I7887a67a am: 92cc71606c am: 900574f0cdColin Cross2019-04-021-12/+24
|\ | | | | | | | | | | am: 6c99a30bb7 Change-Id: If557897ed64ecdf8967299b5512392e5485767ae
| * Merge changes I7dd4ba7f,I7887a67aColin Cross2019-04-021-12/+24
| |\ | | | | | | | | | | | | | | | * changes: Add depfile support to RuleBuilder Add RuleBuilderCommand.Flags
| | * Add depfile support to RuleBuilderColin Cross2019-03-291-12/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow rules built with RuleBuilder to use depfiles. Ninja only supports a single depfile with single output. If there are multiple outputs in a rule, move all but the first to implicit outputs. If multiple depfiles are specified, use new support in dep_fixer to combine additional depfiles into the first depfile. Test: rule_builder_test.go Change-Id: I7dd4ba7fdf9feaf89b3dd2b7abb0e79006e06018
* | | Merge changes Ie7f776a4,I3ca5dd1f,I2e911262 am: 11581cf6b3 am: 89d99337fbColin Cross2019-04-0112-0/+1266
|\| | | | | | | | | | | | | | | | | am: 92270109eb Change-Id: Ic7ac18a1d60138e909c6045fd5313620256989d4
| * | Merge changes Ie7f776a4,I3ca5dd1f,I2e911262Colin Cross2019-04-0212-0/+1266
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | * changes: Add a whitelist for services.art changing between builds Add diff_target_files tool Import files from compare_target_files for use in diff_target_files
| | * | Add a whitelist for services.art changing between buildsColin Cross2019-04-011-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | Bug: 120039850 Test: manual Change-Id: Ie7f776a4e2743883ea006c66148fc4f40f90ce07
| | * | Add diff_target_files toolColin Cross2019-04-012-0/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a tool that lists files that have changed between two builds by comparing the target-files.zip artifacts. Bug: 121158314 Test: unit tests Change-Id: I3ca5dd1fdf652dffef923ad7307fd71e49e2e95a
| | * | Import files from compare_target_files for use in diff_target_filesColin Cross2019-04-019-0/+1158
| | |/ | | | | | | | | | | | | | | | | | | | | | Copied from cl/240594925. Bug: 121158314 Test: copied unit tests Change-Id: I2e91126285dcd33171ff8b8dbfcfa5d48501f535
* | | Merge "Touch output files in sbox" am: 80eb6907ac am: 9457c97c40Colin Cross2019-04-011-0/+10
|\| | | | | | | | | | | | | | | | | am: 5cb90e6517 Change-Id: I07587e71632567f553f417db40b791e4d335aaae
| * | Touch output files in sboxColin Cross2019-04-011-0/+10
| |/ | | | | | | | | | | | | | | | | | | | | | | Some tools used by genrules set the timestamp of the generated file to an old value. For example, when using tar to extract files it will set the timestamp of the extracted file to the value stored in the tar file. This can cause unnecessary rebuilds due to output files that are older than their inputs. Touch output files in sbox before moving them into the output location. Test: m checkbuild && m checkbuild Change-Id: Idb0e71d2bf0ac3618338371132cc71be74bf9d9d
* | Build doc improvements. am: 12c02a63d0 am: dde127fdb6Jaewoong Jung2019-03-131-2/+3
|\| | | | | | | | | | | am: 8c822915fb Change-Id: If8b0c3432f659b0739f92cf07f4a0020a6c1cbd8
| * Build doc improvements.android-q-preview-1Jaewoong Jung2019-03-121-2/+3
| | | | | | | | | | | | | | | | | | Bring property type strings to the start of property comments. This is how source.android.com shows variables and paratemeters, and it is also easier to read, especially when a comment ends with a code example. Test: m soong_docs Change-Id: Ic3e9db3a3711495998919ee95bbef6c7cb33b215
* | Merge "Change module type text to HTML in build docs." am: 0d2c1d1e23 am: ↵Jaewoong Jung2019-03-111-1/+1
|\| | | | | | | | | | | | | | | 7c8d1b2400 am: dfd6745462 Change-Id: I56e69eb99966564a754efa45c15726cbc8e52590
| * Change module type text to HTML in build docs.Jaewoong Jung2019-03-111-1/+1
| | | | | | | | | | | | | | | | To add code format (<pre>...</pre>) support to module type texts. Fixes: 124332708 Test: m soong_docs Change-Id: Ibe9d3845a8f952fdef5007893d4af5836809ce1f
* | Fix recent builds with bad dangling symlinksDan Willemsen2019-03-081-0/+19
|/ | | | | | | | | | | | | It appears that there's a bug in repo where when a linkfile is removed from the manifest, the symlink remains in the source tree. Cleaning this up needs to happen before we start scanning the source tree for Android.bp/Android.mk files, so this has to be done very early -- way before CleanSpec processing could handle it. Bug: https://bugs.chromium.org/p/gerrit/issues/detail?id=10583 Test: ln -s missing hardware/qcom/sdm710/Android.bp; m Change-Id: Ib68f2507ffe58ccdd9fbc88925f8a4f6150f2f7d
* Replace *Escape with *EscapeListColin Cross2019-03-042-2/+2
| | | | | | | | | | Follow the change to blueprint to make *Escape take and return a string and add *EscapeList that take and return slices of strings. Fix up a few places that were unnecessarily converting a string to a slice and back to a string. Test: m nothing Change-Id: I3fa87de175522205f36544ef76aa2f04aef1b936
* Add a filename to anchor links in build docs.Jaewoong Jung2019-02-271-2/+2
| | | | | | | | | The href base added by I8a8ac0f9ba6c0d57ed83db2155955a95e070a265 doesn't really play nice with anchor links. This fixes the issue. Fixes: 126550408 Test: m soong_docs Change-Id: If62411a6391fd8151fa40cb2ecf32c5006797d6c
* soong_docs build link error fix.Jaewoong Jung2019-02-251-21/+33
| | | | | | | | | This adds a script to copy the current page's base url to hrefs in the doc. Fixes: 123473548 Test: m soong_docs Change-Id: I8a8ac0f9ba6c0d57ed83db2155955a95e070a265
* Split up Soong build doc.Jaewoong Jung2019-02-201-45/+109
| | | | | | | | | | Previously the build doc was a gigantic list of modules and properties, which can be overwhelming to new users. This change breaks it up by packages, so that it is easier to look up and feels more coherent. Bug: 123521276 Test: m soong_docs Change-Id: I1a1a331f4b4deb8782d698e9076098c5a27b9566
* Merge "Improve documentation page layout"Treehugger Robot2019-02-202-81/+184
|\
| * Improve documentation page layoutSasha Smundak2019-02-132-81/+184
| | | | | | | | | | | | | | | | | | | | It now has module list on the left and the main panel containing a section for each module. Each section contains the navigable list of the module's attributes, grouped by attribute's origin. Test: Manual Bug: 120512870 Change-Id: Ib62ef58c61daa88950f0934a70ba8ed16f433bf2
* | Simplify python launcher, use __main__.pyDan Willemsen2019-02-152-25/+4
|/ | | | | | | Uses more python rather than C++, and skips less of Py_Main. Test: build/soong/python/tests/runtests.sh Change-Id: I03997d88e2e16047c96bb4e00e530229c42b3325
* Update Soong docs generator for blueprint changesColin Cross2019-02-132-2/+21
| | | | | | | | | | | bootstrap.ModuleTypeDocs needs a mapping of module types to factories to support factories that are wrapped in ModuleFactoryAdapter closures. It also returns ModuleType objects grouped into Package objects. Bug: 67909957 Test: m soong_docs Change-Id: I70eac9f0f0e13075580da92d4219792ca0b18fbf
* Provide an option to reduce build's verbosity.Sasha Smundak2019-02-072-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If ANDROID_QUIET_BUILD environment variable is set to '1', do not show 20 lines of the environment variables. In addition, for the failing step show only the step name and output, omitting the command proper (the verbose log as well as error.log still contains it). If build succeeds, the output of the build itself consists of a single line: ``` > m androidmk [100% NN/NN] <last command> ``` When it fails, the output does not contain sometimes very long command line: ``` > m androidmk [ 97% NN/MM] test androidmk FAILED: <step> --- FAIL: TestEndToEnd (0.01s) androidmk_test.go:1025: failed testcase 'prebuilt_etc_TARGET_OUT_ETC' input: include $(CLEAR_VARS) LOCAL_MODULE := etc.test1 LOCAL_MODULE_CLASS := ETC LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/foo/bar include $(BUILD_PREBUILT) expected: prebuilt_etc { name: "etc.test1", filename: "foo/bar", } got: prebuilt_etc { name: "etc.test1", filename: "foo/bar", } FAIL 17:50:53 ninja failed with: exit status 1 ``` [The related change in build/make/envsetup.sh suppresses timing display when the same variable is set.] Change-Id: I4d3c72457de031ff58a324c2fe98f4c1d10f8239 Test: treehugger
* Fix the issue for dumping metrics file to artifactNan Zhang2019-01-071-3/+2
| | | | | | Bug: b/63815990 Test: N/A Change-Id: I72ddc8579626e652a8c27299e009b24ded5312f6
* Generate build timing metrics to proto format fileNan Zhang2019-01-041-1/+8
| | | | | | | | Test: Dumped the text formated based metrics file to out dir, and checked the file. Bug: b/63815990 Change-Id: Iff476f72a0be74eb53b6b26ef468d11c0f24a404
* Fix par file zip offsetsDan Willemsen2018-12-031-1/+17
| | | | | | | | | | | | | | | | The zip file format does support scripts/programs prefixed to the archive, though many of the offsets are supposed to start from the beginning of the file. Some tools (python and zipinfo) are able to read zip files with arbitrary prefixes, but others (libziparchive and zipdetails) fail. So pass the file to prefix onto the zip file into merge_zips so that we can set the offsets from the real start of the file. Test: m sepolicy_tests (runs the embedded python interpreter) Test: zipinfo out/host/linux-x86/bin/sepolicy_tests Test: zipdetails out/host/linux-x86/bin/sepolicy_tests Change-Id: If73d4c2465581f7de5aa47959284ecf2059df091
* Fix the host bionic linker check; add testsDan Willemsen2018-11-123-14/+156
| | | | | | | | | | | | | | | | | | | | | | | | | Gold uses two PT_LOAD programs: RX, RW LLD is using three PT_LOAD programs: R, RX, RW All non-static host bionic executables are linked with LLD, as it's required in order to embed the linker. The dynamic linker is considered a static executable for this definition. When the linker had been built with Gold, we inserted the the RX&RW loads in the middle of the executable's readonly load, splitting the R load into two. When this happened, all of the linker's loads existed 1:1 in the final executable. Now that the linker is built with LLD, we're inserting the loads into the same place, but LLD merges the first part of the executable's R load with the linker's R load, so there's not a 1:1 matching. So just make sure that all of the linker's loads are contained within the executable's loads (and with the appropriate flags). Test: m blueprint_tools (runs new tests) Test: build host bionic binaries Change-Id: If7868d2ab8980d27ba5ab8994fefe0d6142f215a
* Keep directories when moving glob resultsColin Cross2018-11-012-2/+124
| | | | | | | | | | Patterns containing multiple globs or a recurisve glob may match files with the same name in multiple directories. Keep the relative directories of matches after the path entry containing a glob. Bug: 117295826 Test: zip2zip_test.go Change-Id: I5d663e546953af374175837551d23f484d568377
* Speed up build_testDan Willemsen2018-10-291-6/+4
| | | | | | | | Stop writing out ninja files, as they become very large, especially when multiplied by the number of defined products. Test: treehugger Change-Id: Id9529d14040acb72a0188e58b5db2911f142071e
* Rework how linux_bionic is built with LLDDan Willemsen2018-10-223-48/+214
| | | | | | | | | | | | In order to simplify the wrapper function, and stop using a linker script, generate a set of flags to pass to LLD. Then run host_bionic_inject on the linked binary in order to verify the embedding, and give the wrapper function the address of the original entry point (_start). Bug: 31559095 Test: build host bionic with prebuilts/build-tools/build-prebuilts.sh Change-Id: I53e326050e0f9caa562c6cf6f76c4d0337bb6faf
* Turn symbol_inject into a reusable packageDan Willemsen2018-10-2212-3414/+0
| | | | | | Bug: 31559095 Test: m blueprint_tools Change-Id: I0f7a9f14111af26d753db547c6de313a7079658a
* Always allow duplicates with identical CRC32 and sizeColin Cross2018-10-172-10/+29
| | | | | | | | | Don't warn on duplicate files in merge_zips if they have identical CRC32 and size values. Test: m checkbuild Test: merge_zips_test.go Change-Id: I61336ca4d4d3b7402c24a7abd337bd350fe10930
* zip2zip: support included an excluded fileColin Cross2018-10-092-23/+62
| | | | | | | | | | | Make needs to exclude all files that match a filespec except for those specified in a list. Add a -X argument that overrides the -x argument to allow files be included that were previously excluded. Bug: 69500920 Test: zip2zip_test.go Change-Id: Icc8aebc788b53bcdde73a39c9c7cf3107a049251
* zip2zip: add flag to uncompress filesColin Cross2018-10-082-18/+138
| | | | | | | | Add -0 flag to convert files in a zip to stored instead of deflated. Bug: 69500920 Test: zip2zip_test.go Change-Id: I6c2b10f3b200a53a3339e3c97a78f65192b309ca
* Use SoongJavacWrapper for javadocNan Zhang2018-10-022-0/+19
| | | | | | Test: m -j docs; javac_wrapper_test Bug: b/116874473 Change-Id: I51d440c815d3db1a0a5dc26ad4e376189dc0aefe
* Refactor Kati logicDan Willemsen2018-09-281-2/+2
| | | | | | | | | | | | | | | | | Make the cleanspec & Android.mk runs of kati use much of the same code and arguments. Also renames 'Kati' to 'KatiBuild' in many cases, in the the expectation that we'll have a 'KatiPackage' step in the future. Use --no_ninja_prelude and move local_pool & _kati_always_build_ into the combined ninja file. This will reduce the need to re-read makefiles when Goma is enabled, and it allows us to include more than one Kati-generated ninja file in the build graph. Bug: 116968624 Test: build_test on downstream branches Change-Id: Ibdac689b81f62dc293647fad917d84946f2c3cfa