Commit Graph

36225 Commits

Author SHA1 Message Date
Paul Duffin
e7c94a689b Stop exporting java_sdk_library libs in the snapshot
The libs property in java_sdk_library is not safe to export as it can
contain libraries that contain implementation specific classes. No
snapshot appears to need this capability but if it does become
necessary then either it will need to use the existing stub_only_libs
property or a new one will need to be added.

Bug: 157884619
Test: m nothing
Change-Id: I60a069177dbee4070d311b23d25f4eb3c5e7ea13
2021-05-06 23:22:15 +01:00
Paul Duffin
2d3da31d41 Make all SdkMemberTypes support transitive member deps
Previously, only those SdkMemberTypes which had specific need to
automatically add some of their dependencies as sdk members would cause
the sdk to visit their transitive dependencies. However, as any module
can have dependencies on license modules and license modules need to be
included in the sdk then it needs to visit transitive dependencies of
all members.

So, this change removes the support for allowing an SdkMemberType to
control whether its transitive dependencies are visited and just visits
them all.

This does not have any effect on sdk snapshots as in order for a
dependency to be added to an sdk it needs to be added with a tag that
implements SdkMemberTypeDependencyTag and the only tags that implement
this are used by SdkMemberTypes that had enabled transitive members.

Bug: 181569894
Test: m art-module-sdk art-module-host-exports art-module-test-exports
      - verify that this change has no effect on the generated snapshots
Change-Id: If0293af0237aa7e39335e5b8383a41c023ff5853
2021-05-06 23:13:06 +01:00
Paul Duffin
b9e7a3ca7a Make licenseModule SdkAware
Making licenseModule SdkAware caused two breakages in the build. The
breakages were both caused by having an SdkAware module that was
depended upon by a versioned sdk snapshot but which was not itself
versioned and so did not have the member_name property set.

That occured because some default licenses have been added to the
packages containing prebuilts, e.g. prebuilts_runtime_license in
prebuilts/runtime/Android.bp. They apply to both the versioned and
unversioned members.

Once license support has been added to the sdk most of those will be
removed and replaced with properly versioned license modules. However,
in the meantime it is necessary to support that.

This change avoids the issue by checking to see whether the module is
itself versioned before relying on the member_name property. It also
improves the error message when a panic is recovered to make it easier
to identify where it originates.

Bug: 181569894
Test: m nothing
Change-Id: I0e7da2e0c4a30a6f814c2faab821b185aaed2135
2021-05-06 23:13:06 +01:00
Paul Duffin
525a590565 Make sdk tests more realistic
The tests use <sdk>_<module>_<version> as the format for a versioned
sdk member name but the format should be <sdk>_<module>@<version>. This
change corrects it and also fixes a similar issue in an error message.

Bug: 181569894
Test: m nothing
Change-Id: I8be0db4bcd0b6f4d6fbdf9e402ef7257fae8e18b
2021-05-06 23:13:06 +01:00
Paul Duffin
b6b89a4074 Add missing calls to InitSdkAwareModule
A follow up change will add methods to SdkBase which requires its
module field to have been initialized.

Bug: 181569894
Test: m nothing
Change-Id: I9b02f260ad3f82316cc7ab3b5717b7e81090b0d8
2021-05-06 23:13:06 +01:00
Elliott Hughes
b6788c0dc5 Remove most of the remaining references to gccCmd.
Bug: http://b/185257607
Bug: http://b/147452927
Test: treehugger
Change-Id: I5d2a8530b539811b9cb8147939b6adfaac115cc8
2021-05-06 12:25:56 -07:00
Elliott Hughes
afcd339d96 Remove unused parts of the strip implementation.
The --use-gnu-strip option was removed from the shell script already,
and it no longer uses the $CROSS_COMPILE environment variable.

