Skip to content

[Issue]: CMake dist targets do not re-run after dist+expunge targets #1273

@ScottTodd

Description

@ScottTodd

Forking from #1253 (comment)

Huh... something is buggy with those changes. If I build dist-rocm+expunge it deletes build/dist/ as expected, but then building dist-rocm does nothing:

[proc] Executing command: "C:\Program Files\CMake\bin\cmake.EXE" --build D:/projects/TheRock/build --target dist-rocm --
[build] [0/2] Re-checking globbed directories...
[build] ninja: no work to do.
[driver] Build completed: 00:00:00.362
[build] Build finished with exit code 0

only after changing a CMake file do I get the expected behavior where the dist directory is populated again:

[build] -- Build files have been written to: D:/projects/TheRock/build
[build] [0/4] Re-checking globbed directories...
[build] [1/16] Populate artifact core-hipinfo
[build] [2/16] Populate artifact hipify
...

Seems to happen after eafaff9, not sure if it happened before.


Looking through https://github.com/ROCm/TheRock/blob/main/cmake/therock_artifacts.cmake and https://github.com/ROCm/TheRock/blob/main/cmake/therock_subproject.cmake, my theory is that the expunge targets delete only files in the build/dist/rocm/ directory and custom commands like this only tell CMake that the manifest files in build/artifacts are outputs of the artifact populate command:

add_custom_command(
OUTPUT ${_manifest_files}
COMMENT "Populate artifact ${slice_name}"
${_command_list}
DEPENDS
${_stamp_file_deps}
"${ARG_DESCRIPTOR}"
"${_fileset_tool}"
)

Since the output manifests still exist in build/artifacts, CMake sees no reason to re-run the artifact -> dist flatten steps.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions