Commit graph

50552 commits

Author SHA1 Message Date
Cole Faust
5d5fcc3092 Ignore assignments to .KATI_READONLY
Since the rbc results file is sorted, .KATI_READONLY
ends up trying to make a variable that hasn't been defined
yet readonly, which is an error.

It's not really worth supporting moving it down in the list,
because it wouldn't affect the variable being writable while
still in Starlark code.

Bug: 226974242
Test: go test
Change-Id: I9402f69be97e5c7cf010ad86f124422ea55fda7f
2022-04-26 18:02:05 -07:00
Treehugger Robot
7cb3f50fda Merge changes I8ef31373,Ic408857d
* changes:
  Disable newapi check in defaults
  Enforce newapi check only if min_sdk_version < compile_sdk_version
2022-04-27 00:55:56 +00:00
Cole Faust
9df1d73657 Allow seeing include $(x) when there is an include_top comment
Previously, seeing anything other than an interpolate variable
was not allowed.

Bug: 226974242
Test: go test
Change-Id: I48a060f9a3fd19cd67a114d2cb0756ab2be25ce1
2022-04-26 17:46:49 -07:00
Chih-hung Hsieh
863ebc3199 Merge "add ALLOW_LOCAL_TIDY_TRUE and some tests" 2022-04-27 00:19:03 +00:00
Cole Faust
1e27586012 Recognize some unsupported functions
Some functions are called without the use of $(call),
since $(call) is not necessary when the function doesn't
take any arguments. mk2rbc thinks these function calls
are local variables, and converts them as such. This
leads to undefined variable errors when trying to load
(before even executing) the starlark file.

Hardcode a known function that should not be converted
to a local variable.

Bug: 226974242
Test: go test
Change-Id: I5567a34fcc282b181a7e78ac3d5cc9b40bd025a2
2022-04-26 14:53:25 -07:00
Cole Faust
00afd4f8b9 Ignore variable assignments that come after a rule definition
These private variables sometimes have references to make
variables like $< or $@. When converted to starlark, they
become invalid local variables like _< and _@, preventing
the file from being loaded even if it's never executed.

Bug: 226974242
Test: go test
Change-Id: Iafd4c6939731f3b7c051c9e41464134d5b672f23
2022-04-26 14:01:56 -07:00
Colin Cross
97d87760b4 Use --dependency-file when linking elf files.
Use the new --dependency-file flag for lld to produce a deps file.

Fixes: 137961579
Test: m checkbuild
Change-Id: I4e0724795a4237ef4560f814e5ef40e44591d776
2022-04-26 13:58:01 -07:00
Chris Wailes
d0fba50d71 Merge "Update RustDefaultVersion to 1.60.0" 2022-04-26 20:37:34 +00:00
Chih-Hung Hsieh
104f51f70b add ALLOW_LOCAL_TIDY_TRUE and some tests
* A new ALLOW_LOCAL_TIDY_TRUE variable, default is false.
* If it is 0/false, local "tidy:true" is ignored.
* If it is 1/true, local "tidy:true" is honored as it is now.

Bug: 229779921
Test: make with and without ALLOW_LOCAL_TIDY_TRUE=1
Change-Id: I0323289a4d3bb2514982252a5a1339e94f2bbaab
2022-04-26 13:30:32 -07:00
Cole Faust
a99afdfc22 Allow comparing $(wildcard) results to non-empty values
Also remove the file existence functions because they
can just be wildcards instead.

Bug: 226974242
Test: go test
Change-Id: Icbf65c47af97a710580864e8b76e2697aba96dd8
2022-04-26 12:06:49 -07:00
Muhammad Haseeb Ahmad
7e74405b2d Add jni support to java_fuzz_host
Bug: 219782880
Test: m example_java_fuzzer_with_native_lib, go test -run TestJavaFuzz
Change-Id: I1d05fb449e5378a27a0096869d9c12ca0a1245c6
2022-04-26 18:49:02 +00:00
Cole Faust
2005298b68 Convert includes/inherits inside evals
These occur in some vendor makefiles in
order to include files in a foreach loop.

