cmake-pandocology icon indicating copy to clipboard operation
cmake-pandocology copied to clipboard

Race Condition for RESOURCE_FILES

Open fliiiix opened this issue 5 years ago • 0 comments

I use pandocology to render markdown files to html.

Here is how my cmake looks:

include(pandocology)

set(doc_resources
    index.md
    2017_10_01_Firmware_Plugin_usage.md
    2017_10_12_Plugin_Initialization.md
)
add_custom_target(adr)
foreach(doc IN ITEMS ${doc_resources})
    string(REPLACE ".md" "" name ${doc})
    add_document(
        TARGET ${name}
        OUTPUT_FILE ${name}.html
        SOURCES ${name}.md
        RESOURCE_FILES resources/style.css resources/footer.html
        PANDOC_DIRECTIVES -c style.css -A footer.html
    )
    add_dependencies(adr ${name})
endforeach()

And this is shortened output from jenkins:

Scanning dependencies of target 2017_10_12_Plugin_Initialization
Scanning dependencies of target index
Scanning dependencies of target 2017_10_01_Firmware_Plugin_usage
[  0%] Generating footer.html
[  0%] Generating footer.html
[  0%] Generating footer.html
[  0%] Generating 2017_10_12_Plugin_Initialization.md
[  0%] Generating 2017_10_01_Firmware_Plugin_usage.md
[  0%] Generating index.md
[  0%] Generating style.css
[  0%] Generating style.css
[  0%] Generating style.css
Error copying file (if different) from "/jenkins/workspace/FK5WIAJHAG54NVJBDM7YTNLWMETEVHCV4POCE5DNPY6VLOMPTWCA/doc/ADR/resources/style.css" to "/jenkins/workspace/FK5WIAJHAG54NVJBDM7YTNLWMETEVHCV4POCE5DNPY6VLOMPTWCA/build-debian/doc/ADR/style.css".
doc/ADR/CMakeFiles/index.dir/build.make:78: recipe for target 'doc/ADR/style.css' failed

So I'm guessing coping RESOURCE_FILES files is not really safe when you try to copy the same file multiple times.

fliiiix avatar May 15 '19 13:05 fliiiix