Lazarus

Programming => Operating Systems => macOS / Mac OS X => Topic started by: Frank on January 03, 2018, 09:07:29 pm

Title: macOS & 64bit
Post by: Frank on January 03, 2018, 09:07:29 pm
Hi All,
  I was codesigning a project, when Xcode gave me this warning :

"macOS High Sierra is the last version of macOS that will run 32-bit apps without compromise. It is strongly recommended that apps support 64-bit as soon as possible. The Mac App Store will require new apps to include 64-bit support by January 2018 and for all apps (including updates) to be exclusively 64-bit by June 2018."

Does this mean the end to Lazarus/carbon ?
Title: Re: macOS & 64bit
Post by: Phil on January 03, 2018, 09:15:18 pm
Does this mean the end to Lazarus/carbon ?

Yes for Mac App Store apps, maybe for post High Sierra - we don't know whether Carbon will be dropped.

Here's Apple's announcement from last summer:

https://developer.apple.com/news/?id=06282017a

This will affect very few developers since most have been on 64-bit Cocoa for many years. Only Lazarus is affected.

You could test your app against the Cocoa widgetset code in SVN and report any errors in the Bugtracker system at left. Dmitry is fixing things at a rapid pace.
Title: Re: macOS & 64bit
Post by: Frank on January 03, 2018, 09:24:29 pm
@Phil Once again, thanks. I've tinkered with Cocoa, but relied on carbon... Cocoa it is...
Title: Re: macOS & 64bit
Post by: Phil on January 03, 2018, 09:26:17 pm
@Phil Once again, thanks. I've tinkered with Cocoa, but relied on carbon... Cocoa it is...

You might find these instructions handy:

https://macpgmr.github.io/MacXPlatform/UsingCocoaFromTrunk.html

You can skip steps 4-6 if you don't use TWebBrowser.

If you have packages that you added to your Carbon IDE and rebuilt the IDE, you can compile them as in step 4 - you only need to compile them with the SVN lazbuild, you don't need to install them in the Cocoa IDE.
Title: Re: macOS & 64bit
Post by: jwdietrich on January 03, 2018, 09:49:06 pm
This is an important topic. Let's push the Cocoa widgetset...
Title: Re: macOS & 64bit
Post by: Frank on January 03, 2018, 09:51:52 pm
@Phil
  I had a quick look at the web page, I already use 1.9svn trunk with alternate install.

  And it should be fun ;)

  Thanks !
