From 06368f23b7c0f5c754bfaba12df8f1ee9297344d Mon Sep 17 00:00:00 2001 From: Eric Miotto <1094986+edymtt@users.noreply.github.com> Date: Thu, 4 Jun 2020 11:44:21 -0700 Subject: [PATCH 1/2] Use defaults instead of plutil to modify plists The reason for this is twofold: * `defaults` will not longer support this in the future, as per man page > WARNING: The defaults command will be changed in an upcoming major release to only operate on preferences domains. General plist manipulation utilities will be folded into a different command-line program. * this may help address some failures in Swift CI related to the execution of this command Addresses rdar://63984731 --- perftests/Xcode/PerfTests/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perftests/Xcode/PerfTests/CMakeLists.txt b/perftests/Xcode/PerfTests/CMakeLists.txt index c49bd253..83bcbfa6 100644 --- a/perftests/Xcode/PerfTests/CMakeLists.txt +++ b/perftests/Xcode/PerfTests/CMakeLists.txt @@ -43,7 +43,7 @@ target_link_libraries(XcodePerfTests PRIVATE # # http://www.cmake.org/Bug/view.php?id=15485 add_custom_command( - COMMAND defaults write ${CMAKE_CURRENT_BINARY_DIR}/XcodePerfTests.xctest/Contents/Info.plist CFBundleExecutable XcodePerfTests && touch ${CMAKE_CURRENT_BINARY_DIR}/fixup-has-run + COMMAND plutil -replace CFBundleExecutable -string XcodePerfTests ${CMAKE_CURRENT_BINARY_DIR}/XcodePerfTests.xctest/Contents/Info.plist && touch ${CMAKE_CURRENT_BINARY_DIR}/fixup-has-run COMMENT "Fixing up XcodePerfTests.xctest CFBundleExecutable..." OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/XcodePerfTests.xctest/Contents/Info.plist) add_custom_target(fixup-XcodePerfTests-bundle From a85c4ca4f492a7c36010f0dd67d7d160d4d41a00 Mon Sep 17 00:00:00 2001 From: Eric Miotto <1094986+edymtt@users.noreply.github.com> Date: Fri, 5 Jun 2020 09:25:00 -0700 Subject: [PATCH 2/2] Run fixup on correct XcodePerfTests bundle path Also add explicit dependency of the fixup target on the bundle target --- perftests/Xcode/PerfTests/CMakeLists.txt | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/perftests/Xcode/PerfTests/CMakeLists.txt b/perftests/Xcode/PerfTests/CMakeLists.txt index 83bcbfa6..371e4afe 100644 --- a/perftests/Xcode/PerfTests/CMakeLists.txt +++ b/perftests/Xcode/PerfTests/CMakeLists.txt @@ -42,11 +42,16 @@ target_link_libraries(XcodePerfTests PRIVATE # Run a custom command to fixup CMake's broken bundle CFBundleExecutable. # # http://www.cmake.org/Bug/view.php?id=15485 +# +# It seems this is no longer an issue in Xcode 11.4/CMake 3.16.3, but leaving this +# workaround in place for good measure +get_target_property(xcode_perf_tests_output_directory XcodePerfTests LIBRARY_OUTPUT_DIRECTORY) add_custom_command( - COMMAND plutil -replace CFBundleExecutable -string XcodePerfTests ${CMAKE_CURRENT_BINARY_DIR}/XcodePerfTests.xctest/Contents/Info.plist && touch ${CMAKE_CURRENT_BINARY_DIR}/fixup-has-run + COMMAND plutil -replace CFBundleExecutable -string XcodePerfTests ${xcode_perf_tests_output_directory}/XcodePerfTests.xctest/Contents/Info.plist && touch ${CMAKE_CURRENT_BINARY_DIR}/fixup-has-run COMMENT "Fixing up XcodePerfTests.xctest CFBundleExecutable..." - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/XcodePerfTests.xctest/Contents/Info.plist) + OUTPUT ${xcode_perf_tests_output_directory}/XcodePerfTests.xctest/Contents/Info.plist) add_custom_target(fixup-XcodePerfTests-bundle ALL - DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/XcodePerfTests.xctest/Contents/Info.plist) - + DEPENDS ${xcode_perf_tests_output_directory}/XcodePerfTests.xctest/Contents/Info.plist) +# Declare this dependency explicitly to avoid plutil failing because Info.plist is missing +add_dependencies(fixup-XcodePerfTests-bundle XcodePerfTests)