eeschema: ordering of component instance info in file is not consistent
Description
In cases with complex hierarchies and sheet reuse, the instance information for components in the file is not written out in a consistent order. So loading the schematic and writing can change the file even if the page wasn't changed.
The file output should sort the project names, and then sort the instance UUIDs within the project.
I can try to create a minimal repro case but from the looks of sch_io_kicad_sexpr there's no attempt to order things, so maybe the fix is obvious.
Steps to reproduce
- Create a sheet with a part on it
- Instantiate the same sheet in multiple locations in a complex hierarchy
- Repeatedly open the schematic, make a noop edit, save, and observe file differences
- The ordering of the reference info in the instances section for each component may change.
KiCad Version
Application: KiCad Schematic Editor x86_64 on x86_64
Version: 8.0.1-138-ga155dd32e8, release build
Libraries:
wxWidgets 3.2.4
FreeType 2.11.1
HarfBuzz 2.7.4
FontConfig 2.13.1
libcurl/7.81.0 OpenSSL/3.0.2 zlib/1.2.11 brotli/1.0.9 zstd/1.4.8 libidn2/2.3.2 libpsl/0.21.0 (+libidn2/2.3.2) libssh/0.9.6/openssl/zlib nghttp2/1.43.0 librtmp/2.3 OpenLDAP/2.5.17
Platform: Ubuntu 22.04.4 LTS, 64 bit, Little endian, wxGTK, X11, xubuntu, x11
Build Info:
Date: Apr 11 2024 10:25:36
wxWidgets: 3.2.1 (wchar_t,wx containers) GTK+ 3.24
Boost: 1.74.0
OCC: 7.6.3
Curl: 7.81.0
ngspice: 36
Compiler: GCC 11.4.0 with C++ ABI 1016
Build settings: