Skip to content

Resolve "ERROR module X has no dependency declaration: __gradle_deps__"

This change set improves the error handling by providing more explicit error messages in case e.g. CBNG is not available.

In particular:

  • when cmmnbuild_dep_manager enters "auto-install" mode (from an instantation like mgr = Manager('pjlsa')), it bumps the log level to INFO and informs the user. This is because the resolving step may take quite long and is the most error prone situation. The log messages will prove helpful in case something goes wrong (or even just for the user to know why the import takes so long)
In [1]: import pjlsa
INFO:cmmnbuild_dep_manager:Package "pjlsa" is not yet set up - installing and resolving JARs
INFO:cmmnbuild_dep_manager:using resolver: CbngWebResolver (CBNG Web Service)
INFO:cmmnbuild_dep_manager:pjlsa registered
INFO:cmmnbuild_dep_manager:resolving dependencies
INFO:cmmnbuild_dep_manager.resolver:resolving dependencies using CBNG web service: https://wikis.cern.ch/display/DVTLS/CBNG+Web+service
  • when gradle_deps is not defined but cmmnbuild_deps is, and CBNG is not available (or vice versa with Gradle), it will print more explicit error messages:
ERROR:cmmnbuild_dep_manager:module pjlsa does not declare __gradle_deps__, which is needed for GradleResolver (Pure Gradle - when the CERN CBNG is not available) 
Resolvers compatible with this module:
 - CbngWebResolver [__cmmnbuild_deps__] - CBNG Web Service
  • when running on a CERN host (hostname containing "cern.ch"), and CBNG is not available, it will print a message like
WARNING: This appears to be a CERN machine (michi.cern.ch), but CBNG is not available. Will try to resolve dependencies from public repositories, which may not work for CERN internal modules.
INFO: using resolver: GradleResolver (Pure Gradle - when the CERN CBNG is not available)
Edited by Michi Hostettler

Merge request reports