mlampert wrote: ↑Mon Oct 03, 2022 7:08 am
Anything else I should or can try?
wmayer wrote: ↑Wed Oct 05, 2022 12:30 pm
Well, my idea was to merge the PR and then clean the cache manually. Then committing a new change triggers a rebuild from scratch and creates a new and hopefully valid cache.
OK, finally I had to let all this cool a bit down but now I got it (finally).
There are no link to cache, so you may ignore my previous deductions (sorry for the noise).
Actually, the problem is this line of the CI :
https://github.com/FreeCAD/FreeCAD/blob ... s.yml#L231
It's done to harmonize line-ending. It doesn't modify the code stored in GH, but only the local code of the runner. I guess the goal is that Ccache get the same hash for a file even if one modified the line endings.
Unfortunately, this step has been implemented in a very harmful way :
* It runs on all changed files, whatever type or content it is
* It's very brutal, as it just removes '\r' from the file, even ignoring if it's at the end of a line
As you may have guessed now, the problem is that it did it on the 'test_filenaming.fcstd' file, which is a ZIP (so binary) file that (it happened here) can contain '\r' character for absolutely any reason but meaning a line end.
It so breaks the file structure and obviously prevent FreeCAD to open it.
Last word : why may the same code succeed or fail ?
There is a flaw in the action that is used to determine changed files :
https://github.com/FreeCAD/FreeCAD/blob ... s.yml#L208
Actually it returns files changed by latest commit only.
So in our case, if 'test_filenaming.fcstd' changes were part of the last commit, CI worklow fails. But just add another commit (as I did to disable cache) and there it succeeds.
I'm glad to finally get the root cause and I submitted a minimal PR now that just disable the faulty step (which is absolutely not needed) :
https://github.com/FreeCAD/FreeCAD/pull/7564
I plan to work soon on the CI workflow to make it easier to understand and maintain, and fix different flaws I already saw in it.
EDIT : if you want to see the failure, you can run the linked 'sed' command on the 'test_filenaming.fcstd' file and test yourself.