Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[projmgr] Skip processing candidate layers during detection phase #1875

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion tools/projmgr/include/ProjMgrWorker.h
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,6 @@ class ProjMgrWorker {
bool CollectLayersFromSearchPath(const std::string& clayerSearchPath, StrVecMap& clayers);
void GetRequiredLayerTypes(ContextItem& context, LayersDiscovering& discover);
bool GetCandidateLayers(LayersDiscovering& discover);
bool ProcessCandidateLayers(ContextItem& context, LayersDiscovering& discover);
bool ProcessLayerCombinations(ContextItem& context, LayersDiscovering& discover);
bool DiscoverMatchingLayers(ContextItem& context, std::string clayerSearchPath);
void CollectConnections(ContextItem& context, ConnectionsCollectionVec& connections);
Expand Down
53 changes: 8 additions & 45 deletions tools/projmgr/src/ProjMgrWorker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -730,47 +730,6 @@ void ProjMgrWorker::GetRequiredLayerTypes(ContextItem& context, LayersDiscoverin
}
}

bool ProjMgrWorker::ProcessCandidateLayers(ContextItem& context, LayersDiscovering& discover) {
// get all candidate layers
if (!GetCandidateLayers(discover)) {
return false;
}
// load device/board specific packs specified in candidate layers
vector<PackItem> packRequirements;
for (const auto& [type, clayers] : discover.candidateClayers) {
for (const auto& clayer : clayers) {
const ClayerItem& clayerItem = m_parser->GetGenericClayers()[clayer];
if (!clayerItem.forBoard.empty() || !clayerItem.forDevice.empty()) {
InsertPackRequirements(clayerItem.packs, packRequirements, clayerItem.directory);
}
}
}
if (packRequirements.size() > 0) {
AddPackRequirements(context, packRequirements);
if (!LoadAllRelevantPacks() || !LoadPacks(context)) {
PrintContextErrors(context.name);
return false;
}
}
// process board/device filtering
if (!ProcessDevice(context)) {
return false;
}
if (!SetTargetAttributes(context, context.targetAttributes)) {
return false;
}
// recollect layers from packs after filtering
discover.genericClayersFromPacks.clear();
if (!CollectLayersFromPacks(context, discover.genericClayersFromPacks)) {
return false;
}
discover.candidateClayers.clear();
if (!GetCandidateLayers(discover)) {
return false;
}
return true;
}

bool ProjMgrWorker::GetCandidateLayers(LayersDiscovering& discover) {
// clayers matching required types
StrVecMap genericClayers = CollectionUtils::MergeStrVecMap(discover.genericClayersFromSearchPath, discover.genericClayersFromPacks);
Expand Down Expand Up @@ -805,8 +764,8 @@ bool ProjMgrWorker::DiscoverMatchingLayers(ContextItem& context, string clayerSe
}
// get required layer types
GetRequiredLayerTypes(context, discover);
// process candidate layers
if (!ProcessCandidateLayers(context, discover)) {
// get candidate layers
if (!GetCandidateLayers(discover)) {
return false;
}
// process layer combinations
Expand Down Expand Up @@ -4106,12 +4065,16 @@ bool ProjMgrWorker::ListLayers(vector<string>& layers, const string& clayerSearc
}
}
} else {
// process precedences
if (!ProcessPrecedences(context)) {
// process precedences and device/board
if (!ProcessPrecedences(context, true)) {
failedContexts.insert(selectedContext);
error |= true;
continue;
}
if (!SetTargetAttributes(context, context.targetAttributes)) {
error |= true;
continue;
}
// get matching layers for selected context
if (!DiscoverMatchingLayers(context, clayerSearchPath)) {
failedContexts.insert(selectedContext);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ solution:
packs:
- pack: ARM::RteTest
- pack: ARM::RteTest_DFP
- pack: ARM::[email protected]
for-context: +BoardSpecific
Loading