Yes, this was the culprit.
I applied "Patchset 3" from Iris Chang and this solved our issues.
Here is the site I got the patchset from:
https://android-review.googlesource.com/c/platform/system/tools/hidl/+/482338
For posterity:
I also attached the (raw) patch file.
This file has to be applied to aosp/system/tools/hidl/Coordinator.cpp
I updated the issue https://issuetracker.google.com/issues/74084489 with
the information from here.
Thank you very much for your help in this.
- Simon
Am Montag, 26. März 2018 20:35:24 UTC+2 schrieb Dan Willemsen:
>
> It sounds like this is this bug: https://issuetracker.google.com/74084489
> (there are some patches linked that you could try)
>
> - Dan
>
>
> On Mon, Mar 26, 2018 at 8:16 AM <[email protected] <javascript:>> wrote:
>
>> Hi Dan,
>>
>> thanks for looking in to this.
>> Attached is the full output of the mma command at the end of my
>> step-by-step reproduction.
>>
>> Simon
>>
>>
>> Am Montag, 19. März 2018 23:09:53 UTC+1 schrieb Dan Willemsen:
>>>
>>> Are there any other messages between the line that starts with FAILED
>>> and the first "failed to create expected output file" message? That message
>>> just means that the underlying tool didn't create the output files as
>>> expected (the message has been cleaned up a bit on master).
>>>
>>> - Dan
>>>
>>> On Mon, Mar 19, 2018 at 9:42 AM <[email protected]> wrote:
>>>
>>>> Hello,
>>>>
>>>> I think I found some sort of bug when trying to build the HIDL library
>>>> inside a ZFS pool.
>>>>
>>>> we use ZFS in our build system, wehave the AOSP source in a ZFS pool.
>>>> We are currently starting to switch to the HIDL interface and I
>>>> stumbled over a (suspected) bug when trying to build our driver with the
>>>> new interface.
>>>> It only ever appears when I have the AOSP source inside the ZFS pool,
>>>> it seems not to happen when the source is checked out on the harddisk.
>>>> I have confirmed this behaviour on multiple machines.
>>>> The AOSP build system seems to trip over something and seems to not be
>>>> able to create an output file.
>>>> However, manually creating the file (with "touch") is no problem.
>>>> The error I get is
>>>>
>>>> *failed to create expected output file:
>>>> out/soong/.temp/sbox552673235/.intermediates/hardware/interfaces/gnss/1.0/[email protected]_genc++_headers/gen/android/hardware/gnss/1.0/BsGnssXtra.h*
>>>>
>>>> The filename changes for all the files it wanted to create.
>>>>
>>>> Could you please confirm this bug and maybe start investigating on your
>>>> side?
>>>>
>>>> This is a simple step-by-step reproduction of the bug:
>>>>
>>>> #Create a growing file for ZFS
>>>> truncate -s 100G test
>>>> #Create a new ZFS pool on the created file
>>>> sudo zpool create test `pwd`/test
>>>> #Just give let anyone do whatever they want to this pool for this demo
>>>> sudo chmod 777 /test
>>>> #Checkout AOSP in this pool
>>>> cd /test
>>>> repo init -u https://android.googlesource.com/platform/manifest -b
>>>> android-8.1.0_r18
>>>> #Let it sync, this will take a while...
>>>> repo sync -j3
>>>> #Init AOSP environment
>>>> . ./build/envsetup
>>>> lunch #choose hikey-userdebug
>>>> #Create demo module
>>>> mkdir -p hardware/test
>>>> cd hardware/test
>>>> #test.cpp seems to be needed for the module to have to actually do some
>>>> work
>>>> touch test.cpp
>>>>
>>>> cat <<EOF > Android.mk
>>>> LOCAL_PATH:= \$(call my-dir)
>>>> include \$(CLEAR_VARS)
>>>>
>>>> LOCAL_INCLUDES += \$(LOCAL_PATH)
>>>>
>>>> LOCAL_CFLAGS += \$(APF_CFLAGS)
>>>>
>>>> LOCAL_MODULE_RELATIVE_PATH := hw
>>>> LOCAL_MODULE := [email protected]
>>>> LOCAL_SRC_FILES := \
>>>> test.cpp
>>>> LOCAL_SHARED_LIBRARIES := \
>>>> liblog \
>>>> libcutils \
>>>> libdl \
>>>> libbase \
>>>> libutils \
>>>> libhwbinder \
>>>> libhidlbase \
>>>> libhidltransport \
>>>> [email protected]
>>>>
>>>> include \$(BUILD_STATIC_LIBRARY)
>>>> EOF
>>>> #Finally: build demo module
>>>> mma
>>>>
>>>>
>>>> #Produces following errors (snippet):
>>>> # failed to create expected output file:
>>>> out/soong/.temp/sbox552673235/.intermediates/hardware/interfaces/gnss/1.0/[email protected]_genc++_headers/gen/android/hardware/gnss/1.0/BsGnssXtra.h
>>>> # failed to create expected output file:
>>>> out/soong/.temp/sbox552673235/.intermediates/hardware/interfaces/gnss/1.0/[email protected]_genc++_headers/gen/android/hardware/gnss/1.0/IGnssXtraCallback.h
>>>> # failed to create expected output file:
>>>> out/soong/.temp/sbox552673235/.intermediates/hardware/interfaces/gnss/1.0/[email protected]_genc++_headers/gen/android/hardware/gnss/1.0/IHwGnssXtraCallback.h
>>>> # failed to create expected output file:
>>>> out/soong/.temp/sbox552673235/.intermediates/hardware/interfaces/gnss/1.0/[email protected]_genc++_headers/gen/android/hardware/gnss/1.0/BnHwGnssXtraCallback.h
>>>> # failed to create expected output file:
>>>> out/soong/.temp/sbox552673235/.intermediates/hardware/interfaces/gnss/1.0/[email protected]_genc++_headers/gen/android/hardware/gnss/1.0/BpHwGnssXtraCallback.h
>>>> # failed to create expected output file:
>>>> out/soong/.temp/sbox552673235/.intermediates/hardware/interfaces/gnss/1.0/[email protected]_genc++_headers/gen/android/hardware/gnss/1.0/BsGnssXtraCallback.h
>>>> #]
>>>> #ninja: build stopped: subcommand failed.
>>>> #13:49:41 ninja failed with: exit status 1
>>>>
>>>>
>>>>
>>>>
>>>> Thanks
>>>>
>>>>
>>>> --
>>>> --
>>>> You received this message because you are subscribed to the "Android
>>>> Building" mailing list.
>>>> To post to this group, send email to [email protected]
>>>> To unsubscribe from this group, send email to
>>>> [email protected]
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/android-building?hl=en
>>>>
>>>> ---
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Android Building" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to [email protected].
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>> --
>> --
>> You received this message because you are subscribed to the "Android
>> Building" mailing list.
>> To post to this group, send email to [email protected]
>> <javascript:>
>> To unsubscribe from this group, send email to
>> [email protected] <javascript:>
>> For more options, visit this group at
>> http://groups.google.com/group/android-building?hl=en
>>
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Android Building" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
--
--
You received this message because you are subscribed to the "Android Building"
mailing list.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-building?hl=en
---
You received this message because you are subscribed to the Google Groups
"Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.
diff --git a/Coordinator.cpp b/Coordinator.cpp
index 838cab3..c643222 100644
--- a/Coordinator.cpp
+++ b/Coordinator.cpp
@@ -460,7 +460,19 @@ status_t Coordinator::getPackageInterfaceFiles(
struct dirent *ent;
while ((ent = readdir(dir)) != NULL) {
- if (ent->d_type != DT_REG) {
+ // filesystems may not support d_type and return DT_UNKNOWN
+ if (ent->d_type == DT_UNKNOWN) {
+ struct stat sb;
+ const auto filename = StringHelper::RTrim(packagePath, "/") + "/" + std::string(ent->d_name);
+ if (lstat(filename.c_str(), &sb) == -1) {
+ fprintf(stderr, "ERROR: Could not stat %s\n", filename.c_str());
+ continue;
+ }
+ if ((sb.st_mode & S_IFMT) != S_IFREG) {
+ continue;
+ }
+ }
+ else if (ent->d_type != DT_REG) {
continue;
}