Not able to build HIDL driver files inside ZFS container

138 views
Skip to first unread message

simon...@u-blox.com

unread,
Mar 19, 2018, 12:42:59 PM3/19/18
to Android Building
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/android.hardware.gnss@1.0_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
:= android.hardware.gnss@1.0-service-test
LOCAL_SRC_FILES
:= \
test
.cpp
LOCAL_SHARED_LIBRARIES
:= \
     liblog
\
     libcutils
\
     libdl
\
     libbase
\
     libutils
\
     libhwbinder
\
     libhidlbase
\
     libhidltransport
\
     android
.hardware.gnss@1.0

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/android.hardware.gnss@1.0_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/android.hardware.gnss@1.0_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/android.hardware.gnss@1.0_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/android.hardware.gnss@1.0_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/android.hardware.gnss@1.0_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/android.hardware.gnss@1.0_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


Dan Willemsen

unread,
Mar 19, 2018, 6:09:53 PM3/19/18
to Android Building
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

--
--
You received this message because you are subscribed to the "Android Building" mailing list.
To post to this group, send email to android-...@googlegroups.com
To unsubscribe from this group, send email to
android-buildi...@googlegroups.com
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 android-buildi...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

simon...@u-blox.com

unread,
Mar 26, 2018, 11:16:09 AM3/26/18
to Android Building
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
mma_output.txt

Dan Willemsen

unread,
Mar 26, 2018, 2:35:24 PM3/26/18
to Android Building
It sounds like this is this bug: https://issuetracker.google.com/74084489 (there are some patches linked that you could try)

- Dan

simon...@u-blox.com

unread,
Mar 27, 2018, 9:26:36 PM3/27/18
to Android Building
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
Coordinator_patch.diff
Reply all
Reply to author
Forward
0 new messages