I wonder if I’m the first to discover this issue since probably not many developers have likely tested installing a new extension over top of an old one on SU2022 M1 Macs.
I was about to release Profile Builder 3.3.0 which is tested and working fine on M1 Macs SU2022.
However, if install the RBZ for 3.3.0 while an older version is currently installed (like the current public version 3.2.2), I get a strange load error after restarting SketchUp 2022. This load error only seems to disappear after I reboot my Mac! After rebooting, PB 3.3.0 loads fine without errors. Below is the load error.
I think this can happen on Windows if a DLL is loaded. Windows will not let it be overwritten.
So, I think the normal scenario of updating extensions with binaries should be to disable the old version from the Extension Manager, restart SketchUp so that the extension’s binaries do not load, and then do the update. We (in the community) have always recommended users restart SketchUp after installing extensions. In this update scenario, the updated extension can be reenabled before the restart if the install did not enable it.
Are you thinking that if something like that can happen on Windows, it might happen on Mac as well?
One other thing to know is that if SketchUp is set to run in Rosetta on an M1 Mac, the problem doesn’t happen. The upgrade of the Intel based code doesn’t cause a problem, but upgrading from Intel to Universal does show a problem if you are running as ARM64.
It wouldn’t surprise me that the Ruby context would need to be fully unloaded and reloaded with 2022, the dylibs and headers are now ‘fat’ for M1 architecture. Dll’s can be side-by-side, I don’t think dylibs can.
To workaround that, we use a staging pattern. The installed dll lives in a ‘stage’ folder and is never directly loaded by our extension. Our Ruby code copies the dll in another folder before loading it.
Therefore a new version can overwrite the old one, but it requires a SketchUp restart to be loaded.
Maybe a similar pattern would work in your case, Dale?