this will fix problem, add in run_periphery.sh before "periphery scan"
# Some variables set by Xcode breaks build.
# We want to run periphery in fresh env without variables set by Xcode.
# It can be achieved by using
# env -i "$ROOT_DIR"/Tools/periphery/run_periphery.sh
# OR
# by unsetting explicitly the variables that breaks the build
unset SWIFT_INSTALL_MODULE_FOR_DEPLOYMENT
unset TEST_FRAMEWORK_SEARCH_PATHS
unset TEST_LIBRARY_SEARCH_PATHS