Commit Graph

3008 Commits

Author SHA1 Message Date
Lukács T. Berki 5c39599d43 Merge "Make bp2build be more correct." am: a52ae26e91 am: 82dfffcc54 am: 7a6a4b44c4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1675519

Change-Id: I5abe9e542fae02493788274774ba2d7fc3fe6a11
2021-04-15 15:19:31 +00:00
Lukacs T. Berki d518e1a407 Make bp2build be more correct.
It now handles adding .bp files and changing globs.

In order to do this, depfiles are now written separately from RunBlueprint.

This is necessary due to the confluence of a number of seemingly
unrelated factors:

1. The glob filelist dependencies are discovered in globSingleton
2. Singletons need to be registered because otherwise singleton module
   types panic
3. Singletons don't work because they require mutators bp2build does not
   run

Due to (1), we would need to run the glob singleton. However, due to (2)
and (3), we can't run singletons and have to run Blueprint with
StopBeforeGeneratingBuildActions, which is when the build actions
writing glob files would be generated. So what happens is:

1. When bp2build is run, the glob singleton is disabled
2. At the end of bp2build, the list of glob files is artifically added
   to the depfile of the workspace marker file
3. When build.ninja is generated, the Ninja file containing the glob
   list file is written by the now-active glob singleton

Test: Presubmits.
Change-Id: I3c5898d8c57c554a93520276c64a952afc912dbe
2021-04-15 13:06:16 +02:00
Treehugger Robot 8c7ceeccdd Merge "Transform paths to headers in include dirs to take package boundaries into account." am: b06a4bd400 am: 42599cfc57 am: 36c57bdfb3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1673638

Change-Id: I8a1ec7755fdafe6c8eb71ccb3765bb9e44c8fd72
2021-04-15 07:20:30 +00:00
Treehugger Robot 3c58641466 Merge changes from topic "userdebug_plat_sepolicy.cil_Android.bp" am: 638830a5a0 am: d8a1386fba am: 7d5dc83e3b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1674328

Change-Id: Ic6146823d24ddbfcc7706d33ee2d17bad9471325
2021-04-15 07:20:23 +00:00
Inseob Kim 1e9e06373e Add path tests for ramdisk am: d9580b84a2 am: df6f8f8fa8 am: 5271dce3dd
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1674327

Change-Id: I9b199042d08b0e6022c7e2a281e622ec2b87b420
2021-04-15 07:20:19 +00:00
Treehugger Robot 507c35d88f Merge "Fix evaluation order of (Cfi|Memtag) exclude paths." am: d820c37425 am: 6ff0d4084e am: 4182f482f4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1672705

Change-Id: I4c10f9ccf8cbaae2dc0e3b953e7c4db0368f073a
2021-04-15 05:50:56 +00:00
Inseob Kim df6f8f8fa8 Add path tests for ramdisk am: d9580b84a2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1674327

Change-Id: I128281177de9109e7e47fb78689377296134b860
2021-04-15 05:44:25 +00:00
Treehugger Robot b06a4bd400 Merge "Transform paths to headers in include dirs to take package boundaries into account." 2021-04-15 05:42:40 +00:00
Treehugger Robot 638830a5a0 Merge changes from topic "userdebug_plat_sepolicy.cil_Android.bp"
* changes:
  Add debug ramdisk variant
  Add path tests for ramdisk
2021-04-15 05:22:35 +00:00
LuK1337 955d0e72f2 Make sure prebuilt modules are exported before attempting to use them am: fb545bf2f3 am: fa52ea69bf am: 2e434b4f70
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1545468

Change-Id: Ic4ecbedbe6c11992232ea3981b002de4d988bf2b
2021-04-15 04:21:00 +00:00
Treehugger Robot d820c37425 Merge "Fix evaluation order of (Cfi|Memtag) exclude paths." 2021-04-15 03:49:38 +00:00
Inseob Kim f84e9c05e2 Add debug ramdisk variant
A module will be installed to debug_ramdisk (or
debug_ramdisk/first_stage_ramdisk if recovery as boot is true) if
debug_ramdisk is set to true.

