Concurrency issues with copy_if_different

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Concurrency issues with copy_if_different

Olivier Croquette
Hello,

in one of our projects, we use copy_if_different to copy some DLLs
required by the runtime. It's called as post-build action. The problem
is that several targets want to copy the same DLLs, and when using
parallelized builds, the different "cmake -E copy_if_different" can
conflict, leading the whole build to fail.

I see two options to fix this:

1. don't use copy_if_different, but a custom tool that can deal with the
concurrency

2. instead of adding post-build actions to different targets, fill up a
list containing all the files required, and add a single post-build
action to a single target that copies all the required files in one go

What do you think?

Cheers
Olivier


--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Concurrency issues with copy_if_different

Robert Maynard
Personally would go with option number 2

On Thu, Jul 12, 2018 at 1:58 AM Olivier Croquette <[hidden email]> wrote:
Hello,

in one of our projects, we use copy_if_different to copy some DLLs
required by the runtime. It's called as post-build action. The problem
is that several targets want to copy the same DLLs, and when using
parallelized builds, the different "cmake -E copy_if_different" can
conflict, leading the whole build to fail.

I see two options to fix this:

1. don't use copy_if_different, but a custom tool that can deal with the
concurrency

2. instead of adding post-build actions to different targets, fill up a
list containing all the files required, and add a single post-build
action to a single target that copies all the required files in one go

What do you think?

Cheers
Olivier


--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Concurrency issues with copy_if_different

J. Caleb Wherry
In reply to this post by Olivier Croquette
Had the same problem and went with #2

-Caleb

On Thu, Jul 12, 2018 at 1:58 AM Olivier Croquette <[hidden email]> wrote:
Hello,

in one of our projects, we use copy_if_different to copy some DLLs
required by the runtime. It's called as post-build action. The problem
is that several targets want to copy the same DLLs, and when using
parallelized builds, the different "cmake -E copy_if_different" can
conflict, leading the whole build to fail.

I see two options to fix this:

1. don't use copy_if_different, but a custom tool that can deal with the
concurrency

2. instead of adding post-build actions to different targets, fill up a
list containing all the files required, and add a single post-build
action to a single target that copies all the required files in one go

What do you think?

Cheers
Olivier


--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
--
Sent from my iPhone 4s

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake