How to Publish Simulink Model Comparisons Without a Display in Linux?
10 次查看(过去 30 天)
显示 更早的评论
When I attempt to publish a simulink model comparison in an Ubuntu CICD pipeline (Gitlab), I receive incomplete .html files in the output folder and the following error message:
"Error using slxmlcomp.SimulinkModelComparison/publish. Printing is not supported in -nodisplay mode."
My .yml file's job uses the command
matlab -batch "mySlxComparisonScript"
to call the visdiff and publish functions:
comparison = visdiff('target.slx', 'source.slx');
publish(comparison, Name='foo', OutputFolder="bar/");
When I run the same batch command on my local Windows machine, the comparison reports are published as expected without errors. This may mean that the publish behavior is different in Linux vs Windows. I cannot find any MathWorks documentation for slxmlcomp objects, SimulinkModelComparison objects, or using the publish command for these objects. Any workarounds, help, or insights are appreciated.
0 个评论
采纳的回答
MathWorks Support Team
2023-5-2
Before R2023a, Simulink requires a display to generate images that show which blocks are modified in the changed models. This is why it is working on your Windows machine but not in your GitLab runner. GitLab runners often do not have displays by default. Two possible options for you to make progress are
1) In R2023a a new setting was introduced to disable generation of model screenshots so that the change report can be generated without a display. See the Simulink release notes here:
2) The display does not need to be a physical display, it can be a virtual one too. You could use a command such as "xvfb-run" on Linux to run the report generation command with a virtual display in your CI/CD Gitlab runner. The following would work:
xvfb-run matlab -batch "generateDiffReports('$1', $2, $3, '$4')"
where "generateDiffReports" is your diff report generation script.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Reporting and Database Access 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!