<div dir="ltr"><div><div><font size="4"><span style="font-family:arial,helvetica,sans-serif">Hi All,<br><br>I'm working this sprint on <a href="https://github.com/openbmc/openbmc/issues/1772">https://github.com/openbmc/openbmc/issues/1772</a>.<br><br></span></font></div><font size="4"><span style="font-family:arial,helvetica,sans-serif">This story is to fix the CI issued noticed when new application specific error YAML files are added. Fixed this by manually generating </span></font><font size="4"><span style="font-family:arial,helvetica,sans-serif"><font size="4"><span style="font-family:arial,helvetica,sans-serif">elog-errors.hpp for the newly added error YAML file </span></font> by using the parser from phosphor-logging and adding it as part of the application.<br><br></span></font></div><div><font size="4"><span style="font-family:arial,helvetica,sans-serif">Proposal is to use autotools macro to generate the elog-errors.hpp instead of manual process but noticed it solves the problem partially.<br><br>Recently noticed newer problems when applications use both DBUS errors and error from the newly added error yaml file. <br>When </span></font><font size="4"><span style="font-family:arial,helvetica,sans-serif"><font size="4"><span style="font-family:arial,helvetica,sans-serif"><phoshpor-logging/elog-errors.hpp> is included for dbus related errors and <elog-errors.hpp> for newly generated errors and when the code is merged and newly added error comes in as part of </span></font></span></font><font size="4"><span style="font-family:arial,helvetica,sans-serif"><font size="4"><span style="font-family:arial,helvetica,sans-serif"><font size="4"><span style="font-family:arial,helvetica,sans-serif"><font size="4"><span style="font-family:arial,helvetica,sans-serif"><phoshpor-logging/elog-errors.hpp> we run into "</span></font></span></font></span></font></span></font><font size="4"><span style="font-family:arial,helvetica,sans-serif"><font size="4"><span style="font-family:arial,helvetica,sans-serif"><font size="4"><span style="font-family:arial,helvetica,sans-serif"><font size="4"><span style="font-family:arial,helvetica,sans-serif"><font size="4"><span style="font-family:arial,helvetica,sans-serif">error: redefinition" error.<br></span></font></span></font></span></font></span></font></span></font></div><div><font size="4"><span style="font-family:arial,helvetica,sans-serif"><font size="4"><span style="font-family:arial,helvetica,sans-serif"><br></span></font></span></font></div><div><font size="4"><span style="font-family:arial,helvetica,sans-serif">Capturing below my observations in detail<br></span></font></div><div><font size="4"><span style="font-family:arial,helvetica,sans-serif"><br><b>Current approach to fix CI failures noticed for newly added errors</b><br><b>Adding new application error</b><br> *  Generate elog-errors.hpp manually for the newly added error yaml and check-in as part of the repository.<br> *  Include "#include <elog-errors.hpp> in the application code.<br> *  This approach works until the application does not throw any DBUS errors<br>*   Need to have follow up commit to remove "#include <elog-errors.hpp>" and add  "#include <phoshpor-logging/elog-errors.hpp>"<br><br><b>Adding new application error and also use existing dbus errors in the application</b><br></span></font></div><div><font size="4"><span style="font-family:arial,helvetica,sans-serif"> *  Users ran into "error: redefinition" error when manually generated "elog-errors.hpp" for new error yaml file and "phosphor-logging/elog-errors.hpp" for DBUS errors is <br>     included in the same cpp file.<br></span></font></div><div><font size="4"><span style="font-family:arial,helvetica,sans-serif"> *  Below specified approach is followed to overcome the problem <br></span></font></div><div><font size="4"><span style="font-family:arial,helvetica,sans-serif"> *  Copy the "phosphor-logging/elog-errors.hpp" to the app<br> *  Manually generate "elog-errors.hpp" for the newly added error yaml<br> *  Merge contents of "phosphor-logging/elog-errors.hpp" and "elog-errors.hpp" as "elog-errors.hpp".<br> *  Include "<elog-errors.hpp>" as part of the application code<br><br><br><b>Proposed solution</b><br><b>Proposal1 - Fixing the CI issue by timing the commits</b><br> *  Push first only the newly added error yaml file and the native recipe that copies the error yaml first.<br> *  After the above code is merged, generate new SDK which now has the newly added error as part of <phosphor-logging/elog-errors.hpp><br> *  Applications can use newly generated <phosphor-logging/elog-errors.hpp> <br> *  Users can manually / use auto-conf macro to generate elog-errors.hpp and do testing till the error yaml and native recipe are merged and new SDK is built.<br><br><b>Proposal2 - Using autoconf to generate elog-errors.hpp</b><br> *  Place all the error yamls used by the app and newly added error yaml in the app folder<br> *  Use auto-conf macro to generate elog-errors.hpp for all the yaml files placed in the app.<br> *  Use generated "elog-errors.hpp" instead of "<phosphor-logging/elog-errors.hpp>"<br> *  Have a follow-up commit that removes "#include <elog-errors.hpp>"   and add "#include<phosphor-logging/elog-errors.hpp>". <br> *  Remove manually generated "elog-errors.hpp" file.<br><br></span></font></div><font size="4"><span style="font-family:arial,helvetica,sans-serif">There could be other issues relating to inhering of errors from DBUS and errors and e.t.c which need to be addressed.<br></span></font><div><div><div><font size="4"><span style="font-family:arial,helvetica,sans-serif"><br></span></font></div><div><font size="4"><span style="font-family:arial,helvetica,sans-serif">Regards<br></span></font></div><div><font size="4"><span style="font-family:arial,helvetica,sans-serif">Devender<br></span></font></div><div><div><font size="4"><span style="font-family:arial,helvetica,sans-serif"><br></span></font></div></div></div></div></div>