Commit graph

790 commits

Author SHA1 Message Date
Chris Parsons
21f80277c3 Remove bazel dev mode
This mode is no longer in use, and is dead code.

Fixes: 282809863
Test: Presubmits
Change-Id: I45ab7d7c9dee153f1cbc66262c2cf9f1e9487a28
2023-06-15 14:14:19 +00:00
Kiyoung Kim
eaa55a8ce1 Rename soong.environment.used with product name
From the previous work on renaming build.ninja, it was found that there
are extra dependencies from build.ninja which can be varied by
TARGET_PRODUCT : which is soong.environment.used.<tag>. This change
renames soong.environment.used to have target product between 'used' and
'<tag>' if available.

Bug: 277029044
Test: Test confirmed that build.ninja is not being re-generated
Change-Id: I987b6bd1a8b4f06dac52537e4178d8556251d254
2023-06-08 01:07:47 +00:00
Jason Wu
e2df3b5f8f Merge "Add re_analysis environment varibles fields to soong_metrics" 2023-06-07 00:31:46 +00:00
Kousik Kumar
ac985b9c59 Merge "Revert "Remove env config fetcher code"" 2023-06-06 21:26:36 +00:00
Jason Wu
2520f5e36b Add re_analysis environment varibles fields to soong_metrics
Test: Tested by following steps
1.m nothing: field is empty
2.USE_RBE=false m nothing: field log cc_wrapper and rbe_wrapper
3.USE_RBE=false m nothing: field is empty
Bug: 281922291

Change-Id: I1bbb324752b9a2dea1ff2c9df5817559d4cec3a6
2023-06-06 16:11:39 -04:00
Treehugger Robot
2a97e1dc90 Merge "Use HINT_FROM_SOONG if ninja_log doesn't exist" 2023-06-06 02:17:11 +00:00
Treehugger Robot
331c7d77c4 Merge "Clean $OUT/ramdisk_16k dir during installclean" 2023-06-05 23:30:13 +00:00
Kelvin Zhang
dc14fbba1d Clean $OUT/ramdisk_16k dir during installclean
This dir is added during aosp/2595672 for building a 16K page sized
ramdisk.
Bug: 253827893

Change-Id: I0f4b1adff12d2b140aa73fd1b8ee1c606d917a47
2023-06-05 10:20:50 -07:00
Kousik Kumar
5c5c57d039 Allowlist gcert and prodcertstatus binaries
In-order to automatically detect which type of authentication to use for
RBE, we need to be able to run these binaries in bootstrap. Hence
allowlisting them.

Bug: 283828386
Change-Id: I1e0e021acc8283ec3e66c96f6676c6095bf0892b
2023-06-05 11:00:57 -04:00
Jeongik Cha
a87506f5e8 Use HINT_FROM_SOONG if ninja_log doesn't exist
In non-incremental build, there is no ninja_log. For this case, use
HINT_FROM_SOONG as an alternative solution.

Bug: 273947040
Test: 1.m after removing out/.ninja_log
      2.check if non-incremental CI build uses HINT_FROM_SOOONG
      3.check if incremental CI build uses NINJA_LOG
      4.check if there is no regression in CUJ
Change-Id: I00cd216df096cb2288eeab233729acefb0d1b73c
2023-06-02 15:50:02 +01:00
Treehugger Robot
9cae81483a Merge "implement USE_BAZEL_VERSION for m" 2023-06-01 22:06:17 +00:00
Chris Parsons
c83398ffb4 implement USE_BAZEL_VERSION for m
This allows USE_BAZEL_VERSION to be set for m builds, which will use
Bazelisk for any Bazel invocations during those builds.

This should be used only for manual debugging, typically to either test
new Bazel features, verify Bazel compatibility with Android, or culprit
find new Bazel breakages.

Test: Manually run builds with USE_BAZEL_VERSION, toggled off and on to
ensure the build was rerun. Tested with a broken commit, a working
commit, and 'last_green' special term

