Skip to content

Commit

Permalink
Delete custom cmake config cache mechanism on Unix (#64370)
Browse files Browse the repository at this point in the history
When cmake configuration fails due to missing dependency or manually terminated in the middle (Ctrl+C) for some reason, re-running the build command fails with these messages:

```
  CMake command line is unchanged. Reusing previous cache instead of regenerating.
  Unable to find generated build files for "native libraries component" project!
```

The workaround is to delete artifacts directory and rerun the build command, which is wasteful (as it repreforms all the previous steps including rebuilding the previous subsets). cmake has its own up-to-date caching mechanism which works well on Unix (it has some issues on Windows/MSBuild), so deleting the custom sentinel-based cache on Unix makes it more robust and saves some time. The one in `gen-buildsys.cmd` for Windows is kept intact.
  • Loading branch information
am11 authored Mar 24, 2022
1 parent 0d59046 commit d22acef
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions eng/native/gen-buildsys.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,19 +96,6 @@ if [[ "$build_arch" == "wasm" ]]; then
cmake_command="emcmake $cmake_command"
fi

cmake_args_to_cache="$scan_build\n$SCAN_BUILD_COMMAND\n$generator\n$__UnprocessedCMakeArgs"
cmake_args_cache_file="$2/cmake_cmd_line.txt"
if [[ -z "$__ConfigureOnly" ]]; then
if [[ -e "$cmake_args_cache_file" ]]; then
cmake_args_cache=$(<"$cmake_args_cache_file")
if [[ "$cmake_args_cache" == "$cmake_args_to_cache" ]]; then
echo "CMake command line is unchanged. Reusing previous cache instead of regenerating."
exit 0
fi
fi
echo $cmake_args_to_cache > $cmake_args_cache_file
fi

# We have to be able to build with CMake 3.6.2, so we can't use the -S or -B options
pushd "$2"

Expand Down

0 comments on commit d22acef

Please sign in to comment.