Skip to content

Commit

Permalink
Merge pull request #24656 from Dr15Jones/fixEdmWriteConfigsFailure
Browse files Browse the repository at this point in the history
Allow PluginDescription default to work in release build
  • Loading branch information
cmsbuild committed Sep 25, 2018
2 parents 19d4bed + f67bd23 commit 38f1404
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
4 changes: 3 additions & 1 deletion FWCore/ParameterSet/interface/PluginDescription.h
Expand Up @@ -145,7 +145,9 @@ template< typename T>
int indentation,
bool& wroteSomething) const final {
if(not defaultType_.empty()) {
edmplugin::PluginManager::configure(edmplugin::standard::config());
auto conf = edmplugin::standard::config();
conf.allowNoCache();
edmplugin::PluginManager::configure(conf);

loadPlugin(defaultType_);

Expand Down
8 changes: 8 additions & 0 deletions FWCore/PluginManager/interface/PluginManager.h
Expand Up @@ -63,8 +63,16 @@ class PluginManager
const SearchPath& searchPath() const {
return m_path;
}
void allowNoCache() {
m_mustHaveCache = false;
}

bool mustHaveCache() const {
return m_mustHaveCache;
}
private:
SearchPath m_path;
bool m_mustHaveCache = true;
};

~PluginManager();
Expand Down
2 changes: 1 addition & 1 deletion FWCore/PluginManager/src/PluginManager.cc
Expand Up @@ -109,7 +109,7 @@ PluginManager::PluginManager(const PluginManager::Config& iConfig) :
readCacheFile(poisonedCacheFile, dir/"poisoned", categoryToInfos_);
}
}
if(not foundAtLeastOneCacheFile) {
if(not foundAtLeastOneCacheFile and iConfig.mustHaveCache()) {
auto ex = cms::Exception("PluginManagerNoCacheFile")<<"No cache files named '"<<standard::cachefileName()<<"' were found in the directories \n";
for( auto const& seen : alreadySeen) {
ex <<" '"<<seen<<"'\n";
Expand Down

0 comments on commit 38f1404

Please sign in to comment.