Bug: 184004542
Test: soong test
Change-Id: Ic5a4d27407e506fffa462de2149e0785f11b2ac7
2021-04-15 00:56:30 +00:00
Rupert Shuttleworth c143cc50dd Transform paths to headers in include dirs to take package boundaries into account.
This allows the following cc_library_static targets to build with bp2build:

- libc_freebsd
- libc_freebsd_large_stack
- libc_openbsd_ndk
- libc_gdtoa  (* but still fails for mixed builds)
- libc_aeabi
- libc_static_dispatch
- libc_dynamic_dispatch

This also allows a number of other cc_library_static targets to progress further in their builds.

Test: Added unit test
Test: bp2build-sync.py write; bazel build //bionic/...

Change-Id: I71742565c16594448a41a6428a5c993171ec4cb4
2021-04-14 17:05:36 -04:00
LuK1337 fb545bf2f3 Make sure prebuilt modules are exported before attempting to use them
Fixes an issue where prebuilt module under unexported soong
namespace overrides source modules when flag `prefer` was set.

Test: Create two modules under the same name, use cc_library_shared
      for first one and cc_prebuilt_library_shared with `prefer` set
      to true.
      Then put the prebuilt module under `soong_namespace {}` and
      attempt to compile it without appending the namespace path to
      product namespaces.
      Without this change it should fail to resolve the
      cc_library_shared module even if it should be available.

Change-Id: I506641218e6af94a0b5f048e09e06d83602e50f5
2021-04-14 22:55:22 +02:00
Jiyong Park f398995a64 Merge "SdkSpec is fully using ApiLevel" 2021-04-14 13:27:05 +00:00
Inseob Kim d9580b84a2 Add path tests for ramdisk
Ramdisk path tests existed once, but have been removed for whatever
reason. This change revives the tests.

Test: soong test
Change-Id: Ibade91fbe3e044f772a50df15f448b04aa12d807
2021-04-14 12:24:45 +00:00
Lukács T. Berki c0d7a15cdf Merge "Delete android/env.go ." am: c11f269933 am: 69f44aadfc am: 3855dad781
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1672098

Change-Id: I4913d5d6630f2933f7726cc1bfe1899db8597d50
2021-04-14 08:01:32 +00:00
Lukács T. Berki c11f269933 Merge "Delete android/env.go ." 2021-04-14 05:47:58 +00:00
Treehugger Robot 44a782d019 Merge "Add tests for request_type ParseResult functions." am: 6bd0a19b9d am: e41f177874 am: e236eb6394
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1672428

Change-Id: I519f147c9db2e60582a7e3537b724d2f39131900
2021-04-13 21:12:59 +00:00
Liz Kammer 3c05ed947b Merge "Consolidate cc-specific cqueries." am: 41cca851d9 am: b50de53589 am: 3b3c5a1a12
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1672347

Change-Id: Ice69a3d4523b9cdc0cbc17cb59e6c27791d51dd1
2021-04-13 19:12:15 +00:00
Colin Cross 4e2f69de15 Merge "Follow blueprint change to return GlobResult from Glob" am: 66d154e436 am: 02fd994651 am: 6b31915982
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1668888

Change-Id: I7375aa1886000d2bb274e33c40a506acfc620618
2021-04-13 19:12:06 +00:00
Treehugger Robot 6bd0a19b9d Merge "Add tests for request_type ParseResult functions." 2021-04-13 19:08:11 +00:00
Evgenii Stepanov 779b64ec5d Fix evaluation order of (Cfi|Memtag) exclude paths.
Before this change, exclude paths disabled sanitization of targets that
would otherwise be enabled by SanitizeDevice product variable (aka
SANITIZE_TARGET).

With this change, in addition to the above logic, exclude path disables
sanitization of targets that would otherwise be enabled by the
corresponding include path.

Effectively, this change disables sanitization of targets that are
covered by *both* include and exclude paths.

