Recent

Author Topic: Designer Unstable (macOS High Sierra) 2.0.0RC3 - Which Version to Use?  (Read 3534 times)

kevin.black

  • Full Member
  • ***
  • Posts: 122
Hi,

I'm new to Lazarus (years ago), now moving from Delphi (10.2.3) with no 64bit macOS Support. I have some general stability issues and particularly the way the designer behaves.
Lazarus 2.0.0RC3
FPC 3.0.4
High Sierra 10.13.6 (Parallels VM)
x86_64 - Cocoa

When I try to use the designer, the form is offset (ie. there is a blank at the top). I need to resize the form very large and back, but resizing often garbles the form. Objects, like buttons, on the form disappear and reappear fairly randomly. If I click a button event (and the code isn't there) instead of getting a blank procedure I'm getting an AV and if there is code there, most of the time Lazarus hanging and I have two force quit. There are other issues that seem to randomly cause the IDE to disappear with me losing the unsaved work to-date. The attached images show the initial form - no buttons visible, the form after enlarging - buttons visible, but top of form still gacked (tech term) and finally the onClick event that, when clicked, causes Lazarus to freeze requiring force quit.

I have reinstalled FPC Source/FPC/Lazarus.

So my question is more Which combination of FPC/Lazarus/Widgetset should I use for best stability? Rather than spending several hours fixing these (probably complicated) issues if that makes sense.

I've been told by member zeljko to use QT5 (not the latest version, but this seems like a bit of ducking around although it's the next cab off the rank) and by member wallaby to use fpcupdeluxe (using say Lazarus 2 Fixes and FPC 3.2 fixes (I tried trunk and that failed after an hour or so, as did some other combinations).

UPDATE: FPCUPDeluxe with FPC 3.2 fixes and lazarus 2 fixes just installed successfully on macOS, I am installing cross-compile for x86_65 Windows.

Look I know lazarus/FPC is free, I have always been amazed at the effort that goes into this product. I also know that macOS is never the most popular development environment (although there is much ado in the Delphi environment WRT macOS development, it's pretty much an afterthought and (almost) nobody knows anything about it - including me), but I need something that is stable enough to actually do some development work without being a full time systems administrator of a macOS VM running Lazarus.

General question (and I have zeljko's advice WRT QT5): For development work (x64 macOS/darwin) what's about the best for stability and fixes?

My options are:
  • 2.0.0RC3
  • Some base version like 2.0.0RC with QT5
  • FPCUPDeluxe, but with what? - as noted I am now trying Lazarus 2 Fixes/FPC3.2 Fixes
  • Something else?

Ideally I'd like it to be easy to maintain and as stable as possible noting that I will be taking Delphi code (Apps and DLLs/DYLIBS VCL and FMX) and trying to convert to x86_64 Darwin?

Thanks for reading.....
« Last Edit: January 18, 2019, 12:29:48 am by kevin.black »

dbannon

  • Hero Member
  • *****
  • Posts: 571
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Designer Unstable (macOS High Sierra) 2.0.0RC3 - Which Version to Use?
« Reply #1 on: January 18, 2019, 02:10:44 am »
Kevin, I assume you are using a cocoa version of the IDE ?  The IDE is a very severe test of Cocoa's progress.

I build a (fixes_2_0) 32bit Carbon IDE and set it to build 64bit Cocoa applications. Its trivial and resulting product is indistinguishable from the one made by a 64bit Cocoa IDE. This may sound like a bit of a cope out but it works for me !

(In practice, I do almost all development on Linux and only really use that Mac 32bit Fixes IDE when chasing a Mac specific issue but I am still sure I don't see any of the issues you mention.)

Probably also worth mentioning that you should consider logging bug reports for the issues you see, not just avoid them (like I do  :-[ ) ....

Davo
Lazarus 1.8, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

kevin.black

  • Full Member
  • ***
  • Posts: 122
Re: Designer Unstable (macOS High Sierra) 2.0.0RC3 - Which Version to Use?
« Reply #2 on: January 19, 2019, 12:31:05 am »
Davo,

Thanks for the reply. No, it is i386-carbon, but that's by accident not design, I have not even thought about building the IDE as either 32 or 64 bit, thanks for the heads-up. I have an FPCUPDeluxe install as well, it is definitely x86-64-darwin-cocoa. The trunk trunk would not build, but fixes 3.2/fixes 2 does. I will reinstall that with i386 carbon if I can.

I omitted to say I used this to anchor the IDE like Delphi:

https://github.com/FlKo/LazarusDockedDesktops#how-to-install

TBF, if I use the IDE NOT anchored, I do not get the same (errant) behaviour when using the form designer. So logically something in the anchoring is what is causing that strange behaviour (I didn't think to test).

WRT reporting bugs, I am loathe to do that at the moment because I don't know if what I am seeing is because of my incompetence, expected behaviour or actually a bug. At least posting to the forum I get experts like you pointing out my shortcomings (in a nice way).

And this is just to give some idea of the sorts of issues I'm experiencing: I am porting over a DYLIB and test code from Delphi. The DYLIB uses TMS FMX Cloud Pack (now TMS LCL Cloud Pack) and they are similar, but not the same (the LCL version was last updated September 2016 so TMS are not interested and they certainly have no interest if I put any of their functions in a DYLIB - what were you thinking?). Anyway TL;DR, when converting the FMX code, changing, trying a build, the Lazarus IDE just goes away, ie. I'm in the middle of something and then nothing. restart the IDE and do a bit more, IDE goes away (I haven't documented exactly what I was doing, I will).

Last but not least (and macOS/carbon/Cocoa not my area of expertise), a couple of environment questions:
1.  Could I develop/build as a i386/Carbon App/DYLIB and then simply rebuild in x86_64/Cocoa when I have said software sort of working, is that viable?
2.  You say you develop on Linux and use only the MAC IDE for mac specific stuff, since OSX is essentially unix/linux, is it feasible to develop on Linux for an OSX app and using the $IFDEF UNIX rather than $IFDEF DARWIN, would the code then port to OSX (other than OSX specific functions)?

Thanks for sticking with me, your advice has given me many things to try.

Kevin

dbannon

  • Hero Member
  • *****
  • Posts: 571
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Designer Unstable (macOS High Sierra) 2.0.0RC3 - Which Version to Use?
« Reply #3 on: January 19, 2019, 03:51:16 am »
OK Kevin, maybe some thoughts ....

I don't use docking so no real help there.

Do I understand you are (forced to) using the FMX LCL that is based on LCL of a couple of years ago ?  Thats almost certainly going to end in tears I'm afraid. The Lazaras Devs have made huge strides with Cocoa LCL in that time, you really want to use the new stuff !

Have your code build 32bit carbon / 64bit cocoa at flick of a switch ? Yes, nominally. Thats what Lazarus is all about. However, in practice, there is, especially with Cocoa at the moment, always a few fine grained "got'ch" you will need to pick up and revise. maybe just doing something differently will work on all platforms, maybe you'll need the occasional $ifdef   But do try it !

Not sure exactly what you mean with second question. Between Linux and Mac, code will always need recompile and cross compiling to a Mac from Linux has proven beyond me at least. Most code just works with a recompile, things like keyboard shortcuts need ifdefs because the Mac uses different keys. A couple of other things ....

When it comes to using ifdef DARWIN or UNIX, its a case by case thing. My code has 14 DARWINs and only two UNIXs but your mileage will most certainly vary !

Davo


Lazarus 1.8, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

kevin.black

  • Full Member
  • ***
  • Posts: 122
Re: Designer Unstable (macOS High Sierra) 2.0.0RC3 - Which Version to Use?
« Reply #4 on: January 20, 2019, 11:37:03 pm »
Hi Davo,

Quote
Do I understand you are (forced to) using the FMX LCL that is based on LCL of a couple of years ago ?  Thats almost certainly going to end in tears I'm afraid. The Lazaras Devs have made huge strides with Cocoa LCL in that time, you really want to use the new stuff !

TMS have a cloud pack (in my case it's for Dropbox) that we have Delphi code for. We have abstracted all of the cloud access functions into a DLL/DYLIB so that other software can access them (ie. C++ objective C etc). The port from FMX to LCL requires those (paid for) libraries. Of course we are not 'forced' to use them, but rewriting that code where we now just make a single call would be daunting. For example, the Oauth2 connection is this code (after I have set some basic properties):

Code: Pascal  [Select]
  1. TFMSDropboxComponent.DoConnect;

That's it. The default browser window pops etc etc. There are but in callbacks fo onConnect, onConnectionrefused, onTokenreceivd etc etc - no coding required on my part. So you can see what I'd be rather loathe to have to code all of this.  Since I have the TMS source, I also use their JSON processing functions because, well, they were there. Maybe the FMX code could be ported. I will ask if there is an update to their LCL codebase.

The last update of the FMX libraries was January 2019. The last update of the FCL libraries was September 2016. Are you suggesting, and I think you are, the likelihood of those libraries working with Cocoa in particular is pretty slim?

Quote
Have your code build 32bit carbon / 64bit cocoa at flick of a switch ? Yes, nominally. Thats what Lazarus is all about. However, in practice, there is, especially with Cocoa at the moment, always a few fine grained "got'ch" you will need to pick up and revise. maybe just doing something differently will work on all platforms, maybe you'll need the occasional $ifdef   But do try it !

OK that's good news. I do not think I'm doing any cocoa specific 'stuff', but I do not know enough to be confident making that statement. As you say, just try it...

Quote
When it comes to using ifdef DARWIN or UNIX, its a case by case thing. My code has 14 DARWINs and only two UNIXs but your mileage will most certainly vary !

Sorry, badly worded. The question was really is Darwin and Unix interchangeable. Clearly not, you have 14 darwin and 2 Unix IFDEFs.

So on a UNIX/Linux system running say UBUBTU will $IFDEF DARWIN code be executed?

and the corollary, on a macOS system running say High Sierra, will $IFDEF UNIX code be executed?

I am unsure when to use. Are they mutually exclusive like $IFDEF DARWIN vs $IFDEF MSWINDOWS?

Thanks again for the reply, although I am somewhat more depressed WRT LCL Cloud Pack. On the plus side I have successfully installed the package (after some degree of stuffing around). I am now trying to run their demos (and as I said, TMS have never tried nor do they have any interest in using their code in a DLL/DYLIB - sad really).

Kevin

dbannon

  • Hero Member
  • *****
  • Posts: 571
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Designer Unstable (macOS High Sierra) 2.0.0RC3 - Which Version to Use?
« Reply #5 on: January 21, 2019, 06:12:00 am »
OK, my guess is that the FMX code has little or no LCL, probably just uses FCL ?

Now, I'm sure someone will correct me but ....
The FPC / Lazarus can be broadly divided into, wait for it, FPC and Lazarus. FPC is closely linked to the FCL and together they are relatively static and stable. On the other hand, Lazarus is closely linked to LCL - that does change a bit more often and, in the case of the Cocoa stream, has gone from "you must be joking" to "looking pretty good mate!" in the time period you are talking about.

Now, are FMX components visible ones ?   Nice if they kept GUI stuff separate from network behavior....   Anyway, my guess is that in 2016, they would have assumed Carbon, quite possible its now just a recompile (and linking to new LCL) - one would hope so anyway.

Defines DARWIN and UNIX are used quite differently. MacOS is UNIX but its sure not LINUX for example. And executing the Darwin binary ?  All the assumed system stuff is different, even the executable format. But Lazarus is "Compile anywhere" !
 

        DARWIN     UNIX   LCLCARBON    LCLCOCOA
Linux      F            T           F                      F
MacOS   T            T          T or F             T or F


I think we'll all be interested in how things work out - hope you'll get somewhere and tell us about it !

Davo

Lazarus 1.8, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

Basile-B

  • Sr. Member
  • ****
  • Posts: 457
    • GH...
Re: Designer Unstable (macOS High Sierra) 2.0.0RC3 - Which Version to Use?
« Reply #6 on: January 21, 2019, 10:26:58 am »
Oh man, use a code block to make a table... or the BBCode balise at least.

dbannon

  • Hero Member
  • *****
  • Posts: 571
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Designer Unstable (macOS High Sierra) 2.0.0RC3 - Which Version to Use?
« Reply #7 on: January 21, 2019, 11:12:34 pm »
Oh, a 4 bit brain, I can only hold 16 markup standards in there at one time.  ;D

Davo
Lazarus 1.8, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

kevin.black

  • Full Member
  • ***
  • Posts: 122
Re: Designer Unstable (macOS High Sierra) 2.0.0RC3 - Which Version to Use?
« Reply #8 on: January 22, 2019, 01:45:58 am »
Davo,

I actually got onto TMS who tell me they are reviewing all of their cloud components including LCL Cloud Pack. It's sort of RSN, but not selling the Brooklyn Bridge (maybe just one of the pylons).

here's what they advise:

Quote
LCL Cloud Pack is mainly a non-UI library, so, LCL / Cocoa changes should not have impact.
We are in the process of a full revision of cloud service access also for Lazarus.
Once the first results are there, we will inform about it.

I cannot comment as to the veracity of the above statement, but at least I have the LCL Cloud Package installed.

Appreciate your insight WRT {$IFDEF... usage.

Thanks again for helping.

Kevin

Thaddy

  • Hero Member
  • *****
  • Posts: 8020
Re: Designer Unstable (macOS High Sierra) 2.0.0RC3 - Which Version to Use?
« Reply #9 on: January 22, 2019, 10:51:02 am »
Oh, a 4 bit brain, I can only hold 16 markup standards in there at one time.  ;D

Davo
If you use 3 bits for thinking and 1 bit for being social you can do unlimited calculations on a 4 bit brain.
« Last Edit: January 22, 2019, 10:53:01 am by Thaddy »
Hamlet 1.4 (nothing wrong with the Danish, btw)