Bug: 226974242
Test: go test
Change-Id: I59242eba9a2d7c659994556d9123b6481f4a8130
2022-04-26 10:44:08 -07:00
Liz Kammer
f31c90050c Share CreateModule between hooks & mutators
These contained duplicate code, but evolved separately in the effort to
identify module type of those created with CreateModule. This refactors
to share a common implementation between the two.

Test: m json-module-graph and verify Type fields
Test: CI
Change-Id: Ifdb9a006d9b1bef7411f9ce3a4384797693b4bfc
2022-04-26 09:08:55 -04:00
Jooyung Han
036ef1f8f6 Clean up min_sdk_version allowlist
Hard-coded min_sdk_version is not necessary for kotlinx-* modules
because they are already marked by updater script.

Bug: 158059172
Test: m nothing
Change-Id: I42cf26c9390244f93059af68027cca4f8518a828
2022-04-26 16:21:28 +09:00
Christopher Parsons
be9b9deef9 Merge "Improve bazel action status mnemonics" 2022-04-25 20:57:17 +00:00
Liz Kammer
c2554b6df2 Delete some unused functions.
Test: cc soong tests
Change-Id: Ifa60cdd19aa9151656a6a9df295fe42ec1d8fd46
2022-04-25 16:00:17 -04:00
Treehugger Robot
e1d067b529 Merge "Update to clang-r450784d" 2022-04-25 18:21:38 +00:00
Spandan Das
397e910835 Disable newapi check in defaults
- Making newapi disabled by default will ensure that this lint check
  does not run on the platform. This prevents noisy lint warnings like b/228956345#1
- This lint check will continue to be enforced on the transitive deps of
  apexes, since lint.strict_updatability_linting will be true for those
  Soong modules

Test: TH
Test: m
out/soong/.intermediates/frameworks/base/services/core/services.core.unboosted/android_common/lint/lint-report.xml
// file no longer contains "Call requires API level ..." warning
Bug: 228956345

Change-Id: I8ef3137394011fb679a1129f80f6351fb05a4eff
2022-04-25 18:17:11 +00:00
Spandan Das
ba7e532a11 Enforce newapi check only if min_sdk_version < compile_sdk_version
- NewApi check should be enforced only if min_sdk_version is less than
  the compile_sdk_version (the opposite direction should be a different
  build-time error)
- Change the datatype of *sdkVersion to android.ApiLevel (from string)
  to support version comparisons

Test: go build ./java
Test: no changes in ninja file
Bug: 228956345

Change-Id: Ic408857db7760d912ef4694d2ed72c0b7106eb04
2022-04-25 18:12:50 +00:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
126bd58e72 Handle cc_defaults' shared for cc_library_shared
Akin to testing for cc_defaults' `static`, we introduce
a `shared` sibling to
TestStaticLibrary_SystemSharedLibsStaticEmpty

Bug: 195451854
Test: TestCcLibrarySharedSystemSharedLibsSharedEmpty
Change-Id: I63cb0641d216e8c11586ecf415fa2441e31dd3e5
2022-04-25 17:24:33 +00:00
Martin Stjernholm
e559b1f5ff Merge "Skip linux_bionic by default in the build tests." 2022-04-25 16:54:49 +00:00
Jingwen Chen
d21a8a5a42 Merge "Append APEX version instead of build ID for APK-in-APEX paths." 2022-04-25 11:45:46 +00:00
Ian Zerny
727ab9033a Replace DEX_FLAGS by flags for D8 and R8.
This adds the heap space flag currently set in wrappers.

Bug: b/227746536
Test: manual
Change-Id: Ic3cb8feb7a09d690ecd309162236e49a8d1e52c6
2022-04-25 11:17:07 +02:00
Yi Kong
a126c63042 Update to clang-r450784d
This respin contains performance improvements to clang-tidy and lld, and
fp16 cost fixes.

Test: presubmit
Bug: 219872481
Change-Id: I322a680cdc6ebc0f1fe3735ed087477e7f2508fe
2022-04-24 12:40:02 +08:00
Treehugger Robot
224879e794 Merge "Fix error message formatting" 2022-04-23 12:24:08 +00:00
Cole Faust
94c4a9ac62 Convert $(words) to Starlark
Bug: 226974242
Test: go test
Change-Id: I8ab5943306586c6a993df470e7a2894dd7ff1619
2022-04-22 17:43:52 -07:00
Chris Wailes
c28bd05753 Update RustDefaultVersion to 1.60.0
Test: m rust
Change-Id: I5fb8a831b77cb715679c4653d22aba78c1e19db2
2022-04-22 15:42:18 -07:00
Sam Saccone
12097e3109 Merge changes I1fb78d7c,Ic836282f
* changes:
  Background distGzipFile to speed up CI builds
  Fix some problems with soong metrics loading
