Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#15649] build: fix auto re-running cmake
Summary: When a cmake file is updated, ninja automatically triggers rerun of cmake. However, that rerun fails because cmake runs with remote build enabled, which messes up some output parsing. A workaround is to use the --frcm option for yb_build.sh because yb_build.sh sets YB_REMOTE_COMPILATION=0 before running cmake. If not using the workaround, ninja runs cmake, and by that point, it is too late to disable remote compilation from an upper layer. So tackle the problem at the compiler wrapper invocation level. The ninja RERUN_CMAKE rule runs cmake --regenerate-during-build ... which runs compiler-wrappers/c++ -v which is symlinked to compiler-wrapper.sh. The wrapper runs the command remotely or locally depending on parameters such as command line arguments. Change the logic to run this command (and other similar ones) locally so that the version is parsed successfully. Close: #15649 Test Plan: Jenkins: compile only The following is a script to update a cmake file (to trigger auto-re-run cmake) then observe processes during build. When run in an environment where remote build (via ssh) is available, the output should initially show the "c++ -v" command without ssh and then most regular compilation commands using ssh. #!/usr/bin/env bash echo '#' >>CMakeLists.txt ./yb_build.sh & while true; do pid=$(pgrep -f yb_build | head -1) if [ -n "$pid" ]; then pstree -aps "$pid" | grep -PC3 '(c\+\+ -v|ssh)' | grep -v grep fi done Reviewers: mbautin, steve.varnau Reviewed By: steve.varnau Subscribers: ybase, devops Differential Revision: https://phabricator.dev.yugabyte.com/D22204
- Loading branch information