Android build failing on space-containing target
I added a target test with a space in its name to prevent future regressions in handling it (xref #2538 (closed)).
Yet the Android build now fails trying to do its "adb push" of this binary:
http://dynamorio.org/CDash/buildSummary.php?buildid=30480
File: /work/dr/nightly/run/build_android-debug-internal-32/suite/tests/CMakeFiles/common.broadfun.dir/build.make Line: 96
suite/tests/CMakeFiles/common.broadfun.dir/build.make:96: recipe for target 'suite/tests/bin/common.broadfun spaces' failed
A verbose run:
[ 80%] Linking C executable "bin/common.broadfun spaces"
cd /work/dr/nightly/run/build_android-debug-internal-32/suite/tests && /extsw/pkgs/cmake/exports-curl/bin/cmake -E cmake_link_script CMakeFiles/common.broadfun.dir/link.txt --verbose=1
/work/toolchain/android-ndk-21/bin/arm-linux-androideabi-gcc -fPIE -pie CMakeFiles/common.broadfun.dir/common/broadfun.c.o -o "bin/common.broadfun spaces" -lm -ldl bin/libtools.a ../../lib32/libdrhelper.a
/work/toolchain/android-ndk-21/bin/arm-linux-androideabi-objcopy --only-keep-debug "bin/common.broadfun spaces" "bin/common.broadfun spaces".debug
/work/toolchain/android-ndk-21/bin/arm-linux-androideabi-objcopy --add-gnu-debuglink="bin/common.broadfun spaces".debug "bin/common.broadfun spaces"
/work/toolchain/android-ndk-21/bin/arm-linux-androideabi-strip -g -x "bin/common.broadfun spaces"
cd /work/dr/nightly/run/build_android-debug-internal-32/suite/tests && /extsw/android/android-sdk-linux/platform-tools/adb push /work/dr/nightly/run/build_android-debug-internal-32/suite/tests/bin/common.broadfun /data/local/tmp/build_android-debug-internal-32/suite/tests/bin/common.broadfun
cannot stat '/work/dr/nightly/run/build_android-debug-internal-32/suite/tests/bin/common.broadfun': No such file or directory
suite/tests/CMakeFiles/common.broadfun.dir/build.make:96: recipe for target 'suite/tests/bin/common.broadfun spaces' failed
make[2]: *** [suite/tests/bin/common.broadfun spaces] Error 1
It seems like a CMake problem where PROPERTY LOCATION does not use custom OUTPUT_NAME.
I have:
set_target_properties(common.broadfun PROPERTIES OUTPUT_NAME "common.broadfun spaces")
Yet for DynamoRIO_copy_target_to_device for Android this query:
get_target_property(abspath ${target} LOCATION${location_suffix})
Returns just ".../common.broadfun".
For cmake 3.x we're supposed to switch to generator expressions and move away from LOCATION so maybe we should put in the work to upgrade to 3.x? Are any CDash bots or Travis or Appveyor still on 2.x?
A generator expression does work here for the source (have to figure out how to manipulate it for the target):
COMMAND ${ADB} push $<TARGET_FILE:${target}> "${device_base_dir}/${builddir}/${relpath}"
=>
cd /work/dr/nightly/run/build_android-debug-internal-32/suite/tests && /extsw/android/android-sdk-linux/platform-tools/adb push "/work/dr/nightly/run/build_android-debug-internal-32/suite/tests/bin/common.broadfun spaces" /data/local/tmp/build_android-debug-internal-32/suite/tests/bin/common.broadfun