Bug #11643

Circular dependency between cetbuildtools and cetlib?

Added by Ben Morgan about 4 years ago. Updated almost 4 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:
2.00 h
Spent time:


In source:Modules/CetCMakeUtils.cmake and source:Modules/InstallPerlLib.cmake, use is made of a program and resource from the upstream cetlib product. Though these are accessed via env vars, it creates an implicit dependency on cetlib, but that depends on cetbuildtools, creating the cycle.

As the used functionality appears to relate to cetlib's plugin/templating functionality, the CMake function/macros could be moved into a dedicated CMake module in cetlib. It could then be used directly, and also installed by cetlib so that its clients of would have access to it after find_package/find_ups_product (identical to how other CMake-baed projects like ROOT/Qt provide Cmake wrappers for their tools).


#1 Updated by Ben Morgan about 4 years ago

Another dependency, but in this case a straight implicit one is that source:Modules/SetFlavorQual.cmake requires ups and also cetpkgsupport (for get-directory-name). That's sort of obvious and less severe given that one needs UPS is the first place, and the cetpkgsupport dependence is in the resulting generated table file.

Only thing I wondered is whether cetpkgsupport could be merged into cetbuildtools or ups - depending on whether it's more focussed on building products or manipulating ups files/dbs? NB, I haven't studied cetpkgsupport or ups yet, so I may be misunderstanding the use cases and scope of the former...

#2 Updated by Christopher Green about 4 years ago

  • Status changed from New to Accepted

We agree that it seems reasonable to move this functionality into CMake modules in cetlib. The function in CetCMakeUtils appears to be unused, so could probably be removed entirely, although it might be advisable and/or necessary to do the same thing in cetlib that you did in cetbuildtools, to ensure that cetskelgen may be found both during the build of cetlib and during the build of other packages. However, I do not believe a formal circular dependency as I understand it because the CMake functionality you mention is not invoked unless those functions are called, which is not done during the build of cetbuildtools itself. Client code must load the module and use its function(s), which is only likely to be useful for someone using cetlib, directly or indirectly. I do understand that the potential is there for unintentional misuse, so we will be moving the CMake code as you request.

#3 Updated by Lynn Garren about 4 years ago

Hello Ben, to answer your question about cetpkgsupport, it is designed to be used in ups table files without needing all of cetbuildtools. cetpkgsupport is meant to be lightweight and is not meant to require an explicit version. We have already provided some of the functionality in ups, but we think that cetpkgsupport is still needed at this time.

#4 Updated by Lynn Garren about 4 years ago

  • Status changed from Accepted to Resolved
  • Assignee set to Lynn Garren
  • % Done changed from 0 to 100
  • Estimated time set to 2.00 h

The cet_find_cetskelgen macro has been removed from cetbuildtools as of v1_19_02. I find no evidence that this was used anywhere, and I find no difference in the builds.

#5 Updated by Lynn Garren almost 4 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF