commit | b7ead01a0d6b255b4dc1acfc2f7dd17fb8151900 | [log] [tgz] |
---|---|---|
author | Jiyong Park <jiyong@google.com> | Fri Jun 30 10:25:19 2023 +0900 |
committer | Jiyong Park <jiyong@google.com> | Thu Jul 06 14:40:26 2023 +0900 |
tree | f0db61bca2b3f6dbfd3d49b02a9c48e5218857d1 | |
parent | ab80509f557199e21622375db6018a3f61624ef3 [diff] |
Ensure base directory to be specified as an import directory Compiling the following aidl file now requires `-I base/dir/`: ``` base/dir/pkg/name/IFoo.aidl: package pkg.name; interface IFoo {...} ``` Previously, the AIDL compiler didn't mandate this and as a result, users had to experience an odd looking error from rsync. ``` rsync: [sender] link_stat "...base/dir/pkg/name/IFoo.cpp" failed: No such file or directory (2) rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1338) [sender=3.2.7] ``` This happened because the build system basically has no idea about what the package name of a given AIDL file is. So, it just assumes that the package name is the relative directory of the input file from the source root. In the above case, it is assumed to be `base.dir.pkg.name`. As a result, it expects the output file to be `base/dir/pkg/name/IFoo.[java|cpp|...], whereas the aidl compiler actually generates it at `pkg/name/IFoo.[java|cpp]`. Users need to teach the package name to the build system either by specifying the base directory of the input path (using the `path` property in `filegroup`) or specifying the import path (using the `local_include_dirs` in `aidl_interface`). This CL makes the error more friendly by failing early in the AIDL compiler. In the above case, with the updated AIDL compiler, the error message is as follows: ``` ERROR: <src_root>/base/dir/pkg/name/Foo.aidl:4.11-15: directory base/dir is not found in any of the import paths: - <src_root>/ ``` Bug: 260009392 Test: run aidl_unittests Change-Id: Iadad10a73c21414030d752fa34f386d25b34262f
Documentation for this project is currently maintained here:
https://source.android.com/devices/architecture/aidl/overview