Commit graph

20510 commits

Author SHA1 Message Date
Colin Cross
4fb652d681 Set LOCAL_APKCERTS_FILE for apk_set modules in apexes
I321e80fd636a955213761f56a3ac64bfe7f7f7c0 missed setting
LOCAL_APKCERTS_FILE for apk_set modules in apexes, which causes
invalid apkcerts.txt files.

Bug: 160652723
Test: m apkcerts-list
Change-Id: I1ccaafd04978374d0da10363a1d782cfeae428e7
Merged-In: I1ccaafd04978374d0da10363a1d782cfeae428e7
(cherry picked from commit 7e2b36c7d5)
2020-07-10 20:38:50 -07:00
Treehugger Robot
0ae555df1a Merge "Support kotlin multiplatform sources" 2020-07-08 00:13:01 +00:00
Treehugger Robot
85e326d93e Merge "Correct typo of defaults for docs property sorting" 2020-07-07 22:58:32 +00:00
Christopher Parsons
c87fbdd0bd Merge "Add data_libs property to cc_test rules" 2020-07-07 21:26:56 +00:00
Liz Kammer
a93fbacdbe Correct typo of defaults for docs property sorting
Test: manual
Change-Id: Iaca7ba51ca658529dacd2a324412964b2732c4b4
2020-07-07 13:47:29 -07:00
George Burgess IV
c5f2aa4e73 Merge "soong: globally enable -Wunreachable-code-loop-increment" 2020-07-07 19:49:53 +00:00
Chris Parsons
79d66a5db7 Add data_libs property to cc_test rules
This allows dependencies on link:shared variant of library modules, and
adds the shared libraries adjacent to the test binary

Test: Manually verified on bionic-unit-tests target
Change-Id: I5d406bf9428664c5ac3d3c5915507b750375debb
2020-07-07 15:13:36 -04:00
Liz Kammer
203a3f2f39 Merge "Add soong cc and java deps to general-tests dist" 2020-07-07 15:01:17 +00:00
Colin Cross
a4c8cc6471 Support kotlin multiplatform sources
Add a common_srcs property and propagate it to the module.xml file
passed to kotlinc.

Test: m checkbuild
Change-Id: Ief768bafb943513c9ffbc01e829abc078f0a72bc
2020-07-06 17:58:09 -07:00
Colin Cross
96e5e41b88 Dist module_paths/files.db
Help debugging finder issues by disting module_paths/files.db for
later analysis.

Bug: 157656545
Test: treehugger
Change-Id: Idfa4cffe7ef724b399a2667efd487f9c3c76bb6b
2020-07-06 17:15:05 -07:00
Liz Kammer
5e07d0ccbb Add soong cc and java deps to general-tests dist
Test: m SOONG_COLLECT_CC_DEPS=true SOONG_COLLECT_JAVA_DEPS=true dist
  general-tests and verify module_bp_java_deps.json and
  module_bp_cc_deps.json is in out/dist
Test: m SOONG_COLLECT_CC_DEPS=true SOONG_COLLECT_JAVA_DEPS=true
  checkbuild dist general-tests
Bug: 154845369

Change-Id: I683fe1d7e17f7abaab40206770d09db705493ffb
2020-07-06 16:19:56 -07:00
Christopher Parsons
0eeff82c98 Merge "Add missing soong_docs inputs" 2020-07-06 22:34:51 +00:00
Jooyung Han
5aa31347bc Merge "cc: add exclude_generated_sources property" 2020-07-06 21:32:25 +00:00
Treehugger Robot
759ccc13af Merge "Tidy up the definition of sdkCore." 2020-07-06 12:48:44 +00:00
Jooyung Han
ac07f880d8 cc: add exclude_generated_sources property
generated_sources needs exclude_* just like that srcs needs exclude_srcs
to support variant-specific exclusion of source files.

Bug: 159585065
Test: m
Change-Id: I49e49b0b3a0115a01fc9cf6f9fe74b23e723a785
2020-07-05 04:04:09 +09:00
Jooyung Han
8f9782f513 remove unused GeneratedHeaders variable
Even though modules listed in generated_headers may produce .h files and
return the list of them as GeneratedSourceFiles(), cc modules do not
need them. GeneratedDeps() and GeneratedHeaderDirs() are what we need.

Bug: n/a
Test: m
Change-Id: I655f88e8c1a387e256c58913931721aaeab90b62
2020-07-05 01:33:24 +09:00
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
880f964f16 Tidy up the definition of sdkCore.
Compared to the effect of the toModule function, this (a) sets
noFrameworkLibs to true, which seems logically correct, and (b) stops
setting java9Classpath, which was redundant since the same stubs are
available in 1.9+ builds via the systemModules setting. (This brings
sdkCore into line with sdkCorePlatform in both cases.)

Test: m art.module.api.annotations
Change-Id: I61a868bc363a3bf174725b78c0a1657021cfe08a
2020-07-01 13:17:16 +01: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