Bug: http://b/185257607
Bug: http://b/147452927
Test: treehugger
Change-Id: If9f7b75d52c1e9cd167d73eeba8f77054ffd63a7
2021-05-06 12:12:43 -07:00
Brian Egizi
59e1ed3519 Merge "Prepare kzip script to support superproject sha as an environment variable" am: 7c8769231b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1697783

Change-Id: Ib754c03a8eb30193f367ddbd87245c41d2c2a9f0
2021-05-06 17:24:23 +00:00
Brian Egizi
7c8769231b Merge "Prepare kzip script to support superproject sha as an environment variable" 2021-05-06 17:02:25 +00:00
Mathew Inwood
4908d287e3 Merge "Ensure current.zip is put in the right place." am: 7e554ec2de
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1697678

Change-Id: Ia30d2ca1f5126b374fd4248e83f045a9f1d2ecc2
2021-05-06 15:45:20 +00:00
Mathew Inwood
7e554ec2de Merge "Ensure current.zip is put in the right place." 2021-05-06 15:21:04 +00:00
Paul Duffin
9b7bb39138 Merge "Add baseline test for sdk snapshot env variables" am: 2cd736c648
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1697673

Change-Id: I291b7130831613431a59e5871d83d564ec57a4cb
2021-05-06 15:00:22 +00:00
Paul Duffin
2cd736c648 Merge "Add baseline test for sdk snapshot env variables" 2021-05-06 14:42:54 +00:00
satayev
0309f55c23 Rename classpath_fragment.go methods for better readability. am: 128ce2ff73
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1697680

Change-Id: I188173f7ce1d1698a5a0244afa9eb11f738062c9
2021-05-06 14:36:37 +00:00
Mathew Inwood
60770e2250 Ensure current.zip is put in the right place.
Using the InstallFile as the snapshot ensure that the artifact
in out/soong/mainline-sdks/ is built when building the sdk
target.

Test: m ipsec-module-sdk
Change-Id: I45ce6001dbae3a7a9c4cf50f8d7d5d67f94dbcb3
2021-05-06 13:16:27 +00:00
satayev
128ce2ff73 Rename classpath_fragment.go methods for better readability.
Bug: 180105615
Test: m nothing
Change-Id: Ic663c22e5b7cbab487dc1fe99805e08843c3213d
2021-05-06 13:27:28 +01:00
satayev
fb5c5cd8ee Merge "Make SystemServerJars ConfiguredJarList." am: 63bc30fc12
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1695707

Change-Id: I4bf3c0903222f6aa70aa97a38f4263e2e3cbcd31
2021-05-06 11:52:39 +00:00
Inseob Kim
1e27a14545 Add prebuilt_defaults for prebuilt etc modules
Bug: 33691272
Test: build
Change-Id: I9af232e9ed9b0815c4cc70dfae2ec44e87b6d114
2021-05-06 11:46:11 +00:00
satayev
63bc30fc12 Merge "Make SystemServerJars ConfiguredJarList." 2021-05-06 11:32:39 +00:00
Justin Yun
9e13c7c6de Merge "Define test_min_vndk_version for cc_test" am: fc7ff27992
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1695288

Change-Id: I9da9cf9b38b7712155c39e2829c00817fdf4b433
2021-05-06 09:59:29 +00:00
Paul Duffin
62035b5991 Add baseline test for sdk snapshot env variables
Bug: 157884619
Test: m nothing
Change-Id: I56c14ddfec1c33b60fe70f56e4d59b90639657fe
2021-05-06 10:50:00 +01:00
Justin Yun
fc7ff27992 Merge "Define test_min_vndk_version for cc_test" 2021-05-06 09:48:15 +00:00
Brian Egizi
29161df446 Prepare kzip script to support superproject sha as an environment variable
Bug: b/149248752
Change-Id: I17a640c66c8f4a37cc0c55b2d0a23d438c032974
2021-05-05 23:04:36 +00:00
Anton Hansson
6e2cb706a9 Merge "Move stub providers to droidstubs.go" am: 93e8f79577
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1697050

