Commit graph

66509 commits

Author SHA1 Message Date
Sharjeel Khan
3c5d4c257d Removed order file use flags from being passed to cflags
The orderfile use flags are unused as cflags causing warnings which becomes errors in some order file builds
In addition, I fixed the test cases so it only looks at ldflags not cflags for orderfile use flags.

Test: mma build/soong
Output: #### build completed successfully (05:14 (mm:ss)) ####

Change-Id: I2a2d846d6688fd5256cf753267c000ff054d56f1
2023-08-11 23:28:46 +00:00
Cody Schuffelen
a405301f03 Merge "Darwin/Mac OS host rust compilation fixes" into main 2023-08-11 20:44:55 +00:00
Chia-Chi Teng
4e0f6451ca Revert "Handle Clang's change of defaults from -fcommon to -fno-common"
This reverts commit a4a4d29509.

Reason for revert: DroidMonitor-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?branch=git_udc-dev-plus-aosp&target=aosp_cheetah-trunk_staging-userdebug&lkgb=10647066&lkbb=10647484&fkbb=10647184, bug 295551355.

Bug: 295551355

Change-Id: I9b68cdac258b26f975e1e575a383b789c87adaa4
2023-08-11 19:59:44 +00:00
Wei Li
5428433766 Merge "Remove diffs of symlinks in root directory which are included in product SBOMs now." into main 2023-08-11 18:38:12 +00:00
Zijun Zhao
88df1d3e0b Merge "Handle Clang's change of defaults from -fcommon to -fno-common" into main 2023-08-11 15:29:43 +00:00
Jooyung Han
4ed512b3c7 apex: respect relative_install_path of rust modules
Bug: 295453836
Test: m
Change-Id: I0637d13f6f87fead3cf53a093d9ce84dea681a08
2023-08-11 16:32:58 +09:00
Juan Yescas
83a740e888 Merge "soong: Add product variable DevicePageSizeAgnostic" into main 2023-08-11 05:45:44 +00:00
Wei Li
0634397cd8 Remove diffs of symlinks in root directory which are included in product SBOMs now.
Also explicitely ignore some diffs that were ignored because of "-I /bin".

Bug: 272358980
Test: build/soong/tests/sbom_test.sh
Change-Id: I8a19fdaa89c9f6b4a11c107df98bca647323db26
2023-08-10 18:18:21 -07:00
Treehugger Robot
34a1c57b05 Merge "fix protos in another dir + a module that uses it" into main 2023-08-10 20:53:56 +00:00
Treehugger Robot
1824463396 Merge "Remove pdk product variable" into main 2023-08-10 20:47:50 +00:00
Liz Kammer
7dc6bcbd58 fix protos in another dir + a module that uses it
Protos in another directory were using import prefix, which was
prepending the repository-relative path with the value, instead, we want
to strip the prefix of the directory of the module the protos were used
in such that they can be referenced at the appropriate relative path.

Reference on import_prefix:
https://bazel.build/reference/be/protocol-buffer#proto_library.import_prefix

Test: b build //packages/modules/adb:libfastdeploy_host
Change-Id: If050b0f5fc5103bd9cc5a99703bd604325aa4204
2023-08-10 14:19:39 -04:00
Cole Faust
8dc9e917aa Remove pdk product variable
It has no effect.

Test: Presubmits
Change-Id: Ia15cd99ce083294a119203c416046e43d20bf87f
2023-08-10 10:20:03 -07:00
Treehugger Robot
19e00b350a Merge "Replace -bootclasspath and -classpath metalava options with --classpath" into main 2023-08-10 17:12:16 +00:00
Dennis Shen
1988ccf5bf Merge "Implement rust_aconfig_library" into main 2023-08-10 17:10:29 +00:00
Paul Duffin
f8aaaa13f4 Replace -bootclasspath and -classpath metalava options with --classpath
Metalava has not differentiated between bootclasspath and classpath for
years so this change replaces the use of the two deprecated single
hyphen options with `--classpath`.

Bug: 295136054
Test: m checkapi
Change-Id: I3ab20b76a60cab66a27784b7d87a069813d19835
2023-08-10 15:16:35 +01:00
Yu Liu
b6e0a64bf1 Denylist a couple art modules that depend on unconverted modules.
Bug: None
Test: bp2build.sh
Change-Id: If2d86cbc0abf9f832cc825c2915cb3bb62fd8d08
2023-08-10 00:09:29 +00:00
Juan Yescas
0106560e34 soong: Add product variable DevicePageSizeAgnostic
The product variable DevicePageSizeAgnostic will determine
whether AOSP is kernel page size agnostic or not.

Test: source build/envsetup.sh
      lunch aosp_cf_arm64_phone_pgagnostic
      m
      cat out/soong/build.aosp_cf_arm64_phone_pgagnostic.ninja | grep __BIONIC_NO_PAGE_SIZE_MACRO
