TicClick / steel

an osu! chat client
MIT License
5 stars 0 forks source link

Plugin ABI is unstable #37

Closed TicClick closed 10 months ago

TicClick commented 1 year ago

it seems that we need more safeguards around all structures passed to the plugins -- for example, a new setting will crash any plugin hook if it's compiled against the old version, since it expects a different layout

potential leads built on top of libloading:

TicClick commented 1 year ago

for now, I have pinned the toolchain to 1.69.0 (which was the stable around Apr/May) to provide at least a weak resemblance of compatibility for people downloading releases from GitHub 9907aad5e863316fdc6ad6b6cae18afba355da77 b762c2f

TicClick commented 11 months ago

coming back, I question whether the plugin system should exist at all -- looking back, this was a solution for distributing optional functionality without bolting it up for everyone and revealing its internals at the same time. right now, the ABI incompatibility is a blocker for any further work on steel: I can't put out a new version without breaking existing stuff

plugins contain both relevant logic and the UI, which is problematic: while it's possible to put safeguards up around my own code, egui isn't ABI-safe, and I can't wrap stabby or abi_stable around its internals (that simply results in compilation errors, which is very fair). possible solutions:

(oh, and toolchain pinning didn't fully work, at least in v0.6.12 → v.0.6.13 -- as a result of https://github.com/TicClick/steel/pull/45, I was able to produce a build incompatible with at least one plugin)

TicClick commented 10 months ago

I'll go with the plugin removal as a start, and distribute non-public functionality via a GitHub module + releases hosted in a private gist (which is a GitHub repo itself), since I managed to slap together an appropriate migration plan (can't find any glaring holes as of right now, at least)