Title: Re: macOS & 64bit
Post by: jwdietrich on January 03, 2018, 10:10:29 pm
Sphere 10 offers a bounty of USD $3000 for a completed implementation of the Cocoa widgetset. See http://wiki.lazarus.freepascal.org/Bounties#Cocoa_bounties for details.
Title: Re: macOS & 64bit
Post by: Frank on January 03, 2018, 11:12:56 pm
  Followed instructions, all went well. My 2 Delphi 10.2 FMX programs are now running 64-bit Cocoa Lazarus/FPC.
  I (as of yet) only see one issue, the ListView does not allow selection of an item (Bug tracker #0032011).

  And yes, 64-bit Cocoa Lazarus, while I did use it to compile/run the programs, does need some fine tuning. Do I report the IDE issues the same as component/widgetset ones ?
Title: Re: macOS & 64bit
Post by: Phil on January 03, 2018, 11:32:14 pm
And yes, 64-bit Cocoa Lazarus, while I did use it to compile/run the programs, does need some fine tuning. Do I report the IDE issues the same as component/widgetset ones ?

It might be useful to isolate IDE bugs into small projects that illustrate the bug with the relevant control used in the IDE. Once all the widgetset bugs have been fixed, the IDE should, in theory, just work. (Although you probably know the expression: "In theory, reality is the same as theory; but in reality, it ain't.")

Title: Re: macOS & 64bit
Post by: Josh on January 29, 2018, 09:01:53 am
Just downloaded latest Trunk of Lazarus Cocoa.

Issues after 30 minutes of testing.

IDE Issues
after fresh install onto new partition, starting lazarus (startlazarus) getting arithmetic error message. neeed to rebuild/clean lazarus to stop this error.

I think Lazarus should start wit the Messages, Object Inspector and Source Editor Windows visible as default, at the moment when I started for first time, just the Main Menu and Component Menu Bar are visible.

When you choose to rebuild lazarus either from options menu  or after installing a package manually or via OPM; lazarus does not restart after the rebuild. Starting lazarus from startlazarus shortcut.

OPM screen does not always come to front, and the Icons to install, update etc do not appear, if you stretch OPM screen the icons appear above where they should be and you can use this as a reference to where the non visible control is by clicking the blank are underneath.

Various windows and dialogs do not  always come to front, so the IDE looks non responsive ( as they appear underneath form/source editor, which are then inactive because the modal dialog is active but underneath another visible form).

Various dialogs where you have options for Okay, Cancel the buttons are visible but not active; you need to use the dialig close button to abort.

The Show Form command does not always work, switching between various projects units that have forms, the show form command is not highlighted and the shortcut does not work either, closing the unit source file and re-openeing generaly corrects this, but then after switcing between various units again the form will not be availabe again to be shown.

Tried to use KControls component, this compiles and installs, but if you place various components on form ( ie Kgrid) you get error graphics resource cannot be loaded.

Took 3 attempts to install BGRABitmap, this failed in OPM, but managed to finally install it after 3rd attempt of manual installl of package ussing the repositry entry created by OPM.

On screen default font visibly much smaller than previous version tested 3 months ago. on 32 inch sceen (1920x1080) readable, on 21 inch screen (1920x1080) too small to read. Carbon version of latest trunk, font visible size is OK.

Unable to move the Main Component Menu Bar underneath the Lazarus Main Menu, there is a gap of about 40/50 pixels.

Hopefully the above issues/findings are not too big, the KControls issue would be a nice one to fix but as its a 3rd party component it might not be so easy.

So far the progress from when I tested a few months back, is amazaing and it is developing nicely and at a fast pace, well done to the developer(s).

 
Title: Re: macOS & 64bit
Post by: MISV on January 29, 2018, 04:40:46 pm
I just tried Trunk as well using fpcdeluxe (thanks!) Can you recompile IDE to carbon? I wanted to use IDE in carbon but try compile my code in Coca

When I try - I get error
Quote
carbonproc.pp(563,13) Error: Identifier not found "ATSUFindFontFromName"

Anyhow - beyond that - I think IDE looks great in Coca - last outstanding issues solved and everything is good to go it seems to me :)


Title: Re: macOS & 64bit
Post by: esvignolo on January 29, 2018, 05:20:32 pm
I MISV, can u send a couple of screenshots?

Thanks!

I just tried Trunk as well using fpcdeluxe (thanks!) Can you recompile IDE to carbon? I wanted to use IDE in carbon but try compile my code in Coca

When I try - I get error
Quote
carbonproc.pp(563,13) Error: Identifier not found "ATSUFindFontFromName"

Anyhow - beyond that - I think IDE looks great in Coca - last outstanding issues solved and everything is good to go it seems to me :)
Title: Re: macOS & 64bit
Post by: skalogryz on January 29, 2018, 05:48:16 pm
When I try - I get error
Quote
carbonproc.pp(563,13) Error: Identifier not found "ATSUFindFontFromName"

http://wiki.freepascal.org/Cocoa_Interface#Compiling

http://wiki.freepascal.org/Carbon_Interface#Error_ATSUFindFontFromName
Title: Re: macOS & 64bit
Post by: MISV on January 30, 2018, 01:10:55 pm
When I try - I get error
Quote
carbonproc.pp(563,13) Error: Identifier not found "ATSUFindFontFromName"

http://wiki.freepascal.org/Cocoa_Interface#Compiling

http://wiki.freepascal.org/Carbon_Interface#Error_ATSUFindFontFromName

Thank you - that solved that (carbon+darwin+i386) albeit I know get

Quote
"Fatal: Cannot find system used by fcllaz of package FCL."

I will try research hat error and report back
Title: Re: macOS & 64bit
Post by: Josh on January 30, 2018, 01:32:56 pm
Hi