Change-Id: I85ea90338b200a1425338c9b8f07031e3756dd48
2021-05-05 13:35:17 +00:00
satayev
9a6f87ebd6 Make SystemServerJars ConfiguredJarList.
Consistent with plumbing of boot jars. SystemServerJars only support /system/framework/ jars.

Bug: 180105615, 155630745
Test: m && launch_cvd
Change-Id: I58b005b7c4103c8e250090e995b1d9b2f9ed4a76
2021-05-05 14:24:02 +01:00
Anton Hansson
93e8f79577 Merge "Move stub providers to droidstubs.go" 2021-05-05 13:17:37 +00:00
Justin Yun
46f66059e9 Define test_min_vndk_version for cc_test
If a cc_test module defines test_options.test_min_vndk_version, the
test runs only if the ro.vndk.version of the device is defined as a
version code name or an integer value that is higher than or equal to
the value in the test_min_vndk_version proprety.

Also, move the existing test_min_api_level property to test_options
struct.

Bug: 186786268
Bug: 187258404
Test: manual test
Change-Id: I43f1cca5b60f102298726332d374e4b14c425948
2021-05-05 18:47:23 +09:00
Lukacs T. Berki
a2f68505af Refactor how bp2build gets arch-specific props. am: 598dd00236
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1697045

Change-Id: I11c6111fe77cbddb023a4550c44e6780e8f70f64
2021-05-05 09:39:01 +00:00
Anton Hansson
5260932812 Move stub providers to droidstubs.go
They fit better there than in droiddoc.go.

Test: m nothing
Change-Id: I44588f1df2094f14881f920246bd19ffc6e1615c
2021-05-05 10:36:05 +01:00
Lukacs T. Berki
598dd00236 Refactor how bp2build gets arch-specific props.
Then plumb them to LabelAttribute.

This refactoring is required because the previous implementation did not
handle properties in shards other than the first one (e.g.
version_script) well. In addition, it also makes the code paths between
bp2build and analysis more similar.

Bug: 186650430
Test: Presubmits.
Change-Id: Ic4393e8ae47f4e88816bf45c89399efd61494d22
2021-05-05 09:00:01 +02:00
Treehugger Robot
769f6a7117 Merge "Fix concurrency issues in Test_runWithTimeout" am: 8bb7d7cde4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1695886

Change-Id: I22d98d40c9e6843bc845116ab2bafccc5a09a769
2021-05-04 18:31:32 +00:00
Treehugger Robot
8bb7d7cde4 Merge "Fix concurrency issues in Test_runWithTimeout" 2021-05-04 18:06:56 +00:00
Paul Duffin
d40a947de4 Support dex_import on platform_bootclasspath am: 4977540bcb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1690875

Change-Id: I6a1314958ddb74d0597505b8a4a2758631546d0c
2021-05-04 17:41:32 +00:00
Colin Cross
71d6ab6827 Fix concurrency issues in Test_runWithTimeout
Use a concurrency-safe writer in runWithTimeout to avoid data races
on the bytes.Buffer passed in during tests.

Bug: 181095653
Fixes: 187149270
Test: Test_runWithTimeout
Test: go test -race ./cmd/run_with_timeout
Change-Id: I57a889765cb9ee7b42983f0906313e0c2d1e414e
2021-05-04 09:15:30 -07:00
Paul Duffin
4977540bcb Support dex_import on platform_bootclasspath
Maintain compatibility with previous behavior by ignoring dex_import
during hidden API processing.

Bug: 179354495
Test: m nothing
Change-Id: I976b02129bf981b7b61dce233567d6f89e04f92d
2021-05-04 14:07:23 +01:00
Treehugger Robot
5603f8daac Merge "bp2build: build static version of libstdc++." am: ee4e7fe76f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1693386