Test: build/soong/cc/cc_test.go
Bug: b/184976817
Change-Id: I96f1e2a808d88b352b92b7490fa1df5c010314c3
2021-04-13 10:29:15 -07:00
Liz Kammer 41cca851d9 Merge "Consolidate cc-specific cqueries." 2021-04-13 17:11:34 +00:00
Colin Cross 66d154e436 Merge "Follow blueprint change to return GlobResult from Glob" 2021-04-13 17:01:39 +00:00
Treehugger Robot e08fa05b4f Merge "Add reasons for cc_library_static modules to be on the deny list." am: c8ae73e678 am: 671df43625 am: 11a16dbf08
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1674525

Change-Id: I079755c2368dbf111b480c6211b6e16b25f7ff8a
2021-04-13 17:00:38 +00:00
Liz Kammer 33db9e49e7 Merge "Add tests for bazel_handler" am: 4f3e58c031 am: 3e66c23ea0 am: f521e33023
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1670166

Change-Id: Idd0d96be1e3f095881e02f5d6c47b1554e9b3a23
2021-04-13 16:59:41 +00:00
Treehugger Robot c8ae73e678 Merge "Add reasons for cc_library_static modules to be on the deny list." 2021-04-13 15:06:10 +00:00
Rupert Shuttleworth 43b04926b2 Add reasons for cc_library_static modules to be on the deny list.
Test: bp2build-sync.py write; bazel build //bionic/...
Change-Id: I8fc7036136adbcf16dc31d9691a8d18b99e3c3ae
2021-04-13 08:54:20 -04:00
Jiyong Park 3db6f99780 Merge "SdkSpec is fully using ApiLevel" into sc-dev 2021-04-13 11:02:38 +00:00
Lukacs T. Berki 53b2f36bd6 Delete android/env.go .
Properly plumb the available environment to the configuration instead of
going through the global variable originalEnv.

Test: Presubmit.
Change-Id: Ia1ea753d5e72c02a0dcaa4c0b43bd6e24fc47cec
2021-04-13 08:10:01 +02:00
Jaewoong Jung 50889080b8 Merge "Fix min_sdk_version err msg in apex." am: 8e1c08cda6 am: 773f5f849d am: 4bf3362b14
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1660820

Change-Id: Id7a5ce11fefbc5268f785fd3152af86ac8bda5f6
2021-04-12 21:00:03 +00:00
Liz Kammer 417c4215ce Merge "Support paths for init_rc from Soong." am: bda284bb19 am: 63f8d3c013 am: df3cd7102d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1665439

Change-Id: I30eeca6fd4234cad27fde22b8bd332620157bcff
2021-04-12 20:59:48 +00:00
Liz Kammer fe23bf3eb0 Add tests for request_type ParseResult functions.
Test: go test request_type_test
Test: bp2build generate & sync; mixed build libc
Change-Id: Id0b813e9de4d02d8625e42549999659ccb005c6d
2021-04-12 16:23:53 -04:00
Liz Kammer b71794d8e6 Consolidate cc-specific cqueries.
There is little overlap at this point, but we expect these to converge
more over time, to handle exported includes, libs, etc., this will allow
those changes to be handled in one place and allow more consolidation of
code.

Test: bp2build generate & sync; mixed build libc
Change-Id: I51685dad9f4fc11a634965a3c9e84f4a0e279ecb
2021-04-12 15:59:08 -04:00
Liz Kammer 8d62a4f725 Add tests for bazel_handler
Test: go test
Test: m nothing
Test: bp2build generate && sync; mixed build libc
Change-Id: Id4307a9e735b50221a8effb963325aaa57c3c7d0
2021-04-12 15:59:06 -04:00
Jaewoong Jung 8e1c08cda6 Merge "Fix min_sdk_version err msg in apex." 2021-04-12 19:41:35 +00:00
Liz Kammer bda284bb19 Merge "Support paths for init_rc from Soong." 2021-04-12 19:05:27 +00:00
Jaewoong Jung 86bcf70b3e Fix min_sdk_version err msg in apex.
It should suggest adding min_sdk_version to the child module, not the
apex one.