Bug: 289419664
Change-Id: I33a1a4f1967d7e78432b7b8d90357d16b2002dcc
2023-08-09 16:46:07 -07:00
Treehugger Robot
3537d8028a Merge "Disable zipbomb detection inside the build" into main 2023-08-09 22:04:03 +00:00
Wei Li
13acefe99c Merge "Remove diffs of flags files that included in product SBOM." into main 2023-08-09 21:28:54 +00:00
Treehugger Robot
2478d70ead Merge "Update allowlist for framework" into main 2023-08-09 20:14:51 +00:00
Liz Kammer
877b846707 Update allowlist for framework
Test: bp2build.sh
Change-Id: I8801dba735a0daf3c03b30bee8365d4ec998e4c2
2023-08-09 13:11:50 -04:00
Yu Liu
4fa1bfe169 Merge "Allowlist some more cc_test modules after the runfiles support" into main 2023-08-09 16:05:39 +00:00
Treehugger Robot
18801036c7 Merge "Stop using single-hyphen metalava options" into main 2023-08-09 14:35:40 +00:00
Paul Duffin
808211e519 Stop using single-hyphen metalava options
`-encoding` and `-source` have been deprecated in metalava.

`-encoding` actually does nothing apart from check to make sure that
the value is `utf-8` (in some case). Metalava always uses `utf-8`.

`-source` has been deprecated in favor of `--java-source` as metalava
also can consume kotlin and it has its own `--kotlin-source` option.

Bug: 295136054
Test: ./gradlew
Change-Id: I08e6931958f40022d65d417360e32b72a1d70444
2023-08-09 12:38:46 +01:00
zijunzhao
a4a4d29509 Handle Clang's change of defaults from -fcommon to -fno-common
Remove fcommon and make fno-common by default.

Bug: b/151457797
Test: make checkbuild
Change-Id: I38a858b1d41d6567bdd0fbc91b307b0270ab51b1
2023-08-09 04:54:37 +00:00
Wei Li
dbedb0c8a4 Remove diffs of flags files that included in product SBOM.
Bug: 272358980
Test: build/soong/tests/sbom_test.sh
Change-Id: I65acea2e854bc983b6e12ab247afcb702c410988
2023-08-08 17:36:30 -07:00
Vinh Tran
457ddef28e Implement rust_aconfig_library
rust_aconfig_library generates src/lib.rs and uses it to build library variants (dylib, rlib-rlib_std, and rlib-dylib_std) as of what `rust_library` produces

Test: go test
Change-Id: I6c4603691d4306c463c2e9521f5c11c30765b1e3
2023-08-08 17:30:52 -04:00
Treehugger Robot
69bda98f50 Merge changes I816f209e,I9e4d51c3 into main
* changes:
  Handle enabled: false via conditions_default
  Handle nil enabled values
2023-08-08 19:35:54 +00:00
Colin Cross
002764c8ee Merge "Don't generate aapt2 srcjars when using resource processor" into main 2023-08-08 18:57:02 +00:00
Treehugger Robot
fda9efab7f Merge "Revert^2 "Export NewPrebuiltBuildTool"" into main 2023-08-08 18:41:09 +00:00
Liz Kammer
6b6b150d0a Merge "Add unconverted reason for jarjar incompatibility." into main 2023-08-08 17:19:13 +00:00
Spandan Das
846ce68a2f Handle enabled: false via conditions_default
In this Android.bp file
```
my_cc_defaults {
  enabled: false,
  soong_config_variables: {
    my_bool_variable: {
       conditions_default: {enabled: false},
    }
  }
}
```
The inner enabled: false is a no-op because the top-level enabled is
false. Currently, bp2build will raise an exception for this Android.bp
file.

However, it does not need to. `productVariableConfigEnableLabels` runs
only if the top-level enabled is false. If it sees enabled: false via
conditions_default, it should just ignore it since it is a no-op.

Test: go test ./bp2build
Bug: 210546943
Change-Id: I816f209eaf21de65ddfbc2893e5255be94bcaa11
2023-08-08 16:54:34 +00:00
Kousik Kumar
97e9b0cb8e Merge "Revert "Revert "Remove env config fetcher code""" into main 2023-08-08 15:59:56 +00:00
Treehugger Robot
21b19f9ca8 Merge "Use string.Builder" into main 2023-08-08 14:35:15 +00:00
usta
da2a211bbd Use string.Builder
with 4000X clones of adbd, bp2build.Codegen time goes from 36s to 7s

Test: m bp2build and verify same BUILD.bazel files
Bug: 292281398
Change-Id: Ibd3b328a917fe5d1bdad67c67116da336f9033cb
2023-08-08 13:29:07 +00:00
David Srbecky
5d52dce822 Revert^2 "Export NewPrebuiltBuildTool"
Reason for revert: This is safe to land on its own (without topic)

Change-Id: I8649878d042a46582260033a14768391ccc13960
2023-08-08 11:26:23 +00:00
Joanne Chung
1d7964a941 Merge "Revert "Export NewPrebuiltBuildTool"" into main 2023-08-08 03:20:00 +00:00
Spandan Das
479e39f8fb Handle nil enabled values
If enabled does not appear inside `soong_config_vars`, we can ignore it.

