Commit graph

20491 commits

Author SHA1 Message Date
Ulyana Trafimovich
8fab5bcce3 Merge changes from topic "uses-libs-5"
* changes:
  Rewrite construct_context.sh in Python.
  Refactor class loader context generation.
2020-07-02 09:06:27 +00:00
Inseob Kim
a04db44964 Merge "Include shared lib in vendor snapshot if isVndkExt" 2020-07-02 07:42:16 +00:00
Bill Peckham
7d3f096cf4 Include shared lib in vendor snapshot if isVndkExt
A VDNK extension is an image:vendor module provided by a
vendor-modified framework project. So it should be
provided to the vendor build as a prebuilt (for the
purposes of building against a vendor snapshot).

Exempt-From-Owner-Approval: cherry pick from internal branch

Bug: 160189878
Test: manual
Change-Id: I3eb4794c1be2949b9c85fd52f823e5e14df4ad7d
Merged-In: I3eb4794c1be2949b9c85fd52f823e5e14df4ad7d
2020-07-02 07:42:05 +00:00
Treehugger Robot
fae9e0cf9a Merge "apex: add / in file_contexts as system_file" 2020-07-02 04:22:46 +00:00
Treehugger Robot
8cf2fda4c4 Merge "Dedup NDK library lists in make." 2020-07-02 02:12:26 +00:00
Treehugger Robot
2e93eb702d Merge "Fix out/soong/Android-<>.mk reproducibility" 2020-07-02 00:57:17 +00:00
Treehugger Robot
756aa63aee Merge "Rename module -> module-lib" 2020-07-01 23:58:07 +00:00
Matthew Maurer
367c01b19b Merge changes from topic "rust-flex"
* changes:
  rust: Suppress default sysroot unconditionally
  rust: Mutate prebuilt modules dylib/rlib
  rust: Add rustlibs auto dependency selection
  rust: Change default variants
  rust: Fix Properties inheritance for prebuilts
2020-07-01 22:26:44 +00:00
Dan Willemsen
1a8c8565bd Fix out/soong/Android-<>.mk reproducibility
When there were multiple modules overriding a single module, sometimes
we would create the list in different orders, which would trigger some
of the later mutators to write the Android-<>.mk out in different
orders.

Bug: 160207422
Test: diff out/soong/Android-<>.mk between multiple runs on internal master
Change-Id: I321db706dd34aa20a0b1556fd282d54b826a4a97
2020-07-01 15:13:58 -07:00
Treehugger Robot
2e1b8baeda Merge "Generate the known NDK libraries list." 2020-07-01 21:43:09 +00:00
Treehugger Robot
5aff3afce2 Merge "Output apkcerts file for android_app_set." 2020-07-01 19:53:33 +00:00
Matthew Maurer
bb3add1104 rust: Suppress default sysroot unconditionally
With proper prebuilt modules, we can avoid any rustc implicit sysroot
searching.

Asd a bonus, this should make rust-project.json generation correctly
grab otherwise implicit dependencies.

Prebuilt rlibs may include several dependency rlibs. Without a
link_dirs attribute, every dependency (even if unexported) would need a
separate module.

Previously we were casing out on exact structs, which might be OK when
libraryDecorator and procMacroDecorator were the only possibilities, but
repeating the logic for three types is too much. Using an interface
makes this logic scale better.

Bug: 159591910
Test: cd external/rust; mma; m crosvm.experimental
Change-Id: Ia1124e09f48cd05e39f094bbcb988622ebd2272f
2020-07-01 11:27:12 -07:00
Matthew Maurer
c761eeca48 rust: Mutate prebuilt modules dylib/rlib
This change makes it possible to use a single module to provide both
dylib and rlib varieties of a library. This allows the use of libstd and
libtest from a rustlibs property, allowing linkage type to change
for different variants.

Bug: 159718669
Test: cd external crates; mma; m crosvm.experimental
Change-Id: I477c4d2faec63703fdc6dd42ba020747d6a50714
2020-07-01 11:27:12 -07:00
Matthew Maurer
0f003b1851 rust: Add rustlibs auto dependency selection
Adds the rustlibs dependency type which will automatically select
between rlib and dylib based on the type of the library.

Bug: 143217452
Test: cd external/rust; mma
Change-Id: I97faadae98bf957090a32939cfb2d3a10f74a057
2020-07-01 11:27:12 -07:00
Matthew Maurer
2ae0513a8e rust: Change default variants
rust_library now produces only rlib and dylib variants.
rust_library_foreign now produces static and shared variants.