Test: Manually
Change-Id: Ibde94677a966dafd5912e566bb038783f03c20c9
2021-04-12 16:45:25 +00:00
Treehugger Robot 51712fbe6c Merge "Make MockBazelContext more specific to cquerys" am: c1c2352d95 am: 518e711add am: 15a9e96ab4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1670165

Change-Id: I10957027d9441a0545f2bd0a3e0e006888052fa9
2021-04-12 15:14:08 +00:00
Treehugger Robot b5021081a9 Merge "bp2build/mixed builds denylist note_memtag_heap_async and sync temporarily." am: 7ac4db7c3a am: d086f9f715 am: 4fe76f5337
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1671531

Change-Id: I309406357bb01924222a7b7dcd51125e4fb6fada
2021-04-12 14:29:12 +00:00
Treehugger Robot c1c2352d95 Merge "Make MockBazelContext more specific to cquerys" 2021-04-12 13:25:38 +00:00
Jingwen Chen cbb95c8c3c Merge "bp2build: cc_library converter for //bionic/libdl:libdl_android" am: a42c707572 am: 361061f817 am: b0441fb8ed
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1652408

Change-Id: I2ff24f1aa862cbd9e84e9d2b7a8f69681d032b94
2021-04-12 06:18:01 +00:00
Jingwen Chen 0a92ed74ad bp2build/mixed builds denylist note_memtag_heap_async and sync temporarily.
This adds the two modules to the bp2build/mixed builds denylist while we
investigate b/185079815.

Test: TH
Change-Id: I6d67c5c24502ac48bdc90a005ddef86c46eab0b7
2021-04-12 05:37:42 +00:00
Jiyong Park dbd710c426 SdkSpec is fully using ApiLevel
Previously, SdkSpec was constructed only from the user string. It didn't
make use of the Config struct where information about the latest stable
SDK version, etc. is recorded. As a result, the build system couldn't
check if the sdk version "current" is referring to the in-development
(i.e.  not-yet-frozen) SDK version or the latest stable version.
"current" was always assumed to be in-development (IsPreview() returns
true) even when Platform_sdk_final == true.

As the first step for fixing that, this change requires
android.EarlyModuleContext to be passed when constructing SdkSpec from
the user string.

In the following changes, "current" will be mapped to either
FutureApiLevel (10000) or one of the FinalApiLevels() depending on
whether the platform SDK was finalized or not.

Bug: 175678607
Test: m
Change-Id: Ifea12ebf147ecccf12e7266dd382819806571543
2021-04-12 13:46:21 +09:00
Jingwen Chen a42c707572 Merge "bp2build: cc_library converter for //bionic/libdl:libdl_android" 2021-04-12 04:30:27 +00:00
Colin Cross 82ea3fb273 Follow blueprint change to return GlobResult from Glob
Follow I2159cc9d85f388073198eac7456e5bf43e813096 that makes Glob
return a GlobResult.

Bug: 159845846
Test: glob_test.go
Change-Id: Ia771bdbdf1eb668623c4b3f00bf65e0e1e3a55c0
2021-04-09 09:46:18 -07:00
Liz Kammer a92e844d16 Make MockBazelContext more specific to cquerys
Rather than having a single storage container, make multiple so that it
is easier to unit test building modules with bazel with MockBazelContext

Test: go test genrule_test
Change-Id: I1da85d28f096d5102ad889b9518fdda6914342b1
2021-04-09 11:49:48 -04:00
Treehugger Robot 2a35da912e Merge "Handle simple prebuilt static libraries from bazel" am: 76579e0e9a am: 70a88424ba am: 8d77e0b2fd
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1664542

Change-Id: Ib330bfb45d699a0541c12362939ad780f4057a01
2021-04-09 15:23:32 +00:00
Treehugger Robot 76579e0e9a Merge "Handle simple prebuilt static libraries from bazel" 2021-04-09 13:38:59 +00:00