hneemann / Digital

A digital logic designer and circuit simulator.
GNU General Public License v3.0
4.43k stars 445 forks source link

Propose file version bump for breaking changes #1076

Open sparr opened 1 year ago

sparr commented 1 year ago

Every .dig file appears to contain <version>1</version>.

I recently encountered a problem loading an old circuit, a bunch of wires no longer aligned with embedded circuit pins. I tracked this down to this release note: https://github.com/hneemann/Digital/releases/tag/v0.25

  • The circuits created have a more visible separation of the inputs. [...]
  • Breaking changes:
    • The layout shape uses a slightly different algorithm to determine the pin positions. You may need to adjust usages of embedded circuits that use the layout shape.

My proposal in this issue is that this sort of problem be warned about in the future when loading an old circuit, and detection of that situation caught by bumping the version number of the circuit files when breaking changes are made to the program.

The simplest option would be to just say "This circuit was created with an older version of Digital and may require adjustment. Check the release notes for more information." any time an older version circuit is loaded. A better option would be to include at least some rudimentary detection for various upgrades, so this particular problem would only get a warning if the old circuit being loaded contains embedded circuits using the layout shape.

hneemann commented 1 year ago

I'll have to think about that. So far I use this mechanismuss only to deal with changes that can be corrected automatically without the user having to do anything. If it is not possible to automatically correct a breaking change, the version number will not be increased either. And corrections that require a change in the layout of wires cannot be automatically corrected.