Change-Id: I6f1a91fbcc6bbdf8f37d7bf7a0f54a43a20ec819
2021-05-04 09:13:14 +00:00
Treehugger Robot
ee4e7fe76f Merge "bp2build: build static version of libstdc++." 2021-05-04 08:46:37 +00:00
Jingwen Chen
179856a69d bp2build: build static version of libstdc++.
This CL adds the ability to filter cc_library modules to only generate
their static variant of their shared variant isn't ready.

For example, the libstdc++ library is buildable as a static library,
which libc depends on. However, the shared variant of libstdc++ depends
on libc, which has to come later.

This CL introduces that abstraction to break up bp2build conversion into
more atomic steps to help with conversion.

Test: TH (bazel build //bionic/... incl. libstdc++'s static variant)
Bug: 186489250
Bug: 186822597

Change-Id: I3e2fe748e4e3d3b656760da4807f342d67c8f45f
2021-05-04 02:06:41 +00:00
Colin Cross
f40a872210 Merge changes If6996bd8,I91df5c3f am: b55ceca568
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1691595

Change-Id: Ib337642ce088bd056bb3f20b5cde16b0222d133c
2021-05-03 23:25:45 +00:00
Colin Cross
b55ceca568 Merge changes If6996bd8,I91df5c3f
* changes:
  Time out and dump stacks from R8 processes after 30 minutes
  Add a wrapper command to detect timeouts
2021-05-03 23:06:22 +00:00
Colin Cross
0e446159bc Support blueprint_go_binary in PathForModuleSrc
Allow blueprint_go_binary to be used as test data by supporting it in
PathForModuleSrc.

Also make python use GetDirectDepsWithTag instead of VisitDirectDeps
so it doesn't fail on the dependency to a Blueprint (non-Android)
module.

Fixes: 186528269
Test: manual
Change-Id: Ibc1d7caf7bf1fa5db805c3b885a95df4baee0ecf
2021-05-03 13:35:32 -07:00
Treehugger Robot
4949451e65 Merge "Add fmtlib_ndk back to the deny list because it fails in mixed builds postsubmit." am: 1ea9624f9a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1693785

Change-Id: Ic6bbe9497a6093409a17b2f4b6571d33f4a51c28
2021-05-03 17:05:10 +00:00
Hamzeh Zawawy
ca272e7203 Merge "Add support for packaging rust fuzzers" am: 0a91eab365
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1691209

Change-Id: Icaa9e41e51812baf67c1a498eab9eb27cdb4f034
2021-05-03 17:04:01 +00:00
Treehugger Robot
1ea9624f9a Merge "Add fmtlib_ndk back to the deny list because it fails in mixed builds postsubmit." 2021-05-03 16:55:23 +00:00
Hamzeh Zawawy
0a91eab365 Merge "Add support for packaging rust fuzzers" 2021-05-03 16:43:08 +00:00
David Srbecky
140b0d8ac6 Merge "Use create_minidebuginfo tool instead of bash script." am: 67f8051a86
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1690871

Change-Id: I8d95e2b4c16ce872a3cad1f2ae08c88de8a03ba7
2021-05-03 16:04:00 +00:00
David Srbecky
67f8051a86 Merge "Use create_minidebuginfo tool instead of bash script." 2021-05-03 15:42:01 +00:00
Rupert Shuttleworth
52e6672613 Add fmtlib_ndk back to the deny list because it fails in mixed builds postsubmit.
But add it to the mixed builds deny list instead of the bp2build deny list.

Test: Waiting for another postsubmit to run.
Change-Id: Ief51356758304b3f13c95df401e310d4f5e236f7
2021-05-03 10:05:55 -04:00
Rupert Shuttleworth
67d91646f1 Update info on some deny-list entries. am: fb955387db
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1693465

Change-Id: I304e53115f9fbc36f1c3b7fc59b42b4624c9a5e7
2021-05-03 10:48:52 +00:00
Jingwen Chen
f343400f06 bp2build: remove manifest file for bp2build-sync. am: 2b54eb8375
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1693286

Change-Id: I575a6df510d322878dcac9b331dedd5f4e7de82b
2021-05-03 08:48:46 +00:00