2022-04-22 15:53:42 +00:00
Pedro Loureiro
ea2f5eff5e Fix error message formatting
Test: m nothing

Fixes: 230086179
Change-Id: Ieb6a7de9dcf0c12184c868b5af9af52c7b4bfa5e
2022-04-22 13:53:16 +00:00
Treehugger Robot
7436a7121f Merge "Updates test_config_fixer to also work for SuiteApkInstaller" 2022-04-22 07:12:45 +00:00
Dan Willemsen
80d7261821 Background distGzipFile to speed up CI builds
These can take a minute or more of build time, and currently hold up
other processing. We could move to a parallel compression scheme to
speed them up, but it's simpler just to background them and continue the
build, waiting to make sure they've finished before exiting.

Testing this on git_master/flame-userdebug:

This brings a local no-op `m nothing dist` build from 2m1s to 1m39s,
even though most of that time is still spent waiting on these (since
there is very little else happening in a `nothing` build when Soong and
Kati don't need to run).

Running `touch art/Android.mk; m nothing dist` (so the above, but with
Kati) goes from 3m39s to 2m2s. We spent 9 seconds at the end waiting for
these to finish.

CI cases that almost always run Kati plus some number of other actions
are likely to completely hide the time taken to dist these files.

Bug: 229932999
Test: Check $DIST_DIR, files still exist
Change-Id: I1fb78d7c4d5103d72b5d71d9277dea0d452f8968
2022-04-22 04:03:29 +00:00
Treehugger Robot
b2d87ef0bd Merge "Bump minimum minSdkVersion to 19." 2022-04-22 03:16:05 +00:00
Treehugger Robot
00be8b8bda Merge "Limit JIT tier for D8" 2022-04-22 02:42:06 +00:00
Jooyung Han
6bc1cf2c26 Merge "Support deterministic output for bootimg/filesystem" 2022-04-22 00:34:42 +00:00
Dan Willemsen
de3604453f Fix some problems with soong metrics loading
If we didn't need to run soong_build during the current run, we still
try to load the soong metrics. But in the case of `dist`, that's in a
directory that is not guaranteed to persist between runs.

Make loading the soong metrics optional if the file does not exist. Also
fixes a variable shadowing issue that meant we never passed it into
ctx.Metrics.

Test: treehugger
Change-Id: Ic836282f4d13e91daa0e7241ad7c488de3293d8b
2022-04-21 21:03:02 +00:00
Trevor Radcliffe
542954f5cb Refactor cc/bp2build.go to use parse helper
Fixes: 228965274
Test: m bp2build
Change-Id: I3d8bb158d76752f2def6d5eb55d72b47020d82ca
2022-04-21 20:04:42 +00:00
Jared Duke
0cf7c9686d Limit JIT tier for D8
Standalone D8 invocations tend to be shorter-lived than R8 invocations
that involve deeper layers of bytecode optimization. Introduce a
separate set of JVM flags to pass to D8 invocations which limit the
runtime JIT tiering, reducing overall compile times and significantly
reducing total CPU consumption for D8 build workloads.

Representative incremental build times with this change:
 * real 6m1.388s
 * user 63m32.412s
and without:
 * real 6m30.624s
 * user 79m12.626s

Bug: 205303544
Test: time m
Change-Id: Ic568a4316325c6a4e0da41ffebbb07f0c5f7e8e3
2022-04-21 18:24:52 +00:00
Liz Kammer
7eed538208 Remove unused uses_sdks property for apexes
Test: m nothing & compare build.ninja before/after
Change-Id: I3f1199af338e1d2e48ec29cf9f59b6b36236c4cc
2022-04-21 11:13:45 -04:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
66e6466e0f Merge changes from topic "b/215723302"
* changes:
  Use prebuilt_file for prebuilt_{etc,usr_share}
  Abstract prebuilt_etc into prebuilt_file
2022-04-21 14:37:46 +00:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
bff2e88a85 DoNotConvert tzdata nor tz_version
In using prebuilt_file for prebuilt_{etc,usr_share}, Bazel now sees such
targets translated and doesn't permit a target name to alias e.g. its
`src`. Thus we temporarily disable the conversion of the `tz_version` and
`tzdata` whilst their in-tree sources are updated. Their conversions
will be reenabled afterward.

Bug: 215723302
Test: bp2build.sh
Test: mixed_{libc,droid}.sh
Change-Id: Ie19813ccb0fb93c90b54bfd19c909ed15b826385
2022-04-21 14:37:12 +00:00
Jingwen Chen
6cb124b8d9 Append APEX version instead of build ID for APK-in-APEX paths.
This CL removes the build_id.mk suffix and replaces it with a hardcoded
placeholder string that will be replaced with the actual version in
apex_manifest.json by apexer at apex construction time.

This means that as long as the apex version is incremented, the
APK-in-APEX will be installed to a new directory path from the package
manager's perspective.

Fixes: 229574810
Bug: 229625490
Bug: 226559955
Bug: 224589412
Bug: 227417611
Bug: 228157333
Bug: 228803590
Bug: 229136249

Test: atest StrictJavaPackagesTest
Test: soong tests
Test: deapexer list out/dist/com.google.android.permission.apex
Change-Id: I9cef1418c3fc7e0970d96995b8398f5e82f479e0
2022-04-21 10:20:51 +00:00
Jingwen Chen
3a5be76dc0 Merge "Suffix the build ID to the dirname of APK-in-APEX files." 2022-04-21 09:24:22 +00:00
Treehugger Robot
fa8fce5542 Merge "Recursively list Android image contents." 2022-04-21 06:25:10 +00:00
Jooyung Han
65f402b780 Support deterministic output for bootimg/filesystem
Adding salt to bootimg/filesystem so that avbtool can produce the same
output with same input.

Adding timestamp/uuid to filesystem so that resulting image can be
deterministic.

Bug: 229784558
Test: m com.android.virt
      # remove intermediates and touch some sources
      m com.android.virt
      # compare two built artifacts
Change-Id: I4e4668fd0ac42a35bea5a33ec3ae8c362b6a6bd2
2022-04-21 14:36:40 +09:00
Wei Li
7023c80e19 Merge "Put provenance_metadata.textproto in dist directory." 2022-04-21 04:04:41 +00:00
Sasha Smundak
a76acba553 Add cross-referencing support for Rust
Bug: 222044478
Test: run TARGET_BUILD_VARIANT=userdebug TARGET_PRODUCT=cf_x86_64_phone XREF_CORPUS=googleplex-android.googlesource.com/codesearch/android build/soong/build_kzip.bash
Change-Id: Ia12eed53fafd0cbbbf2cc499fa20a0f5a40031de
2022-04-20 20:02:28 -07:00
Sasha Smundak
fe11851029 Recursively list Android image contents.
Relies on debugfs utility to inspect image contents.
The output looks something like this:
```
./
./app/
./app/Calendar/
./app/Calendar/Calendar.apk
```

Test: manual
Change-Id: Ia05f4e857dfd28ac76ac2b450b08f5cf5577d21f
2022-04-20 20:02:11 -07:00
Wei Li
7cf80a65a8 Put provenance_metadata.textproto in dist directory.
Bug: 217434690
Test: m dist
Change-Id: I2f0d51846b3aad48c923c2f281ed42b6d4fe2a1d
2022-04-21 00:02:09 +00:00
Dan Albert
862a7c5b5e Bump minimum minSdkVersion to 19.
We need to land an update to the NDK prebuilts and the NDK no longer
supports APIs 16-18.

Bug: https://issuetracker.google.com/228670422
Test: treehugger
Change-Id: I996b0eb65a7d1ae4cc0687b7ed8f533fbbba295d
2022-04-20 22:54:42 +00:00
Dan Albert
e31a071389 Merge changes from topic "abigail-werror"
* changes:
  Disable ABI dumping for hwasan builds.
  Abort on abitidy errors.
2022-04-20 19:19:07 +00:00