-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[Offload] Fix missing dependencies in Offload API generation #142776
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Offload] Fix missing dependencies in Offload API generation #142776
Conversation
@llvm/pr-subscribers-offload Author: Callum Fare (callumfare) ChangesThanks to @RossBrunton for spotting this. We attempt to clang-format the generated Offload header files, but if clang-format isn't available we just copy the generated files instead. That fallback path was missing the correct dependencies. Fixes #142756 Full diff: https://github.com/llvm/llvm-project/pull/142776.diff 1 Files Affected:
diff --git a/offload/liboffload/API/CMakeLists.txt b/offload/liboffload/API/CMakeLists.txt
index cf6e132aa57a9..216710faa84f6 100644
--- a/offload/liboffload/API/CMakeLists.txt
+++ b/offload/liboffload/API/CMakeLists.txt
@@ -42,5 +42,7 @@ else()
COMMAND ${CMAKE_COMMAND} -E copy_if_different generated/${file}.gen ${CMAKE_CURRENT_BINARY_DIR}/${file}
DEPENDS generated/${file}.gen
)
+ add_custom_target(OffloadAPI.${file} DEPENDS ${file})
+ add_dependencies(OffloadAPI OffloadAPI.${file})
endforeach()
endif()
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't my original patch have that? Guess I didn't notice it missing.
The generation fails if the "generated" and "include" subdirectories are missing. runtimes/runtimes-bins/offload/plugins-nextgen/common/include |
@kparzysz I don't see any failures when building with a completely clean build directory. Could you share the build log where you're getting those failures? |
Here's the error
My cmake command was
|
Manually creating the two directories fixes the problem: make all install completes successfully. |
Thanks, it could be a difference between Ninja and Makefile, I'll investigate |
This happens when I start with an empty directory as the build tree. Once it's populated with make files and subdirectories (with these two created by hand), everything works in all subsequent builds. |
Thanks to @RossBrunton for spotting this.
We attempt to clang-format the generated Offload header files, but if clang-format isn't available we just copy the generated files instead. That fallback path was missing the correct dependencies.
Fixes #142756