Commit Graph

8775 Commits

Author SHA1 Message Date
Colin Cross 4be8f9e2a3 soong_zip: add --ignore_missing_files flag
soong_zip builds a list of files to zip early and then starts
zipping them all.  If a directory being zipped is concurrently
modified, a file that existed when soong_zip started may not
still exist.  Add a flag that continues when an expected file
does not exist.  Print a warning, since this should be rare
in normal usages but is a sign of a problem if it happens
regularly.

Test: zip_test.go
Test: m checkbuild
Test: m platform
Change-Id: I78426fe66fded8528ddd436c0f71a7442183cfeb
2018-09-28 16:14:52 -07:00
Colin Cross 6d278b7bbf soong_zip: move profiling from zip library to soong_zip
am: b051ab5cb5

Change-Id: I530eb552c3b1628464c512b356c28a23cae2f95a
2018-09-28 14:50:21 -07:00
Colin Cross b9d87cf1fb soong_zip: move args parsing into zip.FileArgsBuilder
am: fe945b4401

Change-Id: Iaaa76939edba78e7d979bd050963e158bb8ab915
2018-09-28 14:50:12 -07:00
Colin Cross 09f11056f8 Add a --symlinks argument to soong_zip
Add a --symlinks argument that defaults to true to soong_zip.
Passing --symlinks=false will cause it to follow symlinks instead
of storing them in the zip file.

Relands I4deb98daa9d4ba9f94e3d7670c117fe00381d2ba with tests.

Bug: 112843624
Test: glob_test.go
Test: zip_test.go
Test: m checkbuild
Change-Id: I0eff9c1f2dba79e873fda381ff585df55d5aaaad
2018-09-28 14:01:33 -07:00
Colin Cross 1d98ee23a3 soong_zip: support globs in -f and -D arguments
-f and -D arguments can now take globs in the Soong format.

Also update the use of soong_zip that jars resources to escape the
globs in the arguments, and then shell-escape them when writing to
the rsp file so the glob escape are not intepreted by ReadRespFile.

Also remove an unused argument to the buildAAR rule that could
have contained values that needed escaping.

Relands I7f20bb169dc01f952d2a7681ec6ee9c05737ed37 with a fix for
trailing "\n" in list files, which causes a call to pathtools.Glob("")
that returns "./", which could then get incorrectly translated to
"../../../" in the zip file. Also adds tests.

Test: m checkbuild
Test: zip_test.go
Change-Id: I54b8eef9231875e6042a32c9f8bcc5c2f779922a
2018-09-28 14:01:29 -07:00
Colin Cross 05518bc13b soong_zip: Add tests
Add test that cover basic command line usage of soong_zip.  -D
is not covered yet as the implementation will be replaced with
one that is also more easily testable in the next patch.

Bug: 116751500
Test: zip_test.go
Change-Id: I5a1bcee74ebc9cb3cf332c36f89bc12c0e807ad2
2018-09-28 13:56:06 -07:00
Colin Cross b051ab5cb5 soong_zip: move profiling from zip library to soong_zip
Profiling is only used by the standalone soong_zip command,
move it out of the shared zip library.

Bug: 116751500
Test: m checkbuild
Change-Id: I443c34fb39cf8955e163a7720d6f7ed585e4172a
2018-09-28 13:56:06 -07:00
Colin Cross fe945b4401 soong_zip: move args parsing into zip.FileArgsBuilder
Add a builder that can construct []FileArg for zip.Run to use.
This will help writing tests that cover the command line parsing.

Test: later cl
Bug: 116751500
Change-Id: I15b5144f5094ab154f13de9c8a84b82db2da4e67
2018-09-28 13:56:06 -07:00
Colin Cross 258f3e002c Merge "Add phony targets for go binary modules"
am: e9b16159d5

Change-Id: Ia668598a70c2194c8bd065be37ad8abc7fff5005
2018-09-28 12:50:41 -07:00
Treehugger Robot e9b16159d5 Merge "Add phony targets for go binary modules" 2018-09-28 19:45:22 +00:00
Colin Cross 2465c3d998 Add phony targets for go binary modules
Add custom handling to androidmk.go for the bootstrap.GoBinaryTool
interface in order to create .PHONY targets for each tool written
in go.

Bug: 64539926
Test: m checkbuild
Test: m androidmk
Test: m multiproduct_kati
Change-Id: Ic65faa27a6ee4dfbd54ed6d208091db7c1d657a2
2018-09-28 10:25:45 -07:00
Colin Cross c48d4e2355 Add dependencies on d8 and r8 library arguments
am: 6dab9bd57a

Change-Id: I95f5b4795ca21232d2838c53c27bbfb6b358bf11
2018-09-28 10:21:54 -07:00
Colin Cross 6dab9bd57a Add dependencies on d8 and r8 library arguments
d8 and r8 were missing dependencies on jars passed as library
arguments.  This normally worked because the input jar is likely
to also depend on the same jars.  When the classpath was added
to d8 it started to fail on libraries that have no code but
include other static libraries.

Bug: 116840360
Test: rm out/soong/.intermediates/external/nist-sip/nist-sip/android_common/turbine-combined/nist-sip.jar && m out/soong/.intermediates/frameworks/base/ext/android_common/dex/ext.jar
Change-Id: Ie642f4a343b949778d8ee6dcc4511f3fd7633be1
2018-09-28 15:15:08 +00:00
Christopher Ferris 9df92d6438 Add an isolated option for cc_test targets.
Test: Built a test using the isolated flag.
Change-Id: I0fe51437a66e03dbfb4ffcfd3a04af094388c6bc
2018-09-27 22:23:13 -07:00
Logan Chien 018fe90276 Merge "Allow cc_prebuilt version suffix to include `svn`"
am: f25112a70f

Change-Id: Ie85611438fc874748c4375cc1d0e5f4e277cbf9c
2018-09-27 18:32:24 -07:00
Logan Chien f25112a70f Merge "Allow cc_prebuilt version suffix to include `svn`" 2018-09-28 01:24:24 +00:00
Jack He 4466656211 Merge "TradeFed: Add "test_config_template" flag in Android.bp"
am: dbc2962c42

Change-Id: If22f6b2b252be0ae724763b1a971777706edf6fb
2018-09-27 17:43:57 -07:00
Treehugger Robot dbc2962c42 Merge "TradeFed: Add "test_config_template" flag in Android.bp" 2018-09-28 00:29:04 +00:00
Colin Cross f334701059 Merge "Pass classpath to d8"
am: dfe02f5dc8

Change-Id: I0898c3e478125871ead02df067292847d091865a
2018-09-27 16:38:01 -07:00
Treehugger Robot dfe02f5dc8 Merge "Pass classpath to d8" 2018-09-27 23:27:45 +00:00
Colin Cross df61e69f74 Merge "Allow cc_object modules to use STL"
am: fc2aac5c71

Change-Id: Ied45fa5fe78e00b13345359ed582ab1db6d6a28e
2018-09-27 16:25:32 -07:00
Colin Cross fc2aac5c71 Merge "Allow cc_object modules to use STL" 2018-09-27 23:23:19 +00:00
Nan Zhang a91b49d2b0 Merge "Fix invalid memory error for python binary build"
am: 8202ad2f9a

Change-Id: If734ff272b9913669e974f9c96ff717110afc616
2018-09-27 13:46:42 -07:00
Nan Zhang 8202ad2f9a Merge "Fix invalid memory error for python binary build" 2018-09-27 20:31:40 +00:00
Colin Cross 907769f0fb Allow cc_object modules to use STL
cc_object modules may need access to the STL headers.

Test: m checkbuild
Change-Id: I88ad556a349d9530d24949f05eebf8b6fab4c62a
2018-09-27 18:06:23 +00:00
Colin Cross ffb657ebc0 Pass classpath to d8
d8 requires the full classpath if --min-api requires default method
or try-with-resources desugaring.  Always pass the full classpath,
since it will already have been built to generate the input jar.

Bug: 116243313
Test: m checkbuild
Change-Id: Ib0c18873880697b7cf942e0548dd2c53ee5ad23c
2018-09-27 11:05:09 -07:00
Neil Fuller 64f1170c18 Merge "Allow conscrypt to depend on core.intra.stubs"
am: daf5ec0c28

Change-Id: Ibc09870fd9e184979b7dd2c8607b5dc1ded66914
2018-09-27 04:10:15 -07:00
Neil Fuller daf5ec0c28 Merge "Allow conscrypt to depend on core.intra.stubs" 2018-09-27 10:59:53 +00:00
Jack He 3333889da5 TradeFed: Add "test_config_template" flag in Android.bp
* Allow module owner to specify a test_config_template in Android.bp
* The rule goes:
  1. When "test_config" is set, Soong uses specified test config
  2. If 1 is not true, check if "AndroidTest.xml" exist in the
     directory, if so, use "AndroidTest.xml
  3. If 1 and 2 are not true, check if "test_config_template" is set.
     If so, use module specific template to generate test config
  4. Otherwise, use Soong default template for test config for autogen

Bug: 113359343
Test: make
Change-Id: I9fb4b2b266be9e0c7cf23da4a51e1c8ae67cd857
2018-09-26 18:02:55 -07:00
Ilya Matyukhin f7e747b837 Merge "Fixed the link to go/Android.bp"
am: 82db9f9f69

Change-Id: I10772c5b9c3fd8b0333e33607f463abb96b266f0
2018-09-26 16:59:44 -07:00
Nan Zhang cba97e69ab Fix invalid memory error for python binary build
The root cause is we didn't check if the optionalpath is valid or not,
the registerbuildation function directly invoke the path var and
cause the invalid memory error. We just return if the launcher doesn't
exist.

The ctx.VisitDirectDepsWithTag() also handles allowmissingdependency so
we are ok if launcher doesn't exist.

