Support Request #12297
closedadtf_install_plugin CMake macro breaks by race-condition with MSVC generator
Description
Supportanfrage
The adtf_install_plugin CMake macro is not safe to use when multiple CMake targets have been declared in the same source directory. This defect is inherited from the basic CMake INSTALL method.
For all targets declared in the same source directory, only a single, common `cmake_install.cmake` file is created which doesn't distinguish between the targets it is being invoked from. At the same time, anything listed in that file which hasn't been generated yet creates an error for the invoking target.
E.g. when building plugins "foo" and "bar" from the same directory, clean build, then even though they have no dependencies on each other, the first of them to finish compilation will "fail", while the last to finish will "succeed".
A second build attempt without a clean will then succeed, as the install script is then copying artifacts from the previous build for unfinished targets. (And by that potentially introducing other spurious build failures.)
In a variant of this race conditions, both targets will succeed on first attempt, but only partially written artifacts have been installed.
Lösung
Will be solved within ACORE-9369
Updated by hidden almost 4 years ago
adtf_add_post_build_install() is to blame for this defect. The convenience added by that macro clashes with CMakes design of INSTALL.
If adtf_add_post_build_install() is supposed to be kept, it must make proper use of CMakes Components system in order to limit installation strictly to the components already built.
Updated by hidden almost 4 years ago
- Project changed from Public Support to 10
- Status changed from New to In Progress
- Topic set to ADTF::Common
Updated by hidden almost 4 years ago
- Status changed from In Progress to To Be Closed
- Resolution set to Product Issue Opened
- Product Issue Numbers set to https://www.cip.audi.de/jira/browse/ACORE-9369
Ja, das nervt immer wieder! Ich denke das sollten wir in ACORE-9369 mitmachen. Ich schreibs dort ins Ticket rein.
Updated by hidden almost 4 years ago
- Project changed from 10 to Public Support
- Description updated (diff)
- Private changed from Yes to No
- Customer set to DIGITALWERK
- Department set to ENTWICKLUNG