This change was made because both are common cases, but all four
together essentially never happens. This allows us to have fewer repeat
module definitions.

Bug: 143217452
Test: cd external/rust; mma
Change-Id: Iaf69e8da38f7c12710331c51464699cf7cbbb656
2020-07-01 11:27:12 -07:00
Matthew Maurer
128f53b3b4 rust: Fix Properties inheritance for prebuilts
Previously, we had just called AddProperties inside the factory on
libraryDecorator's properties directly. This inadvertantly missed their
MutatedProperties. Inheriting properties from libraryDecorator rather
than baseCompiler will avoid that type of error in the future.

Test: cd external/rust; mma; m crosvm.experimental
Change-Id: Ic08c410e69a8e272d63f9ffbdbe16ba9c3cc3de1
2020-07-01 11:27:12 -07:00
Thiébaud Weksteen
6bbe5774a3 Merge "Explicitly define Rust default lints" 2020-07-01 17:38:58 +00:00
Treehugger Robot
7d9deed9fd Merge changes Ib7ad715d,I3a83b5ed
* changes:
  Remove frameworkResModule from sdkCorePlatform.
  Remove the concept of useDefaultLibs from Soong.
2020-07-01 17:23:46 +00:00
Jaewoong Jung
11c1e0f94d Output apkcerts file for android_app_set.
Soong and Make have no ways to figure out what splits will be outputted
from a given android_app_set, so it's impossible for them to provide
full PACKAGES.$(LOCAL_MODULE).CERTIFICATE entries, which are required to
build a final apkcerts.txt. This change makes extract_apks produce
apkcerts.txt files for each input modules instead. The Make-side
counterpart of this change merges all local apkcerts.txt into a final
one.

Fixes: 160119159
Test: main_test.go
Test: m apkcerts-list
Merged-In: I321e80fd636a955213761f56a3ac64bfe7f7f7c0
Change-Id: I321e80fd636a955213761f56a3ac64bfe7f7f7c0
2020-07-01 10:03:09 -07:00
Treehugger Robot
e6b5e9aa82 Merge "Add BenchmarkProperties to cc_defaults" 2020-07-01 16:46:11 +00:00
Colin Cross
8ec6261388 Merge changes Ie33d2e05,Ie2b4509b,I5ac3a1f5
* changes:
  Fix finder on symlinks pointing to directories
  Add Stat to finder/fs
  Move finder_test filesystem helper functions to fs/test.go
2020-07-01 15:42:22 +00:00
Thiébaud Weksteen
8e46efac71 Explicitly define Rust default lints
Add documentation on how lints are defined and used in Android. Merge
the deny_warnings attribute with a new attribute (no_lint) which can be
used to disable the default linting parameters.
Explicitly allow all lints for external/ and prebuilts/, which remove
any warning when building sysroot for the devices.

Test: cd external/rust/crates; mma
Test: add dummy internal Rust module; mma
Change-Id: I62be1c41aeda4068fb9e288038727c1de5ffe547
2020-07-01 17:11:58 +02:00
Treehugger Robot
8f70db2b48 Merge "Rename the Default* constants in java/config." 2020-07-01 14:43:46 +00:00
Pete Gillin
7b0bdce69e Remove frameworkResModule from sdkCorePlatform.
This seems unnecessary: modules using `sdk_version: "core_platform"`
don't expect frameworks dependencies.

Test: m framework
Change-Id: Ib7ad715d1f4b4934c3c4a84839f4ead85a5abb29
2020-07-01 13:05:32 +01:00
Treehugger Robot
286d8f9972 Merge "Prepare Soong for switch to stable core/platform API." 2020-07-01 11:57:26 +00:00
Pete Gillin
0638dfcf94 Rename the Default* constants in java/config.
These values are used in two out of the many possible sdk_version
configurations, and therefore weren't really defaults in any
meaningful sense. Giving them more descriptive names makes the code
easier to follow.

Bug: 157640067
Test: m nothing
Change-Id: Icf38a9c0be2606ad0478929e1b40dfcee36cddef
2020-07-01 12:40:58 +01:00
Pete Gillin
e3d44b245b Remove the concept of useDefaultLibs from Soong.
This field in the java/sdk structure was used in two of the many
possible configurations, so it wasn't really a "default". It also
meant that, to understand those configurations, the reader had to know
what was considered the default, which was only possibly by reading
the code in java.go and droiddoc.go which implemented special code
paths when useDefaultLibs was true. By eliminating that setting and
explicitly setting the required values, the code is simpler and easier
to understand.

This change is a straight refactoring, in the sense that the output of
the build should be unchanged.

Regarding the changes to the proguardRaiseTag dependency in java.go:
- This is a noop for anything which had sdkDep.useModule = true prior
  to this change, because they all had the same value for
  hasFrameworkLibs() and hasStandardLibs().
- This is a noop for anything which had sdkDep.useDefaultLibs = true
  prior to this change, because they do not use proguard settings.
- Therefore, it is a noop overall.
- Nevertheless, it is required to make sdkCorePlatform work. Without
  this change, such modules would pick up a dependency on framework
  libs via the (unused) proguardRaiseTag, which creates a circular
  dependency, because this is the sdk_version used when building
  framework libs themselves.

Bug: 157640067
Test: m java docs droid
Change-Id: I3a83b5edc1bd48c16b55f6f77e3e710fc8fbd8fa
2020-07-01 12:40:58 +01:00
Pete Gillin
40a0642385 Prepare Soong for switch to stable core/platform API.
This ensures that `m nothing` succeeds even if java/config/config.go
is changed to use `stable.core.platform.api.stubs` and
`stable-core-platform-api-stubs-system-modules` instead of the legacy
versions. (The change to stable cannot be made yet because real
targets depend on APIs only in legacy, but it is useful for the build
system to be ready for this change.)

Bug: 157640067
Test: m nothing (with and without local change mentioned above)
Change-Id: Id7562d8c592551fd0ed2b9849bcf6eb707c2a1d0
2020-07-01 11:31:30 +01:00
Ulya Trafimovich
5f364b63b8 Rewrite construct_context.sh in Python.
This allows to reuse SDK version comparison routine from other Python
scripts. With the addition of non-numeric versions comparison has become
more complex, and the deleted shell script did it incorrectly: it used
comparisons like `[[ "S" -lt 28 ]]` which results in "true" as strings
are converted to zero in numeric context. This resulted in adding legacy
libraries to class loader context of apps targeting recent SDK versions.
The error was masked because currently there is only one non-AOSP app
that uses the script (GoogleDialer), and it targets numeric SDK version.

Test: lunch aosp_cf_x86_phone-userdebug && m
Bug: 132357300
Change-Id: I26e752e29b5453fd3e29d5dbfbe4d9df9c0a55b7
2020-07-01 09:44:23 +01:00
Nicolas Geoffray
7462eda53e Merge "Add host exports for platform libraries used by ART host testing." 2020-07-01 08:33:56 +00:00
Treehugger Robot
ba2268fd60 Merge "Remove stale doc comment" 2020-07-01 05:20:12 +00:00
Dan Albert
f164a94642 Dedup NDK library lists in make.
Test: treehugger
Bug: None
Change-Id: I532e2f5828727440d71dacd65e5c993382530ab9
2020-06-30 12:46:21 -07:00
Dan Albert
de5aade0e8 Generate the known NDK libraries list.
This doesn't need to be manually maintained. It briefly did need to be
during the transition from the old prebuilts, but that's long gone.

Test: treehugger
Bug: http://b/113547923
Change-Id: If05633f3cf622ab39e560a3dfcc88f3eb50406bf
2020-06-30 12:32:51 -07:00
Dan Willemsen
f2b480e6cd Remove stale doc comment
This warning is no longer necessary after https://android-review.googlesource.com/c/platform/build/soong/+/1235631

Bug: 160208353
Change-Id: I006272e8d4c3780d7e9f452013ca9d5db3c63613
Test: none
2020-06-30 17:27:07 +00:00
Chih-Hung Hsieh
5c4e48956c Enable genrule modules for Rust host binaries
* Add HostToolPath to use rust_binary_host modules as host tools.

Bug: 157666974
Test: make with local genrule examples
Change-Id: I9648313c0f0695d2e695f18ded4710350b2d6475
2020-06-30 10:23:49 -07:00
Colin Cross
4328765772 Add BenchmarkProperties to cc_defaults
Fixes: 135767253
Fixes: 142024316
Test: m checkbuild
Change-Id: Ifb0eb0a31fab105405a2d6dcfecb4c68b4602427
2020-06-30 17:19:17 +00:00
Thiébaud Weksteen
79e546f7df Merge "Remove moduleContextImpl struct" 2020-06-30 16:48:15 +00:00
Nicolas Geoffray
ba7887fd53 Add host exports for platform libraries used by ART host testing.
Test: build-mainline-modules.sh
Bug: 142935992
Change-Id: I81247b89b78426463faeb6b00212cd8901319b19
2020-06-30 15:02:51 +01:00
Ulya Trafimovich
c4dac26596 Refactor class loader context generation.
There are essentially three different cases: 1) system server dexpreopt,
2) the case when uses-library information is known, and 3) the case when
uses-library information is unknown and the &-classpath hack is used.
This patch reorganizes the code into three branches that correspond to
the above cases.