Bug: 210546943
Test: go test ./bp2build

Change-Id: I9e4d51c3b683f262921449634f827915ce87dc8d
2023-08-08 02:19:38 +00:00
Joanne Chung
14e0956931 Revert "Export NewPrebuiltBuildTool"
Revert submission 2696994-art-check-cfi

Reason for revert: DroidMonitor-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?branch=git_main-without-vendor&target=sdk-sdk_mac-next&lkgb=10623159&lkbb=10623764&fkbb=10623764, bug b/294917304

Reverted changes: /q/submissionid:2696994-art-check-cfi

Change-Id: Id4adc1266c3f643b8c312f390e708d148a161314
2023-08-08 02:14:40 +00:00
Spandan Das
09f6b1390c Merge changes I8ca452aa,I437fc890,If9446700 into main
* changes:
  Handle .proto files in different package for filegroups
  Handle .proto files that end up in a different package
  Allow creation of BazelTargets in a different directory
2023-08-08 00:51:52 +00:00
Spandan Das
df3ec82b62 Handle .proto files in different package for filegroups
Followup to aosp/2693190, this CL adds the support to filegroups.
<mod>__bp2build_converted is now an alias to a proto_library
target <mod>_proto. This proto_library will be created in a different
package if the .proto file exists in a different package.

Test: bp2build unit tests
Test: TH
Bug: 292583584
Change-Id: I8ca452aacf1a86dfc9e218464e38aab89afa5a29
2023-08-07 21:39:05 +00:00
Treehugger Robot
541c1cab00 Merge "Export NewPrebuiltBuildTool" into main 2023-08-07 19:27:44 +00:00
Spandan Das
c53767e434 Handle .proto files that end up in a different package
Bazel poses a strict requirement that .proto files and proto_library
must be in the same package. This CL handles this automatically by
creating the proto_library in a separate dir/package if necessary

Implementation details
- Partition the `srcs` by package. `srcs` has been computed using
  `transformSubpackagePath`, so the information about packages is
  available at this point
- Create a proto_library in each package by using
  `CommonAttributes.Dir`. Collect all these additional libraries
  and put them in `info.Proto_libraries` so that they get added as deps
  of (cc|python|...)_proto_library
- Add an import_prefix to the proto_library in subpackages relative to
  the current directory. This relies on the assumption that every src is
  beneath the current directory (Soong will complain if a path in
  Android.bp contains ../)

filegroup module type uses a separate code-path to create proto_library.
This will be handled in the next CL in stack.

Test: bp2build unit tests
Test: TH
Test: Built the failing internal module mentioned in
b/292583584#comment1

Bug: 292583584

Change-Id: I437fc89092321b26c5f0511387cde9e84084d6f9
2023-08-07 19:18:03 +00:00
Spandan Das
3131d679f2 Allow creation of BazelTargets in a different directory
The current API restricts creation of targets to the directory of the
visited soong module. This CL proposes adding a `Dir` property in
`CommonAttributes` that can be used to create a bazel target in
a specific dir. The use case for this is to dynamically create
additional targets for proto_library that are adjacent to .proto files
(Bazel poses a strict requirement about proto_library being in the
same package as the .proto file, but Soong does not)

Usage is restricted to dirs that have an existing Android.bp file. There
are some places in bp2build where we use existence of Android.bp/BUILD
on filesystem to curate a compatible fully qualified path (e.g. headers).
If we use `CommonAttributes.Dir` to arbritraily create BUILD
files, then it might render those curated labels incompatible.

Test: go test ./bp2build

Change-Id: If9446700457eddfb389be9d9bde39087f67daa60
2023-08-07 19:17:03 +00:00
David Srbecky
54bfc7aad6 Export NewPrebuiltBuildTool
Test: m check_cfi
Change-Id: Id150d8f785b9b8df5aa3f8f5e2ca9b59225df16a
2023-08-07 16:05:34 +00:00
Treehugger Robot
38a72e717b Merge "cosmetic: unused argument" into main 2023-08-07 14:43:51 +00:00
Treehugger Robot
7660e71895 Merge "add bp2build subevents" into main 2023-08-07 14:43:01 +00:00
Kevin Jeon
51732356b8 Merge "Revert "Add libdumpstateutil to vendor variant list"" into main 2023-08-07 14:38:17 +00:00
Treehugger Robot
778e5ba4d6 Merge "Add bazelbuild-rules_python to soong_integration_tests" into main 2023-08-05 06:17:38 +00:00
usta
36249c7b1e Add bazelbuild-rules_python to soong_integration_tests
Test: `atest_bazel_standalone_output_paths_contain_product_name`
Bug: 294616978
Change-Id: I40d00ee2453998122910a3ac87c681aa0b9df19c
2023-08-04 22:17:03 -04:00