Try a rescan of sources, this may fix it. ( Tools -> Rescan FPC Source Directory )
If issue is with IDE try a Clean Build. ( Tools -> Configure Build lazarus, in window that pops up make sure no 'Odd' settings  are set and tick the option Clean All.

Make sure your project options match the CPU and Wdgetset used,   carbon = i386, cocoa =X86-64.

Just some ideas
Title: Re: macOS & 64bit
Post by: MISV on February 02, 2018, 05:18:51 pm
Hi

Try a rescan of sources, this may fix it. ( Tools -> Rescan FPC Source Directory )
If issue is with IDE try a Clean Build. ( Tools -> Configure Build lazarus, in window that pops up make sure no 'Odd' settings  are set and tick the option Clean All.

Make sure your project options match the CPU and Wdgetset used,   carbon = i386, cocoa =X86-64.

Just some ideas


Did not work - but I will now try download fpcdeluxe with carbon - and hope it includes cocoa as well for when building apps.
Title: Re: macOS & 64bit
Post by: MISV on February 04, 2018, 02:07:50 am
This kinda worked. Can compile all packages and my software with Cocoa on Lazarus - but debugger not working and I get an access violation on startup, so can't see my program running on Cocoa but still an improvement :)

The debugger error I am getting is

Quote
"Ooops, the debugger entered the error state"
...
Quote
Could not send a command to GDB

I have checked and offhand FPCdeluxe seems to have duplicatted he same GDB/debugger settings as I have been using for version 1.8

GNU debugger (gdb)
/usr/local/bind/gdb

Could it be a 32bit/64bit issues? I usually compiled 32bit/carbon/1.8 but cocoa is always 64bit right?
Title: Re: macOS & 64bit
Post by: skalogryz on February 04, 2018, 02:19:34 am
Please provide a backtrace of the access violation

http://wiki.freepascal.org/Creating_a_Backtrace_with_lldb
Title: Re: macOS & 64bit
Post by: MISV on February 04, 2018, 02:31:34 am
Please provide a backtrace of the access violation

http://wiki.freepascal.org/Creating_a_Backtrace_with_lldb

Will look into now - thanks - seems to be a problem triggered in own code somehow. Until I get GDB working this will be of great help. Thanks
Title: Re: macOS & 64bit
Post by: dieselnutjob on October 07, 2018, 05:32:56 pm
I found that if I write a program that changes button height as in button1.height:=button1.heignt+1; that if I use the "normal" Lazarus with LCLWidgetType:=Cocoa then the height of the button increases as I would expect.

When I compile with/Applications/Utilities/laz-svn/lazbuild --pcp=~/.laz-svn --ws=cocoa --compiler=/usr/local/bin/ppcx64 --cpu=x86_64 project1.lpi. the button doesn't change height but instead moves down.

It seems that with the 64 bit one that button1.height actually manipulates button1.top

The weird thing is that if I do the same with memo1.height then it does correctly change the height.

So the problem is tbutton but not tmemo but only 64 bit.

I'm not sure how to report this.

thanks DNJ
Title: Re: macOS & 64bit
Post by: skalogryz on October 07, 2018, 07:14:59 pm
What's happening is that Cocoa buttons just stick to the "PushButton" style.
However, since the actual button rectangle is changed anyway, Cocoa draws the button "vertically" aligned to the center of the rectangle.
That's why it seems as if the button is moving down.

(IIRC, on Carbon, if button is greater than certain size, it would change its style from "push" to "square". This will allow the button to grow).

Title: Re: macOS & 64bit
Post by: dieselnutjob on October 08, 2018, 12:49:14 pm
Thank you for this.  I am away from my Mac for a few days but this page http://wiki.lazarus.freepascal.org/Cocoa_Internals/Buttons (http://wiki.lazarus.freepascal.org/Cocoa_Internals/Buttons) confirms what you say.

This page https://mackuba.eu/2014/10/06/a-guide-to-nsbutton-styles/ (https://mackuba.eu/2014/10/06/a-guide-to-nsbutton-styles/) suggests that Cocoa has a "Square Button / NSShadowlessSquareBezelStyle (variable height)" option.  Is there a way to change a Tbutton to use that style?
TinyPortal © 2005-2018