Page 1 of 1

widget format switched

Posted: Thu Jan 11, 2018 1:42 am
by [-hh]
Developing again widgets today I noticed that after a restart of LiveCode ALL my widgets that were compiled to work with LC 8 (8.1.5 and later) stopped working in LC 8.1.8-community/indy/business, pretending to have the wrong widget format.

Instead they ALL work with LC 9.0.0-dp11-community/indy/business.
I usually store the widget format as a property, so one can see that in the property inspector.
This is not very funny nor has it any advantage because I don't want to develop and work in LC 9.0.0-dp11 from several reasons.

So, what's going on?

MacOS 10.13.2.

Re: widget format switched

Posted: Thu Jan 11, 2018 11:26 am
by bogs
Ouch, that was a lot of stuff you had done :?

Re: widget format switched

Posted: Sat Jan 13, 2018 8:52 pm
by [-hh]
No info about that?

I refuse to call this a "bug" or a "sorry we didn't know of that"-behaviour because LC Builder has a lot of changes from LC 8.1.5 to 9.0.0 (especially with respect to script access).

Hope all others of the "1000 widgets" (K.M.) nevertheless work well with that.

I simply give up, trashed all my LC 9 versions.

Re: widget format switched

Posted: Sat Jan 13, 2018 11:12 pm
by bwmilby
I can’t find it now, but I thought I saw something posted about DP11 compiling widgets from source to ensure compatibility with the current version. That probably would have been fine if they were verified to already be in the 9 series format, but I can understand your frustration.

Knowing this, I need to download everything with an old version and launch DP11 to enjoy your great widgets :wink:

My thought is that widgets need to move to engine specific folders to allow your type of environment.

Re: widget format switched

Posted: Sun Jan 14, 2018 3:38 pm
by bn
Hi Hermann,

i just tested with a relatively simple widget. I compiled and installed using LC 8.1.8.

That widget opened without problem and without recompilation in LC 8.1.5/7 LC 8.1.9 RC1 and also LC 8.2.0 DP2.
The widget was recompiled when I opened LC9 DP 11 and then it was incompatible with the LC 8.x.x series.

What I gather from this is that at least for this widget recompilation did only occur when opening it in LC 9 DPx.

I have sent you a stack that can recompile the widgets in your "extensions" folder to force recompilation using LC 8.x.x.

I also feel it is a pain to have to recompile when switching between LC 8.x.x and LC9. But I see this more as a growing pain of Livecode Builder, they probably did not change the file format without a good reason.

But recompilation where feasible in the curren LC 8.x.x series would be very welcome.

Anyone who would like to have the stack, please send me a private message, I will send it to you. I don't want to post it here because it hacks the IDE and people using it should be knowing what they are doing.

Kind regards

Re: widget format switched

Posted: Sun Jan 14, 2018 4:10 pm
by LCMark
@hh: Apologies for that - it was a well intended change which was aimed to make moving forward to 9 easier... However, as you noticed it has a slightly unfortunate effect if you then continue to work in 8!

I chatted to Ali about this briefly at the end of the week, but didn't get a chance to post. We came up with the idea of using a different filename for the lcm file in extensions for 9 compiled widgets from 8.

8 will likely continue to use module.lcm (nothing is going to change with regards LCB in 8, and keeping this filename means 8 does not need to change).

Then 9 will start to use module.<modver>.lcm - where <modver> is the internal binary format number. This way when 9 starts up, if there is not a machine <modver>.lcm file in the extension and there is source, it can recompile the module for 9. The IDE will then load the appropriate lcm file.

This should solve the issue you encountered *and* mean that widgets that should work in both 8 and 9 will continue to do so side-by-side.

(It also means that multi-version extensions can be distributed - they just need to contain the appropriate lcm files for the versions it supports).

Re: widget format switched

Posted: Sun Jan 14, 2018 10:51 pm
by [-hh]
Thanks for all your answers.

The binary-version-segment (module.<modver>.lcm) will be a promising way to go.

Automatic compilation makes of course only sense for widgets that don't use new features (or don't conflict with changed settings e.g. with respect to script access).

So to avoid such an automatic compilation or even workarounds that force a recompile in previous versions, the best way will be to remove the source code from the lce.

So let us wait for the next LC 9 version. Hopefully this is again as fast with compiling a widget as until dp10. Currently, in dp11, this is 9-11 times slower than before.

Re: widget format switched

Posted: Mon Feb 05, 2018 5:41 pm
by mwieder
I don't see why a filename change is necessary. The .lcm binary file has a signature in the first few bytes that identifies the file type and module version. All that's needed is to examine the version byte to see if it's supported, and recompile if not.

And, of course, a better solution would be to have a single binary format to avoid recompilation.

Re: widget format switched

Posted: Mon Feb 05, 2018 8:32 pm
by bn
here is a stack that helps a bit with the problem of recompiling when switching between LC 8 and LC9 DP11

It hacks the IDE on the fly, not permanently. If you close LC the script is hack gone.

It works both ways, it forces a recompile on LC 8 for LC 9 compiled community widgets and also when working in pre LC 9 DP11.

Lets hope that the hassle with this is soon over.

Kind regards
(2.37 KiB) Downloaded 108 times