Commit graph

58972 commits

Author SHA1 Message Date
Usta Shrestha
914bbebc13 go.mod readability improvement
Bug: N/A
Test: Verified by loading the project in IntelliJ
Change-Id: I9fa16fbea108436a52fc3bb4b39d9a2c1a73bee5
2022-11-15 21:35:39 -05:00
Spandan Das
ed9729727c Merge changes from topics "nested-nsjail", "ro-api-surfaces-dir"
* changes:
  Special-case Soong finder to look in out/api_surfaces
  nsjail support verification should respect BUILD_BROKEN* flag for SrcDir
2022-11-15 19:56:23 +00:00
Usta (Tsering) Shrestha
4b67bb3013 Merge "re-trigger symlink-forest if bazel.list changes" 2022-11-15 16:09:56 +00:00
Parth Sane
d96735d5cc Merge "Add android.SdkModule to Sdk Versions that have AIDL traces generated" 2022-11-15 13:04:42 +00:00
Paul Duffin
c467a98bc0 Merge "Build mode function should return output file" 2022-11-15 09:37:52 +00:00
Treehugger Robot
ccb63ce404 Merge "Remove a flag from riscv64 that was copied from arm64." 2022-11-15 03:25:03 +00:00
Elliott Hughes
9f0c951862 Remove a flag from riscv64 that was copied from arm64.
This causes us to align the text section to 4KiB, not just the data
section. From the bug that added this for arm64, there was an admission
that it costs 17MiB across the tree, and a not entirely convincing claim
of a performance improvement (undermined by the fact that "some stuff
was faster, some stuff was slower"). See http://b/150506341 for that.

Anyway, let's assume we don't want this for riscv64 for now.

Test: `mm -j` in bionic and readelf on the resulting libtest_empty.so
Change-Id: I0ed592a97ef705175191d9c66271a599af4eb18f
2022-11-15 00:56:04 +00:00
Treehugger Robot
c8a06ca8c8 Merge "Only generated notices for built variants." 2022-11-15 00:53:45 +00:00
usta
40a8159a06 re-trigger symlink-forest if bazel.list changes
Bug: b/258870895
Test: run `m --bazel-mode nothing && touch bionic/docs/BUILD.bazel && m --bazel-mode nothing` Then verify symlink_forest reran and `out/soong/workspace/bionic/docs/BUILD.bazel` does NOT exist
Change-Id: I49797fe52b3e0fb6ffe17ed57b8da0b69628fd7e
2022-11-14 17:50:08 -05:00
Treehugger Robot
7436b78cf2 Merge "Ignore bazel-generated paths in dangling rule test" 2022-11-14 22:41:42 +00:00
Paul Duffin
54616f20b0 Merge "Stop creating unnecessary Context objects" 2022-11-14 22:30:53 +00:00
Paul Duffin
2335544ef2 Merge "Avoid writing soong_build_metrics.pb multiple times" 2022-11-14 22:30:41 +00:00
Paul Duffin
3d12f4e997 Merge "Group mixed mode and normal soong build" 2022-11-14 22:30:26 +00:00
Bob Badour
3800b5a787 Only generated notices for built variants.
Test: banchan dcla-notice mainline_modules_arm64; m apps_only dist
Change-Id: I6b0e2eb64f2f3db87dfed68affb44fe141da3eaa
2022-11-14 14:17:55 -08:00
Spandan Das
394aa32e8b Special-case Soong finder to look in out/api_surfaces
Add a new argument in soong_ui that will be used to gate this behavior.

This approach is expected to solve incrementality issues in multi-tree.
As part of soong's bootstrap process, all source dirs are added to deps
of out/soong/build.ninja (via globs). Since multitree_build writes to the
"source" api_surfaces directory, it changes its mtime and causes a
recompilation of out/soong/build.ninja in the subsequent invocation.

Test: TH (for single-tree)
Test: Inspected ninja files (for multi-tree)
(Run a full build)
touch out/api_surfaces/vendorapi/libc/.../math.h
orchestrator/prebuilts/build-tools/linux-x86/bin/nsjail --config
out/trees/vendor_aosp_cf_arm64_phone/nsjail.cfg --
prebuilts/build-tools/linux-x86/bin/ninja -f out/soong/bootstrap.ninja
-d explain -n out/soong/build.ninja
(ninja: no work to do)

Change-Id: Ib823163ec1153344a2f593daa8d7156c24ff5bc3
2022-11-14 21:10:38 +00:00
Spandan Das
2d997046ba nsjail support verification should respect BUILD_BROKEN* flag for SrcDir
This ensures that soong_ui is successful in setting up its own nsjail in
workflows that externally make the source tree ReadOnly (e.g. a nested
nsjail in multitree).

Test: TH
Change-Id: I6d0ec4a9fffda1d4e5996f475da611e1deb0888d
2022-11-14 19:50:40 +00:00
Liz Kammer
2af5ea85b0 Ignore bazel-generated paths in dangling rule test
Bazel is expected to generate some files and symlinks that will not be
created by aquery, we explicitly ignore files that are in bazel output
paths but are not in a generated file directory.

Test: $ m --bazel-mode-staging checkbuild and verify it gets past
   dangling rule test
Fixes: 258396112
Change-Id: I6dc45ea2613c9e1488ad3eda2313033c717217ff
2022-11-14 13:41:02 -05:00
Paul Duffin
280765acc4 Merge "Improve error reporting when depending on prebuilt implementation jar" 2022-11-14 16:38:11 +00:00
Treehugger Robot
4d87828d15 Merge "Export ndk/aml arches to Bazel" 2022-11-14 16:17:41 +00:00
Paul Duffin
73d394dec2 Merge "Allow namespace config to be tested properly" 2022-11-14 14:08:40 +00:00
Paul Duffin
c61783b20d Improve error reporting when depending on prebuilt implementation jar
The sdk snapshot must not be including implementation code for boot
libraries, the implementation is provided by dex jars within the
corresponding APEX. However, the snapshot does need a module for each
boot library so that the build can seamlessly access the dex files from
the APEX.

A java_library boot library (like core-oj) is represented in the
snapshot by a java_import module which requires a jar file to be
provided, otherwise it is disabled. However, that is provided purely
to keep Soong happy and should never be used.

Previously, the snapshot would contain an empty file for the jar. As
an empty file is an invalid jar any tool (like compiler) that tried
to consume it would fail which was the correct behavior. Unfortunately,
the error message that was produced was not very helpful, it was just
some variant on `invalid file` which lead to a lot of bugs being
raised.

This change replaces that empty file with a reference to the output
from a genrule which runs a script which produces a more useful error
message, with information on how to fix the issue, and fails the build.

It also adds a Name() method to the SdkMemberProperties type as that is
needed in AddInternalModule() to construct the name of the additional
module.

Tested as follows:

In AOSP/master make the following changes:
1. Temporarily set visibility on core-oj and core-libart to
   //visibility:public.
2. Run packages/modules/common/build/mainline_modules_sdks.py to create
   the snapshots.

For each of the S, T and latest snapshots I did the following in the
s-aml-prebuilt-test, t-aml-prebuilt-test and aosp/master branches:

1. Created an Android.bp file containing the following:
  java_library {
    name: "broken",
    static_libs: [
      "prebuilt_core-libart",
      "prebuilt_core-oj",
    ],
  }

2. Fix the visibility issues and run `m broken` where it fails with an
   invalid file.

3. Delete the contents of the prebuilts/module_sdk/art/current/sdk
   directory.

4. Unpack the relevant version of the art-module-sdk snapshot into the
   directory.

5. Run `m broken` where it fails with the helpful message.

6. Test the instructions on how to use the ninja -t path tool to
   identify the cause of the problem and fix it.

Bug: 257969510
Test: See above.
Change-Id: I125bde2d7202afff84c97daebcef37e21c548a3a
2022-11-14 10:14:10 +00:00
Kiyoung Kim
7cc632d3d6 Merge "Make variant headers as arch variant" 2022-11-14 01:01:59 +00:00
Kevin Dagostino
92f33d91f3 Add tools/asuite/atest/ to keep existing BUILD file list
Test:  b build tools/asuite/... && b cquery tools/asuite/...
--output=files

Change-Id: I2696327a60e770d0929ccc1baa3b4af703a2269d
2022-11-12 04:43:17 +00:00
Wei Li
78c07de1dc Add support of <APEX>-installed-files.txt in mixed build.
Bug: 239084750
Test: CIs
Change-Id: Ie3823d1a620c3924111e71aa97df727565261c98
2022-11-11 22:46:33 +00:00
Elliott Hughes
35b83adeae Merge "Revert "Disable stripping for riscv64"" 2022-11-11 20:59:45 +00:00
Liz Kammer
992918d21f Export ndk/aml arches to Bazel
Test: lunch ndk-eng; b build //bionic/libc --config=android
Change-Id: I1ec6f7d0f084aafe948f27111275537b6d9e9637
2022-11-11 15:27:56 -05:00
Vinh Tran
59834cc56d Merge "Remove AfdoAdditionalProfileDirs product variable" 2022-11-11 13:26:49 +00:00
Maciej Żenczykowski
442532a714 Merge "bpf: use PwdPrefix() helper" 2022-11-11 08:11:32 +00:00
Hsin-Yi Chen
06223aed5e Merge "Fix the condition for LLNDK ABI diff" 2022-11-11 06:02:09 +00:00
Kiyoung Kim
3d776f4e66 Make variant headers as arch variant
Make cc_api_variant's header property as arch variant, so headers can be
differed by arch variant

Bug: 244244438
Test: Panther vendorimage build succeeded
Change-Id: I400301793209c9e0214fc118cd4981194d507fbd
2022-11-11 12:59:21 +09:00
Vinh Tran
7a8362c252 Remove AfdoAdditionalProfileDirs product variable
AfdoAdditionalProfileDirs is unconnected to build/make/core/soong_config.mk and is currently unused. Removing AfdoAdditionalProfileDirs will cut down on complexity when we migrate the support of auto-fdo profiles to Bazel cc rules.

b/258684450 proposes an alternative to support the use cases that were meant to be supported by AfdoAdditionalProfileDirs.

Test: existing go tests
Bug: 253540178
Change-Id: I024e48598a560717a1d6c19b16bde3fe65ff1961
2022-11-11 03:29:31 +00:00
Elliott Hughes
8cf3236519 Revert "Disable stripping for riscv64"
This reverts commit 1deeade634.

Reason for revert: create_minidebuginfo is fixed now.

Change-Id: I0cd6136b74d4af0e8a6b9718f6b7172b14522743
2022-11-11 00:59:14 +00:00
Connor O'Brien
6a288bc799 bpf: use PwdPrefix() helper
relPwd is only set if runtime.GOOS != "darwin" but is used
unconditionally. Instead, unconditionally set relPwd using the
cc.PwdPrefix() helper.

Bug: 238165437
Test: m timeInState.o
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: I5294bb6ea95dad60fbf64e9d958e1f1b32a02a48
2022-11-10 16:35:12 -08:00
Wei Li
877336cc3a Merge "Fix the git_master_bazel mixed build breakage." 2022-11-10 21:22:56 +00:00
Connor O'Brien
b573f5ffd2 Merge "bpf: use relative source file path in debug info" 2022-11-10 20:23:28 +00:00
Connor O'Brien
3e739cf426 bpf: use relative source file path in debug info
Enabling BTF leads clang to generate debug line info that includes the
absolute path to the source file. For C++ modules the
-fdebug-prefix-map flag is used to convert these to relative paths. Do
the same for BPF programs when BTF is enabled.

Test: build timeInState.c; strings shows only relative path to source
file
Bug: 238165437
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: Ie4ebc8f9a7d115baeddde5c7ac3ae710335ddf13
2022-11-10 20:22:48 +00:00
Sam Delmerico
1bde1cb668 Merge changes from topics "bp2build-tidy-disabled-srcs", "bp2build-tidy-timeout-srcs"
* changes:
  bp2build for tidy_timeout_srcs
  bp2build for tidy_disabled_srcs
2022-11-10 16:27:24 +00:00
Parth Sane
a114ac9e75 Add android.SdkModule to Sdk Versions that have AIDL traces generated
Test: manual
Change-Id: Ic5fbe9a6e7dc2c898c0ac3b405d46735ab8c3e32
Bug: 236441443
2022-11-10 15:37:47 +00:00
Liz Kammer
dbb9fe8e92 Merge "Increase testing of request_type" 2022-11-10 13:30:58 +00:00
Hsin-Yi Chen
7584bda227 Fix the condition for LLNDK ABI diff
IsLlndk() returns whether the library is an LLNDK stub. The ABI check
should identify LLNDK implementation by isImplementationForLLNDKPublic().

Test: development/vndk/tools/header-checker/utils/create_reference_dumps.py \
      && make
Bug: 227282691
Change-Id: I570871e24d9029992a722b3052f8bb6e7f3c0f52
2022-11-10 16:29:44 +08:00
Wei Li
0643c4ebb5 Fix the git_master_bazel mixed build breakage.
There is no cflags defined for cortex-a9 CPU variant, set it to ArmGenericCflags to fix the mixed build breakage for now.

Bug: 258397103
Test: m com.android.build --bazel-mode-staging
Change-Id: I79a9877846ced6334c09a4f5caf115c436f600e6
2022-11-09 22:43:53 -08:00
Treehugger Robot
d5fd30d94a Merge "Add reference to bundle_file in request_type_test" 2022-11-10 01:04:12 +00:00
Treehugger Robot
01dd619766 Merge changes from topic "clang-tidy-mixed-builds"
* changes:
  add tidy files to mixed builds
  add --norun_validations to bazel build action
2022-11-10 01:00:15 +00:00
Prerana Patil
62253d193b Merge "Revert "Don't add flattened files apex as dependencies of an image apex"" 2022-11-09 20:29:03 +00:00
Treehugger Robot
b7c01a261d Merge "Add com.android.tzdata to AOSP staging allowlist." 2022-11-09 19:53:14 +00:00
Spandan Das
a8fff19350 Merge "Do not glob headers in out/" 2022-11-09 19:27:58 +00:00
Prerana Patil
b1896c88d5 Revert "Don't add flattened files apex as dependencies of an image apex"
This reverts commit b81814a7b4.

Reason for revert: breaking build 9271471

Change-Id: I1876f45b79779d7e8ec46a78bf71bf7fec09e62b
2022-11-09 18:14:34 +00:00
Liz Kammer
1b7ed9bcbc Increase testing of request_type
Test: go test soong tests
Change-Id: Iacb773a91a4cc097320f06ea1d1669c5923f8076
2022-11-09 11:22:11 -05:00
Sam Delmerico
9a9f652bdd add tidy files to mixed builds
Bug: 195029134
Test: m --bazel-mode-dev
Change-Id: I6fa370334c6ff2b6ae4313a7fcbaa34b16b0fa92
2022-11-09 10:12:00 -05:00
Liz Kammer
08626ec9d7 Add reference to bundle_file in request_type_test
Test: go test soong tests
Change-Id: I60e8930e4565a9b076e1f487300e1e2e1d3e66d0
2022-11-09 09:03:52 -05:00