Change-Id: I8b475dca5c8d4bd849ee3724a8c3aca9b631bcb8
2023-06-01 17:42:18 +00:00
Jeongik Cha
ef17be26a8 Merge "NINJA_LOG option uses usesninjalogasweightlist" 2023-06-01 00:40:42 +00:00
Jeongik Cha
c018d84a00 Merge "Enable NINJA_LOG as weight list source" 2023-06-01 00:40:42 +00:00
Kousik Kumar
d93c67f64c Revert "Remove env config fetcher code"
This reverts commit 6324647bcc.

Reason for revert: This change negatively impacts users running builds on gLinux laptops. Reverting to limit impact and reland with appropriate fix.

Bug: b/284985772
Change-Id: I04a3d0107bb3ea680ba6641240620736a2ef5f17
2023-05-30 20:32:08 +00:00
Kousik Kumar
678e680a75 Merge "Remove env config fetcher code" 2023-05-30 17:28:10 +00:00
Saagar Jha
204beb184a Merge "Replace prodcertstatus with gcertstatus" 2023-05-30 11:12:43 +00:00
Kiyoung Kim
5500fc89c1 Merge "Rename build.ninja with product name" 2023-05-30 07:17:08 +00:00
Saagar Jha
f513b23ac4 Replace prodcertstatus with gcertstatus
Prodaccess is apparently deprecated now.

Test: Build with/without credentials and check that it works

Change-Id: Iaadaebe84fe9531b2d7d5f0d265751462bb827d8
2023-05-26 00:23:50 +00:00
Kousik Kumar
6324647bcc Remove env config fetcher code
This code is no longer needed since we are now setting USE_RBE to true
for 100% of users (except two users, who I'll reach out to over email).
So fetching the configuration is no longer needed since sometimes this
can result in RBE config flipping between on and off (depending on
whether you have gcert or not).

Tested: Ran the build with latest sync and ensured RBE was used for the
build.

Bug: b/283828386
Change-Id: I3cda78607b46a0e161b7841560dc587a44d91f27
2023-05-25 15:23:29 +00:00
Kiyoung Kim
a37d9baa96 Rename build.ninja with product name
Current build.ninja does not contain any product name, while other ninja
files (such as combined ninja) do. This change adds product name to the
build.ninja so it can be separated over multiple lunch targets

Bug: 277029044
Test: build succeeded and checked if out/soong/build.ninja has been
renamed

Change-Id: I16dc71f829fd76f01b98da0d509a8e0ef6f62fa9
2023-05-25 10:09:45 +09:00
Usta Shrestha
6e1aa7830c simplify m clean
`rm -rf out` used to fail because bazel would not set write permission on some files. Now it's been fixed and thus there is little reason to prefer `m clean` (also users are accustomed to `rm -rf out`)

Bug: NA
Test: verified `m clean` works;interestingly soong_metrics file is created at the end
Change-Id: I000d16508613045811fc7792e5798f7c150dcc05
2023-05-23 17:34:15 -04:00
Jeongik Cha
f2af38d2cc Unset BUILD_NUMBER/HOSTNAME in kati.go
BUILD_NUMBER/HOSTNAME is passed by a file, not env variable.
To avoid kati recreation, unset BUILD_NUMBER/HOSTNAME after
writing it into a file

Bug: 278060169
Test: BUILD_NUMBER=1 m && BUILD_NUMBER=2 m (check there is no kati
re-run)

Change-Id: I5a31461dcf1e4b0634974bcb48a0d7482d42852a
2023-05-23 10:35:23 +09:00
Jeongik Cha
4e49bbde93 BUILD_NUMBER and BUILD_HOSTNAME doesn't affect kati regeneration
* Extract BUILD_NUMBER, BUILD_HOSTNAME to file to avoid kati change
* Handle FILE_NAME_TAG_PLACEHOLDER string in dist in build/make/packaging/distdir.mk

Test: check if kati isn't invoked even though BUILD_NUMBER, BUILD_HOSTNAME
  is changed
Test: m && m, and check if the second m is no-op
Bug: 278060169
Change-Id: I65eefc6bb86d4076098a1bf8b317b4cb88201499
2023-05-22 12:22:18 +09:00
Jeongik Cha
d55347133f NINJA_LOG option uses usesninjalogasweightlist
As-is: Even with NINJA_LOG option, ninja weight list is copied from
ninja log
To-be: uses usesninjalogasweightlist to uses ninja log file directly

If weight list is large(more than 100,000 lines), reading the whole list
spends a few seconds(1-3s). It is ignorable in full build, but it might
be considerable in small build or m nothing scenario.

If weight list comes from ninja log, we can just directly read ninja log
data instead of writing weight list from ninja log outside, and read the
weight list. It doesn't spend additional time because ninja log is
loaded by default.

Bug: 271527305
Test: build with NINJA_LOG
Change-Id: Id7a4cca95898ce439d0a682f9bfd954b462f1849
2023-05-20 00:49:39 +09:00
Jeongik Cha
f2ecf7659e Enable NINJA_LOG as weight list source
Bug: 273947040
Test: m
Change-Id: I1a803f5c1da75235395fc594e4f9d17f48c55db8
2023-05-19 14:03:45 +09:00
Chris Parsons
fddeaff4a6 Revert "Turn on HINT_FROM_SOONG by default"
This reverts commit f5c872f36b.

Revert reason: The original commit seems to have a performance regression for a number of benchmarked performance CUJs.

Bug: 283143307

Test: Benchmarking results. See attached bug.
Change-Id: Ib9463c8d30a5ba61640993424696a84e2e03040a
2023-05-17 22:30:34 +00:00
Treehugger Robot
abc2b2adb3 Merge "Turn on HINT_FROM_SOONG by default" 2023-05-15 14:36:05 +00:00
Joe Onorato
8ef13dbb0c Merge "TARGET_RELEASE is unavailable here, so don't print it." 2023-05-12 01:44:46 +00:00
Mark Dacek
923a40777b Merge "Refactor upload-only to process bazel metrics outside of upload.go" 2023-05-10 17:52:40 +00:00
Treehugger Robot
f47760461c Merge "Change bp2build converter of module "package"." 2023-05-10 17:38:19 +00:00
Joe Onorato
98e986542b TARGET_RELEASE is unavailable here, so don't print it.
Test: m
Change-Id: Iacb00db54882ed2578ca1aa1d8e71d5732fbe247
2023-05-10 05:56:57 -07:00
Wei Li
2c9e8d6128 Change bp2build converter of module "package".
1) Use attribute name "default_package_metadata" instead of
   "default_applicable_licenses" in packages to better describe its use.
