Sharing schematics between projects can change instance data
The fix for issue #11035 (closed) does not address schematics shared between projects. It only addresses schematic files shared in the same project. This can cause file changes to even if the schematic has not been changed. Please note this has been a problem ever since KiCad has supported complex hierarchies.
Description
The schematic file can change when shared between project even when the sheet is not modified. Change the sheet instance data should not change the shared schematic file since the sheet instance data is now stored in the root schematic. The expectation is that the schematic file will not change just by saving another project that shares the schematic when no changes are actually made to the shared schematic.
Steps to reproduce
- Find a schematic file from an existing project to share between projects and make a back up copy of the file with a different name.
- Create a new project and schematic with a sheet that links the schematic above.
- Enter the new sheet and change a reference for a symbol.
- Save the schematic.
- Use a diff tool to compare the copy and the updated schematic files. Notice the change in the symbol reference field.
KiCad Version
Application: KiCad Schematic Editor
Version: (6.99.0-1277-gdd1dbb81f6), debug build
Libraries:
wxWidgets 3.0.5
FreeType 2.11.1
HarfBuzz 2.7.4
FontConfig 2.13.1
libcurl/7.81.0 GnuTLS/3.7.3 zlib/1.2.11 brotli/1.0.9 zstd/1.4.8 libidn2/2.3.2 libpsl/0.21.0 (+libidn2/2.3.0) libssh2/1.10.0 nghttp2/1.43.0 librtmp/2.3 OpenLDAP/2.4.59
Platform: Linux 5.16.0-3-amd64 x86_64, 64 bit, Little endian, wxGTK, gnome, wayland
Build Info:
Date: Mar 11 2022 12:37:40
wxWidgets: 3.0.5 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.24
Boost: 1.74.0
OCC: 7.5.1
Curl: 7.81.0
ngspice: 34
Compiler: GCC 11.2.0 with C++ ABI 1016
Build settings:
KICAD_USE_OCC=ON
KICAD_SPICE=ON
KICAD_STDLIB_DEBUG=OFF
KICAD_STDLIB_LIGHT_DEBUG=OFF
KICAD_SANITIZE_ADDRESS=OFF
KICAD_SANITIZE_THREADS=OFF