Test: N/A
Bug: b/116698229, b/67510844
Change-Id: I40941079a64d7797ab879fc5edaa29e835b493a0
2018-09-26 16:57:24 -07:00
Treehugger Robot 82db9f9f69 Merge "Fixed the link to go/Android.bp" 2018-09-26 23:44:47 +00:00
Colin Cross 0ca9a942c3 Merge changes from topic "glob_escapes"
am: ce6b038a55

Change-Id: I131bbe0ea5491de5e2bb71c10f66f9b45b7ccc67
2018-09-26 14:50:10 -07:00
Simran Basi d71cad7cb0 Merge "Add OWNERS to finder's cache"
am: c736cda13f

Change-Id: Ia3a0cff8654063160f128e8f6fbb73ac91803b55
2018-09-26 14:48:55 -07:00
Colin Cross ce6b038a55 Merge changes from topic "glob_escapes"
* changes:
  Revert "soong_zip: support globs in -f and -D arguments"
  Revert "Add a --symlinks argument to soong_zip"
2018-09-26 21:38:19 +00:00
Colin Cross 7f33b81ef6 Revert "soong_zip: support globs in -f and -D arguments"
This reverts commit 08e28abc4e.

Reason for revert: inserts extra ../../ entries in the zip file.

Bug: 116737386
Change-Id: I048f94889a66fe618058e37a5827d0cf6b1a6b68
2018-09-26 21:38:07 +00:00
Treehugger Robot c736cda13f Merge "Add OWNERS to finder's cache" 2018-09-26 21:37:54 +00:00
Colin Cross c7feeff1e9 Revert "Add a --symlinks argument to soong_zip"
This reverts commit d59dab94c4.

Bug: 112843624
Change-Id: I3d0f1b61e899b162e65c18662f9d27dd794a9a30
2018-09-26 21:36:44 +00:00
Stephen Hines c91ab9eb6d Switch to clang-r339409.
This also changes over llvm-strip to use the -o flag, rather than
relying on nonstandard (and no longer functional) positional arguments.

Bug: http://b/111998531
Test: Multiple new builds. For googlers - http://go/clang-r339409-testing
Change-Id: I8c82d06304af24a001e6552e36e2f540d8e364ce
2018-09-26 21:15:08 +00:00
Pirama Arumuga Nainar 783591182e Merge "GccCppStdVersion should not be needed anymore"
am: e12f5e23c2

Change-Id: I5ad9f5f976faa0ba52c87b64bd82275c65e54bf9
2018-09-26 13:32:27 -07:00
Colin Cross aaf17f4f56 Merge "Add a --symlinks argument to soong_zip"
am: 60b0360c3b

Change-Id: I3a39bcab98c1f9217f9e520f11d37620b286d596
2018-09-26 13:32:02 -07:00
Treehugger Robot e12f5e23c2 Merge "GccCppStdVersion should not be needed anymore" 2018-09-26 20:19:01 +00:00
Colin Cross 60b0360c3b Merge "Add a --symlinks argument to soong_zip" 2018-09-26 20:17:49 +00:00
Dan Albert f50b6ce9ba Pylint fix.
Test: pylint cc/gen_stub_libs.py
Bug: None
Change-Id: Ifa397b2b69a835d7f61731e4f240fa5971858f4c
2018-09-26 11:26:09 -07:00
Colin Cross b20ceb9bb7 Merge "soong_zip: support globs in -f and -D arguments"
am: f9641687f5

Change-Id: Ice5cffd755fdb5c9044ed7478b01a407cc36500d
2018-09-26 11:07:48 -07:00
Colin Cross f9641687f5 Merge "soong_zip: support globs in -f and -D arguments" 2018-09-26 17:52:45 +00:00
Neil Fuller cf157ccb16 Allow conscrypt to depend on core.intra.stubs
conscrypt is built against an API surface we define
in libcore as core.intra.stubs. Therefore we need
an exception to the libcore dependency rules.

Bug: 113148576
Bug: 110404540
Test: make conscrypt
Change-Id: If36e05b2d8339741393752bd864bdb5d6c0f503e
2018-09-26 16:19:46 +01:00
Logan Chien e4d5a6c486 Allow cc_prebuilt version suffix to include `svn`
This commit allows cc_prebuilt version suffix to include `svn`, e.g.
`libclang.so.8svn`.  The rationale behind this commit is that latest
LLVM/Clang prebuilt binaries use `.8svn` as the version suffix.

Bug: 111579848
Test: header-abi-dumper builds with the latest binaries
Change-Id: I91594c5d8bc57605e2e0facb0a867dc4a4a17fe6
2018-09-26 10:59:56 +08:00
Colin Cross 8b7e1e348a Merge "Update soong for ShouldFollowSymlinks argument to pathtools.Glob"
am: 7692bf2468

Change-Id: Ifd7fa8a69e0ec92f5ce96792f068e5911f945bd2
2018-09-25 17:13:01 -07:00
Colin Cross 7692bf2468 Merge "Update soong for ShouldFollowSymlinks argument to pathtools.Glob" 2018-09-25 23:57:46 +00:00