2) Add a filegroup "default_metadata_file" in packages to search for
   METADATA file in each package.
3) Include "default_metadata_file" in each package's
   "default_package_metadata" attribute.

Bug: 275472038
Test: CIs
Change-Id: I645c013c39e3190fd96c4a549d39a331aced16bd
2023-05-09 17:37:04 -07:00
MarkDacek
733b77c2de Refactor upload-only to process bazel metrics outside of upload.go
Bug: 279987768
Test: m nothing
Test: b build libcore:all (with prints to verify similiar data)
Change-Id: I01d960a7215be30728c9e90f52c2455fd21cf1b8
2023-05-09 20:19:20 +00:00
Mark Dacek
3e63067b11 Merge "Add --bazel-exit-code parameter to soong_ui." 2023-05-09 16:26:46 +00:00
Jeff Hamilton
d27fedf8e9 Add TARGET_RELEASE to the banner printout
Test: run lunch with and without a release and confirmed it's printed
Change-Id: I67e86aa1328ae464a1bb10dfdcd8e024e72d77a8
2023-05-08 03:17:06 +00:00
MarkDacek
d33c2fd5a2 Add --bazel-exit-code parameter to soong_ui.
This is for use in tracking bazel exit codes from b invocations.

Bug: 279754118
Test: b build libcore:all (with prints to verify)
Change-Id: If36b5b73ff93cd15647e5c1c1f676e95137210ff
2023-05-04 21:27:34 +00:00
Cole Faust
0428f71b30 Remove "dumping rbe metrics" message
The issue where RBE was taking a long time has been fixed, so this
message isn't that important anymore, and it was overriding the last
ephemeral status message that soong output.

Test: Presubmits
Change-Id: I019f351a3307176ec7b4786d4387fde9061ba08b
2023-05-03 18:21:05 -07:00
MarkDacek
ed2253e8df Process bazel metrics prior to potentially exiting upload.go
This is a necessary step for running b on CI with metrics collection.

