EDGEML-14581 - Fix copy_headers to use build-time GLOB via cmake -P - #5
Open
jhoyamd wants to merge 1 commit into
Open
EDGEML-14581 - Fix copy_headers to use build-time GLOB via cmake -P#5jhoyamd wants to merge 1 commit into
jhoyamd wants to merge 1 commit into
Conversation
[Why] The previous aie_codegen_setup_build_include_layout() implementation collected headers at cmake configure time using file(GLOB CONFIGURE_DEPENDS) then copied or symlinked each one via configure_file COPYONLY or file(CREATE_LINK). The resolved file paths were baked into the generated build system (MSBuild .rule files under the Visual Studio generator) at configure time. In CI environments where the build directory is reused across runs, stale .rule files from a prior configure can contain paths that no longer exist or that point through defunct filesystem junctions, triggering MSB8066 errors and breaking incremental builds without requiring a full reconfigure. [How] Replace the configure-time header materialization with a build-time add_custom_target(copy_headers ALL) that invokes a new cmake -P script (cmake/CopyHeaders.cmake). The script GLOBs headers and copies them using file(COPY_FILE ... ONLY_IF_DIFFERENT) at build time, so the generated .rule file contains only stable variable-expanded paths that remain valid across build-directory reuse. The aie_codegen target gains an add_dependencies(... copy_headers) link so headers are always present before compilation begins. The AieCodegenHeaders.cmake module is retained for install-time use by AieCodegenInstall.cmake. Signed-off-by: John Hoy <John.Hoy@amd.com> Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[Why]
The previous aie_codegen_setup_build_include_layout() implementation collected headers at cmake configure time using file(GLOB CONFIGURE_DEPENDS) then copied or symlinked each one via configure_file COPYONLY or file(CREATE_LINK). The resolved file paths were baked into the generated build system (MSBuild .rule files under the Visual Studio generator) at configure time. In CI environments where the build directory is reused across runs, stale .rule files from a prior configure can contain paths that no longer exist or that point through defunct filesystem junctions, triggering MSB8066 errors and breaking incremental builds without requiring a full reconfigure.
[How]
Replace the configure-time header materialization with a build-time add_custom_target(copy_headers ALL) that invokes a new cmake -P script (cmake/CopyHeaders.cmake). The script GLOBs headers and copies them using file(COPY_FILE ... ONLY_IF_DIFFERENT) at build time, so the generated .rule file contains only stable variable-expanded paths that remain valid across build-directory reuse. The aie_codegen target gains an add_dependencies(... copy_headers) link so headers are always present before compilation begins. The AieCodegenHeaders.cmake module is retained for install-time use by AieCodegenInstall.cmake.