-
Notifications
You must be signed in to change notification settings - Fork 65
[projmgr] show messages in Problems, Ouput and cbuild-idx.yml if no compatible layer found #2419
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -657,9 +657,9 @@ bool ProjMgr::Configure() { | |||||
|
|
||||||
| if (m_worker.HasVarDefineError()) { | ||||||
| auto undefVars = m_worker.GetUndefLayerVars(); | ||||||
| string errMsg = "undefined variables in "+ fs::path(m_csolutionFile).filename().generic_string() +":\n"; | ||||||
| string errMsg = "undefined variables in "+ fs::path(m_csolutionFile).filename().generic_string() +":"; | ||||||
| for (const string& var : undefVars) { | ||||||
| errMsg += " - $" + var + "$\n"; | ||||||
| errMsg += "\n - $" + var + "$"; | ||||||
| } | ||||||
| ProjMgrLogger::Get().Error(errMsg); | ||||||
| } | ||||||
|
|
@@ -1097,9 +1097,9 @@ bool ProjMgr::RunListLayers(void) { | |||||
| bool error = m_worker.HasVarDefineError() && !m_updateIdx; | ||||||
| if (error) { | ||||||
| auto undefVars = m_worker.GetUndefLayerVars(); | ||||||
| string errMsg = "undefined variables in " + fs::path(m_csolutionFile).filename().generic_string() + ":\n"; | ||||||
| string errMsg = "undefined variables in " + fs::path(m_csolutionFile).filename().generic_string() + ":"; | ||||||
| for (const string& var : undefVars) { | ||||||
| errMsg += " - $" + var + "$\n"; | ||||||
| errMsg += "\n - $" + var + "$"; | ||||||
| } | ||||||
| ProjMgrLogger::Get().Error(errMsg); | ||||||
| } | ||||||
|
|
@@ -1123,13 +1123,8 @@ bool ProjMgr::RunListLayers(void) { | |||||
| // Update the cbuild-idx.yml file with layer information | ||||||
| if (m_updateIdx) { | ||||||
| // Generate Cbuild index | ||||||
| const auto& processedContexts = m_worker.GetProcessedContexts(); | ||||||
| if (!processedContexts.empty()) { | ||||||
| m_worker.ElaborateVariablesConfigurations(); | ||||||
| if (!m_emitter.GenerateCbuildIndex(processedContexts, | ||||||
| m_failedContext, map<string, ExecutesItem>())) { | ||||||
| return false; | ||||||
| } | ||||||
| if (!CallGenerateCbuildIndex()) { | ||||||
| return false; | ||||||
| } | ||||||
| } | ||||||
| return !error; | ||||||
|
|
@@ -1373,3 +1368,16 @@ bool ProjMgr::IsSolutionImageOnly() { | |||||
| } | ||||||
| return imageOnly; | ||||||
| } | ||||||
|
|
||||||
| bool ProjMgr::CallGenerateCbuildIndex() { | ||||||
| const auto& processedContexts = m_worker.GetProcessedContexts(); | ||||||
| if (!processedContexts.empty()) { | ||||||
| m_worker.ElaborateVariablesConfigurations(); | ||||||
| if (!m_emitter.GenerateCbuildIndex(processedContexts, | ||||||
| m_failedContext, map<string, ExecutesItem>())) { | ||||||
| return false; | ||||||
| } | ||||||
| } | ||||||
| return true; | ||||||
|
||||||
| return true; | |
| return true; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -826,13 +826,17 @@ RpcArgs::DiscoverLayersInfo RpcHandler::DiscoverLayers(const string& solution, c | |
| } | ||
| if(!m_manager.SetupContexts(csolutionFile, activeTarget)) { | ||
| result.message = "Setup of solution contexts failed"; | ||
| ProjMgrLogger::Get().Error(result.message.value()); | ||
| m_manager.CallGenerateCbuildIndex(); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure if .cbuild-idx.yml should be generated here as a side effect.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I did some experiments on this. Previously, I had a working approach where I only appended new messages (errors and warnings) to the existing However, after discussing this with Joachim, he pointed out that the first error message can be misleading. In that case, regenerating the Please let me know what you think about it. We could also create a function to overwrite the messages, instead of appending or regenerating them.
Comment on lines
828
to
+830
|
||
| return result; | ||
|
Comment on lines
+829
to
831
|
||
| } | ||
| m_worker.SetUpCommand(true); | ||
| StrVec layers; | ||
| StrSet fails; | ||
| if(!m_worker.ListLayers(layers, "", fails) || !m_worker.ElaborateVariablesConfigurations()) { | ||
| result.message = "No compatible software layer found. Review required connections of the project"; | ||
| ProjMgrLogger::Get().Error(result.message.value()); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The same as at line 829 |
||
| m_manager.CallGenerateCbuildIndex(); | ||
|
Comment on lines
836
to
+839
|
||
| return result; | ||
|
Comment on lines
+838
to
840
|
||
| } else { | ||
| // retrieve valid configurations | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lines 660-665 are exact copies of the lines 1099-1104
Could you please create a function for that?