Bug: 280491043
Test: b build libcore:all
Change-Id: I37d621c38e3f891dd63e5977befa6ce6604487ea
2023-05-02 21:35:39 +00:00
Anton Hansson
c8cea365f3 Merge "Remove --skip-kati" 2023-04-27 11:26:50 +00:00
Anton Hansson
50151a7489 Remove --skip-kati
Not used anymore.

Test: No
Change-Id: Ide0d29b773583d6a8faff5b41a82d650cc2f9bcb
2023-04-26 18:09:02 +00:00
MarkDacek
f47e142ffd Refactor MixedBuildsEnabled and add --ensure-allowlist-integrity.
Currently, there is little verification around allowlisted modules
actually being mixed-built. This flag would allow us to verify
that a module allowlisted is mixed-built for at least one variant.

Bug: 278910100
Test: m nothing --bazel-mode-staging --ensure-allowlist-integrity
Test: m nothing --bazel-mode-staging --ensure-allowlist-integrity
--bazel-force-enabled-modules=com.google.android.neuralnetworks (This
fails, as expected)
Test: build/soong/test/mixed_mode_test.sh

Change-Id: Icd5976f4f44f1a8caca1e5247d986642f7995f97
2023-04-25 20:55:07 +00:00
Jeongik Cha
f5c872f36b Turn on HINT_FROM_SOONG by default
In most case, turning on HINT_FROM_SOONG improves build performance even
though a model is not so accurate. At least, it doesn't cause
performance regression (very likely)

Bug: 275458825
Test: m
Change-Id: Ie4ff69e68a93f6f0db3d060980657ae623816b2b
2023-04-14 00:53:24 +09:00
Ramy Medhat
c8f6cc24f9 Enable reclient cache directory.
The cache directory stores files that should persist between builds.
Currently it will contain reproxy.creds, which caches the authentication
mechanism and token used to make subsequent builds faster.

Test: m nothing build takes 7s
Change-Id: Iaaa20b92630405918e5e91e09eca6c798b8fc872
2023-04-03 09:56:10 -04:00
Treehugger Robot
bc2906efef Merge "Modify Soong to utilize from-text android.jar in build" 2023-03-29 20:31:20 +00:00
Treehugger Robot
998fdd7e37 Merge "support PRODUCT_SOURCE_ROOT_DIRS product variable" 2023-03-29 17:04:37 +00:00
Jihoon Kang
1bff0349d4 Modify Soong to utilize from-text android.jar in build
Context
- from-text android.jar files are built using Metalava, and these can be
  utilized in `decodeSdkDep` so that any modules that depends on APIs
  can be compiled using from-text android.jars
- This change removes dependency on source java files when compiling
  stub android.jar files

Implementation
- Modify java_api_library module to create system modules using the
  generated android.jar
- Replace modules in decodeSdkDep to link against java_api_library
  modules
- Add --build-from-text-stub flag to hide the feature behind a flag

Test: m --build-from-text-stub
Bug: 271154441
Change-Id: I104df595edc65c0006820d5ae5b15f1fb167e190
2023-03-28 21:53:45 +00:00
Jeongik Cha
56df091391 Merge changes from topic "b/273282046"
* changes:
  Add HINT_FROM_SOONG option for ninja weight list
  Add EXTERNAL_FILE option for ninja weight list
2023-03-28 03:51:20 +00:00
Sam Delmerico
98a7329d59 support PRODUCT_SOURCE_ROOT_DIRS product variable
Soong analyzes the entire source tree even though not every lunch target
needs to know about every module. For example, OEM sources can be
ignored for cuttlefish products. This functionality allows blueprint to
ignore a list of undesired directories.

Bug: 269457150
Change-Id: I1eec5d7b6a268cae4c633d8d89ed485598ebca45
2023-03-27 14:42:36 -04:00
Jeongik Cha
e114e60615 Add HINT_FROM_SOONG option for ninja weight list
If this option is set, Soong generates ninja weight list including
modules in HugeModulesList in allowlists.go

Test: m --ninja_weight_source=soong
Bug: 273282046
Change-Id: Id92b7f9f9e8152c1c46ae071c5821a479cf47bce
2023-03-23 01:45:27 +09:00