Test: lunch aosp_cf_x86_phone-userdebug && m
Bug: 132357300
Change-Id: Ife2d01a612e0a608ae1346d7007741498e938bc5
2020-06-30 12:40:54 +01:00
Paul Duffin
cfc2df847c Merge "Track the current java_sdk_library(_import) deps" 2020-06-30 11:06:54 +00:00
Paul Duffin
452bf39014 Merge "Apply hiddenapi encoding to java_sdk_library .impl" 2020-06-30 10:41:42 +00:00
Colin Cross
25fd77310c Fix finder on symlinks pointing to directories
When finder encountered a symlink pointing to a directory it attempted
to ignore it, but becuase Lstat returns the a *os.FileInfo for the
symlink the child.IsDir() check always returned false.  Call Stat
on the symlink to get the *os.FileInfo for the target of the symlink.

Bug: 157656545
Test: finder_test.go
Change-Id: Ie33d2e05d5c435b48e83eaeadf7b3c9816398404
2020-06-29 23:30:38 -07:00
Colin Cross
7cdad45cf2 Add Stat to finder/fs
Add a Stat method to finder/fs that will be used by finder to read
the mode of the target of a symlink.

Bug: 157656545
Test: fs_test.go
Change-Id: Ie2b4509b7d11857d9a1685de4477088b91d43c63
2020-06-29 23:30:38 -07:00
Colin Cross
7f8aa39abe Move finder_test filesystem helper functions to fs/test.go
Move the filesystem helper functions used by finder_test.go into the
fs package so they can also be used by fs tests.

Bug: 157656545
Test: m checkbuild
Change-Id: I5ac3a1f502d8e2cb7c15dd70ca85a46d20f939a6
2020-06-29 23:30:38 -07:00
Liz Kammer
a66f571e01 Merge "Add relative_install_path property to prebuilt_etc" 2020-06-29 22:50:36 +00:00
Treehugger Robot
1aaad5193f Merge "[cc/pgo] Fix incorrect project name" 2020-06-29 21:23:05 +00:00
Treehugger Robot
e9eacaa061 Merge "Move gen-kotlin-build-file.sh to python" 2020-06-29 21:12:45 +00:00
Paul Duffin
a2058f8b7d Apply hiddenapi encoding to java_sdk_library .impl
Adds a ConfigurationName property, and ConfigurationName() method that
allows a library to separate its name (e.g. framework-tethering.impl)
from the name used in the build configuration,
    e.g. ctx.Config().BootJars().

Updates hiddenapi processing to use ConfigurationName() instead of
ctx.ModuleName().

Changes java_sdk_library to set the ConfigurationName property
of the implementation library to the name of the module instead of
<module>.impl so that it will match the name in the boot jars list.

Bug: 159683330
Test: m framework-tethering
      dexdump ${PRODUCT_OUT}/apex/com.android.tethering/javalib/framework-tethering.jar | grep hiddenapi | wc -l
      Verify that there are >0 hiddenapi entries.
      Add java_sdk_library_import prefer=true for framework-tethering
      and repeat the above to verify that there are 0 hiddenapi entries.
      Apply this change, repeat above and verify that there are the same # of entries as before.
      Remove the prebuilt for framework-tethering
      Repeat the above and verify that there is no change to the # of entries
Merged-In: I6c3016c35d0fcb1b95d4f9b37a307a69878f8e0a
Change-Id: I6c3016c35d0fcb1b95d4f9b37a307a69878f8e0a
(cherry picked from commit c4422106a7)
2020-06-29 19:05:19 +01:00
Liz Kammer
0449a6337e Add relative_install_path property to prebuilt_etc
This supports a more consistent property across modules for specifying a
subdirectory to install a file into for prebuilt_etc modules.

Updates bpfix to rewrite `sub_dir` to `relative_install_path`.

Test: gotest prebuilt_etc_test
Test: gotest bpfix_test
Bug: 156568187
Change-Id: Idd05cd2178c46e290764a3b708faa8275818ca1e
2020-06-29 10:54:03 -07:00
Pirama Arumuga Nainar
9d544a83bf [cc/pgo] Fix incorrect project name
Bug: http://b/159920645

Look for internal profiles at the correct project.

Test: N/A
Change-Id: I6a64adbb043da7e419f99c3182d2ec29240ad8f3
2020-06-29 09:25:51 -07:00