[CMake] Unified runtime update fails.
I use a single workspace for my work and update sycl branch regularly. Occasionally incremental build fails with something like:
-- Will fetch Unified Runtime from https://github.com/oneapi-src/unified-runtime.git
[0/7] Performing update step for 'unified-runtime-populate'
fatal: reference is not a tree: ec7982bac6cb3a6b9ed610cd6b7cb41fcbc780dc
CMake Error at llvm/build/_deps/unified-runtime-subbuild/unified-runtime-populate-prefix/tmp/unified-runtime-populate-gitupdate.cmake:175 (execute_process):
execute_process failed command indexes:
1: "Child return code: 128"
FAILED: unified-runtime-populate-prefix/src/unified-runtime-populate-stamp/unified-runtime-populate-update
cd /llvm/build/_deps/unified-runtime-src && /usr/bin/cmake -P /llvm/build/_deps/unified-runtime-subbuild/unified-runtime-populate-prefix/tmp/unified-runtime-populate-gitupdate.cmake
ninja: build stopped: subcommand failed.
CMake Error at /usr/share/cmake/Modules/FetchContent.cmake:1012 (message):
Build step for unified-runtime failed: 1
Call Stack (most recent call first):
/usr/share/cmake/Modules/FetchContent.cmake:1141:EVAL:2 (__FetchContent_directPopulate)
/usr/share/cmake/Modules/FetchContent.cmake:1141 (cmake_language)
/usr/share/cmake/Modules/FetchContent.cmake:1184 (FetchContent_Populate)
/llvm/sycl/plugins/unified_runtime/CMakeLists.txt:79 (FetchContent_MakeAvailable)
-- Configuring incomplete, errors occurred!
See also "/llvm/build/CMakeFiles/CMakeOutput.log".
See also "/llvm/build/CMakeFiles/CMakeError.log".
FAILED: build.ninja
/usr/bin/cmake --regenerate-during-build -S/llvm/llvm -B/llvm/build
ninja: error: rebuilding 'build.ninja': subcommand failed
I'm currently on 9489c12fa38dae9b062d627301d17c9ed61e1cd6 and before that I used my private branch based on e5944f16abe355842c87a57c891ea6c29765cc54.
Unfortunately, I don't have a stable reproducer, but integration of unified runtime library into SYCL project seems fragile. I suppose the solution is do a clean build, but I believe the UR update should not break incremental build like that.
I encounter this issue as well occasionally and sometimes not just when updating, but when just jumping between two branches (one of which is significantly older than other). My personal solution for this is just delete build/_deps/unified-runtime-subbuild which triggers clean re-download of the dependency - saves a clean build. Still annoying
Hit similar issue with vc-intrinsics repository.
[0/7] Performing update step for 'vc-intrinsics-populate'
fatal: reference is not a tree: a8403355ada112b72d1fc7db29fd04325eecee60
CMake Error at /llvm/build/_deps/vc-intrinsics-subbuild/vc-intrinsics-populate-prefix/tmp/vc-intrinsics-populate-gitupdate.cmake:175 (execute_process):
execute_process failed command indexes:
1: "Child return code: 128"
Now that the Unified Runtime code has been moved into this repo FetchContent is no longer used, so this can no longer happen.