Recent

Author Topic: Darwin x86_64, Cannot Find Units (Indy 10 ) AND More Generally  (Read 2578 times)

kevin.black

  • Full Member
  • ***
  • Posts: 122
Darwin x86_64, Cannot Find Units (Indy 10 ) AND More Generally
« on: February 12, 2019, 12:34:44 am »
I'm trying to use a simple REST client posted by another forum member in a library (macOS DYLIB). The REST client uses INDY. The problem is that when I try to build my project using that UNIT, some of the INDY units are found and some are not. It's a sort of crap shoot. This is not a new issue. There are a number of earlier posts that reference the issue, here are just a couple (the second one is about case sensitivity noting the unit file I'm using came as-is, ie the INDY units were already there AND I have double checked the name/case).

http://forum.lazarus-ide.org/index.php/topic,20782.msg178791.html#msg178791
http://forum.lazarus-ide.org/index.php/topic,43611.msg305576.html#msg305576

I have similar issues with other code/packages that use Indy (Indy is very widely used so it would be a good idea to have it function correctly). I have added, as one poster suggests, IdHTTP (one of the missing? units) to the IndyLaz package and (successfully) rebuilt (see attachment), did not fix - same error. I have tried to add IndyLaz to the project requirements, but when I right-click Add, the indylaz package is shown as ONLINE even though it has been installed. The only option I then have is to INSTALL the package which, if I press takes me to a blank screen - so I cannot add the package in the project's dependencies. FWIW, I can add any GREEN, ie. local, package, but whenever I select an ONLINE package (whether it is actually installed or not) I get taken to the BLANK install screen, see second attachment.

I have done as those suggest, added to the IndyLaz package, put the various paths in the project options all to no avail.

So with the caveat - noob, I cannot seem to use Indy even though it is installed and local because various units cannot be found. I cannot add the indy package as a project requirement because Lazarus thinks it isn't installed and is ONLINE, and none of the other remediations seem to work. As noted, it's frustrating, IndyLaz is installed, I can access the components from the component toolbar etc. Does anyone have any suggestions about how I might Use/install Indy10 that actually works without going through these sorts of conniptions every time I try to use it???

Again, thanks for reading.

Kevin

« Last Edit: February 12, 2019, 05:08:18 am by kevin.black »

kcandrews

  • New member
  • *
  • Posts: 42
Re: Indy 10 (IndyLaz), Darwin x86_64, Cannot Find Units
« Reply #1 on: February 12, 2019, 01:26:32 am »
FWIW, I ran into the online vs local package problem yesterday as I was starting a little test project.   Anyway, the latest version of the Project inspector (not sure if this is using "fixes" after 2.0.0) is quite confused about what packages are installed into Lazarus and so makes it impossible to add a New Requirement (dependency) for a particular project without getting it "online" (a new option to me!).  The steps of adding it as a package to Lazarus didn't work out well for the project dependency since even after a lazarus rebuild, the package still didn't show to be local (even though it was). 

More generally, not remembering exactly where I located it but a few months ago I located and downloaded the 10_5491 version (fairly recent release).  I placed the unzipped folder into the lazarus/components directory, naming it Indy10_5491. Then I did a Lazarus/File Open of the lazarus/components/Indy10_5491/Lib/indylaz.lpk package.  It loaded as expected as a package which I then compiled and then installed, causing a rebuild of Lazarus.  I ran into no errors, naming issues, or problems doing this as I had with earlier versions of Indy (even earlier Indy 10's). 

So this only partially addresses what you have raised.  But if you do locate Indy10.5491 and install it as a package, that should go smoother than what you ran into.  (You might Private Message Remy Lebeau since, he is on the laz forum and knows Indy and its development very well.)

Previous laz versions didn't show a local vs. online package option for Project Requirements so you might have to revert to an earlier one to have Indy or any other package be a dependency in a particular project.

I'm currently using Mac OSX 10.14.3 Mojave and Lazarus 64 bit Cocoa for the IDE and projects I have developed over many years (having migrated from Delphi five or six years ago).  And FWIW trying to aid Martin in his new lldb project to make debugging work on OSX without needing gdb (not supported by Apple any more and requiring gdb codesigning, finding a gdb version that works, need to mess with csrutil (System Integrity Protection) and other headaches).  See this thread if interested in debugging on OSX:  http://forum.lazarus-ide.org/index.php/topic,42869.msg310923.html#msg310923
« Last Edit: February 12, 2019, 01:43:25 am by kcandrews »

kevin.black

  • Full Member
  • ***
  • Posts: 122
Re: Indy 10 (IndyLaz), Darwin x86_64, Cannot Find Units
« Reply #2 on: February 12, 2019, 02:45:32 am »
@kcandrews Thanks for the reply. I can only agree with your comments WRT lazarus's confusion over which packages were/are installed. Prior to your response I removed all of Indy10 and installed from the online package manager. It did this (I think I did it twice) for version 10.6.2.5494 successfully. When I looked at Install/uninstall Packages it was included twice marked for install. I delete one and rebuilt the IDE. This actually worked, so after a morning of no joy, I now have Indy10 installed (again) and components now shows (again) all of the indy components.

If I try to set IndyLaz as a requirement, it is still showing as being online and wants me to install (the very installed) package. If I click install I get the blank install packages screen referenced before. I tried to build my app with the call to IdHTTP, and get exactly the same error as with the previous version of Indy. So I have now resorted to, for example:

Code: Pascal  [Select]
  1. IdHttp in  '/Users/kevin/fpcupdeluxe/fixes/config_lazarus/onlinepackagemanager/packages/Indy10/Protocols/IdHTTP.pas',  

And have added several more Indy paths in particular:
Code: Pascal  [Select]
  1. fpcupdeluxe/fixes/config_lazarus/onlinepackagemanager/packages/Indy10/Core
  2. fpcupdeluxe/fixes/config_lazarus/onlinepackagemanager/packages/Indy10/System

And with that hack, I now get the application to fail elsewhere, ie. the cannot find 'insertIndyUnitHere' errors are gone.

Quote
I'm currently using Mac OSX 10.14.3 Mojave and Lazarus 64 bit Cocoa for the IDE and projects I have developed over many years (having migrated from Delphi five or six years ago).  And FWIW trying to aid Martin in his new lldb project to make debugging work on OSX without needing gdb (not supported by Apple any more and requiring gdb codesigning, finding a gdb version that works, need to mess with csrutil (System Integrity Protection) and other headaches).  See this thread if interested in debugging on OSX:  http://forum.lazarus-ide.org/index.php/topic,42869.msg310923.html#msg310923

Look, I have nowhere near the competence/skills that you and the other Lazarus developers have, BUT I am very interested in debugging in OSX (which I find so far to be very lacking). I came from Delphi, only 32 bit apps, a lot of BS on their website about deploying to and debugging in OSX, and a lot of excuses about why you can just 32 bit your way through development. FMX is buggy and doesn't do 64 bit, I'm being pressured to get macOS 64 bit DYLIBs functioning. Others in the team are rewriting them in SWIFT. I'm looking at cross compiling, ie. multi platform which was why Delphi in the first place. Lazarus is looking like a very good alternative for me (but the soft option was just to use FMX working in Windows and make work in OSX - no 64 bit is a deal breaker, my guys don't want to even talk about 32 bit OSX).

TLl;DR yes, interested in OSX Debugging.

And along the same vein, I'm trying to use Laz_synapse which I have in project requirements. It seems now that Interfaces is missing, it wasn't before. Regardless I'm being told to put LCL in the requirements for the project. BUT again, LCL and LCL Base are shown as not installed, and an online package. Of course when I try and install I get the blank screen again. Viewing the packages using Install/Uninstall packages I see LCL and LCL Base are installed and not removable. This is sort of a real catch 22, you cannot install the packages because they are already installed and yet you cannot use the packages because they are not installed according to the online package manager.

Other related question, what does project requirements use the online package manager at all?

Yours in frustration,
Kevin
« Last Edit: February 12, 2019, 04:29:24 am by kevin.black »

kevin.black

  • Full Member
  • ***
  • Posts: 122
Re: Darwin x86_64, Cannot Find Units (Indy 10 ) AND More Generally
« Reply #3 on: February 12, 2019, 05:21:30 am »
I've updated the Subject to be more inclusive (or should that be exclusive), anyway it's a bigger than Indy Issue.

I am now using the Laz_synapse package. And this is what is frustrating:

Firstly units that were found previously, like Interfaces, LCLType, LMessages, Forms are now no longer found yet units like Dialogs and strUtils are? WTF....

I am now getting errors with these types, note that UNIT fpopenssl is included in the uses clause:
Code: Pascal  [Select]
  1. uses
  2.   Classes,
  3.   SysUtils,
  4.   sockets,
  5.   ssockets,
  6.   openssl,
  7.   fpopenssl;    // THIS UNIT IS INCLUDED
  8.    ...
  9.     SNIP
  10.    ...
  11.     FSSLType: TSSLType;     <<<<=======  IDENTIFIER NOT FOUND
  12.     FKeyPassword: string;
  13.     FUsername: string;
  14.     FPassword: string;
  15.     FCertData : Array[0..4] of TSSLData;    <<<<=======  IDENTIFIER NOT FOUND
  16.     FSSL: TSSL;   <<<<=======  IDENTIFIER NOT FOUND
  17.     FCTX : TSSLContext;   <<<<=======  IDENTIFIER NOT FOUND
 

NOW, I look in UNIT fpopenssl and lo and behold:
Code: Pascal  [Select]
  1. uses
  2.   Classes, SysUtils, openssl, ctypes;
  3. Type
  4.   TSSLType = (stAny,stSSLv2,stSSLv3,stTLSv1,stTLSv1_1,stTLSv1_2);   <<<<===== aaarrrgggghhhhh!!!!!!!!!!!!

I just cannot seem to take a trick. Lazarus isn't capable of making even the simplest connection and it should. I am spending huge chunks of time fixing? things that should 'just' work. I am happy to accept some of the blame, but this is getting quite ridiculous, as soon as I get something fixed (that shouldn't be broken) then something else that wasn't broken suddenly is.

Dos anyone have any idea why this, for example, is happening.

GetMem

  • Hero Member
  • *****
  • Posts: 3467
Re: Darwin x86_64, Cannot Find Units (Indy 10 ) AND More Generally
« Reply #4 on: February 12, 2019, 06:24:26 am »
Hi Kevin,

Cocoa has improved a lot lately, but is still beta. Yes you can build a working IDE with fpupdeluxe, but it's not gonna be a smood ride,  defenetly not for beginners. I don't want to discourage you, but the vast majority of the packages does not support cocoa yet.  Back to your issues with OPM, it looks like you found a bug. I will try to fix it as soon as possible, until then you can uninstall OPM, it's just a regular package. However the issue with the packages seems to be more deeply rooted. I will run a few tests later.
« Last Edit: February 12, 2019, 07:13:51 am by GetMem »

kcandrews

  • New member
  • *
  • Posts: 42
Re: Darwin x86_64, Cannot Find Units (Indy 10 ) AND More Generally
« Reply #5 on: February 12, 2019, 06:39:26 pm »
Hi Kevin,

I concur with GetMem that using the NEW fpupdeluxe is geared for people aware of all the complications involved in upgrading/improving Lazarus.  This would be most handy for Lazarus IDE/component developers but far from ideal for the bulk of us Lazarus users IMO.  I have installed fpupdeluxe.  BUT for working with my own projects in a stable environment, I far prefer the standard Lazarus download setup.

IMHO, you should do the standard download of the last major releases of laz version 2.0.0 (or even 1.8.4 if problems with 2.0.0) and fpc 3.0.4a, installing the related .dmg files:
https://www.lazarus-ide.org/index.php?page=downloads

That way you can focus on your own projects and not get encumbered with "latest/greatest" but "bleeding edge" issues with Lazarus.  Lazarus is a great environment IF you work with a stable tested release.  Otherwise, you'll spend most of your time finding bugs for issues others may still be working on.  Such is the nature of open source development -- not much top down management.  In this situation, you can easily access problematic code which isn't well tested and certainly isn't considered stable or releasable.

[Also uninstall the online package manager package as GetMem suggests.  For me, it doesn't appear to be ready for prime time, at least on my OSX Mojave.]

For me, proof of my argument are problems arising from mixing in even the latest "fixes" to the 2.0.0 release.  And do be aware that Mac OSX users appear to be a small part of the Lazarus user base -- so retrieving post major release code risks even more untested possiblities, likely distracting a programmer from his/her own project issues.

Just an opinion :-)
« Last Edit: February 12, 2019, 07:24:22 pm by kcandrews »

kevin.black

  • Full Member
  • ***
  • Posts: 122
Re: Darwin x86_64, Cannot Find Units (Indy 10 ) AND More Generally
« Reply #6 on: February 12, 2019, 11:09:18 pm »
@GetMem,
Cocoa has improved a lot lately, but is still beta. Yes you can build a working IDE with fpupdeluxe, but it's not gonna be a smood ride,  defenetly not for beginners.
So I believe, having said that I have bothe the Fixes3.2/Fixes2.0 from FPCupdeluxe and the standard 2.0.0RC3 install (with whatever version of FPC that came with and I get the same issues errors in both.

Back to your issues with OPM, it looks like you found a bug. I will try to fix it as soon as possible, until then you can uninstall OPM, it's just a regular package. However the issue with the packages seems to be more deeply rooted. I will run a few tests later.
Thanks, and don't get me wrong, I don't want to be a nay-sayer, what you guys have done is nothing short of a miracle, but I'm a Delphi guy (actually started Delphi went to Lazarus then Delphi and now back to Lazarus) and Delphi doesn't do Darwin x64 which I need. I'm dealing with guys doing x64 Swift stuff and I need to convert Windows Delphi DLLs to x64 DYLIBs so they can use them. Not your problem, but gives my dilemma some context.

Cheers,
Kevin

kevin.black

  • Full Member
  • ***
  • Posts: 122
Re: Darwin x86_64, Cannot Find Units (Indy 10 ) AND More Generally
« Reply #7 on: February 12, 2019, 11:23:55 pm »
@kcandrews
have installed fpupdeluxe.  BUT for working with my own projects in a stable environment, I far prefer the standard Lazarus download setup.

IMHO, you should do the standard download of the last major releases of laz version 2.0.0 (or even 1.8.4 if problems with 2.0.0) and fpc 3.0.4a, installing the related .dmg files:
https://www.lazarus-ide.org/index.php?page=downloads

In this situation, you can easily access problematic code which isn't well tested and certainly isn't considered stable or releasable.
Agreed, and I do have co-installed 2.0.0.RC3 from the single installation package with whatever version of FPC that came with. As noted I'm getting the same issues.

[Also uninstall the online package manager package as GetMem suggests.  For me, it doesn't appear to be ready for prime time, at least on my OSX Mojave.]
Yes, installing packages (when they work) is great, but getting in the way of say adding requirements is a PITA so I will uninstall it. The actual concept is great BTW, so if it were working it would be very useful.

And do be aware that Mac OSX users appear to be a small part of the Lazarus user base -- so retrieving post major release code risks even more untested possibilities, likely distracting a programmer from his/her own project issues.
I get it, but the attraction of code once/compile anywhere is why I'm here. We have a small product to release into the wild, but wanted both a Windows and macOS version. Windows has been done and dusted for sometime, macOS is the rate limiter. To do a Delphi -> macOS conversion would be simpler with FMX, but who knows when Embarcadero will produce an x64 Darwin compiler? Lazarus was almost too good to be true, but not without it's issues. I will persevere, because I think there is considerable merit.

Just an opinion :-)
Look, it's feedback like yours that keeps me marginally sane. We essentially agree (and same as getmem has said) and, if several 'reasonable' people arrive at the same or similar conclusion it's probably right so it gives me confidence that I'm heading in the right direction. My problem is that I am a Lazarus noob so the learning curve (especially where others take it for granted) is significant. Uninstalling OPM I would not have thought to do, but it is blindingly obvious thing to do. Anyway, thanks for responding (again)...

Cheers,
Kevin

kevin.black

  • Full Member
  • ***
  • Posts: 122
Re: Darwin x86_64, Cannot Find Units (Indy 10 ) AND More Generally
« Reply #8 on: February 13, 2019, 09:34:02 am »
And another for instance:

I have removed OPM. Now when I try to add a requirement, LCL and LCL Base NOT found (they are both installed), yet the LUIComponents/TMSLCLCloudLazarusPkg Components are found (they are definitely uninstalled). Whatever generates the installed / uninstalled package list is completely screwed up.

Did a clean up and Build All, this was successful, but it did not change the list of available packages in the Project manager Add a requirement. Note that the packages displayed in Install/Uninstall Packages is correct. So wherever it gets the package list from is NOT where the Add Requirement option gets the package list from.

Is there some way to delete/regenerate this package list or sync it with the install/uninstall package list? It isn't just broken in OPM it is broken in the simple add a requirement (see attached image)?

Kevin
« Last Edit: February 13, 2019, 09:46:38 am by kevin.black »

GetMem

  • Hero Member
  • *****
  • Posts: 3467
Re: Darwin x86_64, Cannot Find Units (Indy 10 ) AND More Generally
« Reply #9 on: February 13, 2019, 10:13:12 am »
Quote
Now when I try to add a requirement, LCL and LCL Base NOT found (they are both installed), yet the LUIComponents/TMSLCLCloudLazarusPkg Components are found (they are definitely uninstalled). Whatever generates the installed / uninstalled package list is completely screwed up.
Once you open/complie a package the IDE will remember it. You can either delete the package folder or delete the package link(see "Package links" dialog). As a conclusion I'm not surpised by the presence of Lui packages, the more interesting stuff is why LCL and LCLBase are not available.

Quote
Is there some way to delete/regenerate this package list or sync it with the install/uninstall package list? It isn't just broken in OPM it is broken in the simple add a requirement (see attached image)?
1. Delete the config folder. Usually you can find it inside the fpcupdeluxe folder("config_lazarus"). Feel free to make a backup first.
2. Open a terminal, go to the Lazrus folder, then: "make bigide"
3. Uninstall OPM again

PS: Not related to your question, but in my opinion a better approach for you would be the following combination : Lazarus trunk with FPC 3.0.4(or 3.2.0 fixes)
« Last Edit: February 13, 2019, 07:48:33 pm by GetMem »

kevin.black

  • Full Member
  • ***
  • Posts: 122
Re: Darwin x86_64, Cannot Find Units (Indy 10 ) AND More Generally
« Reply #10 on: February 13, 2019, 11:06:29 pm »
@getmem,

Again, thanks for the advice I will follow through and I will take your advice WRT installing Lazarus Trunk / FPC 3.2 Fixes.

I will; update once I have tried the options you suggest (hopefully with some 'good' news ::)

That failed and I have done a search on my macOS VM and no file called crt1.10.5.o. I will start from scratch with a build of Lazarus Trunk / FPC 3.2 Fixes as you suggest:
Code: Pascal  [Select]
  1. Target OS: Darwin for x86_64
  2. Compiling lazres.pp
  3. Assembling (pipe) ./lazres.s
  4. Linking ./lazres
  5. ld: file not found: /usr/lib/crt1.10.5.o
  6. An error occurred while linking
  7. lazres.pp(395) Error: Error while linking
  8. lazres.pp(395) Fatal: There were 1 errors compiling module, stopping
  9. Fatal: Compilation aborted
  10. make[2]: *** [lazres] Error 1
  11. make[1]: *** [all] Error 2
  12. make: *** [lazbuild] Error 2
  13. Lindeman:lazarus kevin$

Kevin
« Last Edit: February 13, 2019, 11:17:23 pm by kevin.black »

Remy Lebeau

  • Hero Member
  • *****
  • Posts: 626
    • Lebeau Software
Re: Darwin x86_64, Cannot Find Units (Indy 10 ) AND More Generally
« Reply #11 on: February 13, 2019, 11:29:40 pm »
Delphi doesn't do Darwin x64 which I need.

FYI, support for OSX 64bit is scheduled for release later this year in Delphi 10.3.x.
Remy Lebeau
Lebeau Software - Owner, Developer
Internet Direct (Indy) - Admin, Developer (Support forum)

kcandrews

  • New member
  • *
  • Posts: 42
Re: Darwin x86_64, Cannot Find Units (Indy 10 ) AND More Generally
« Reply #12 on: February 14, 2019, 12:06:39 am »
Kevin,
IMO you should install FPC 3.04a (an FPC installation altered to deal with the path to the missing /usr/lib/crt1.10.5.o file -- ONLY a problem in latest OSX).
See: https://forum.lazarus.freepascal.org/index.php/topic,42657.msg310592.html#msg310592
and read the earlier portion of that thread to understand the issue -- especially if you decide to install a different version of FPC.

FPC 3.04a download location: https://sourceforge.net/projects/freepascal/files/Mac%20OS%20X/3.0.4
« Last Edit: February 14, 2019, 07:17:13 pm by kcandrews »

kevin.black

  • Full Member
  • ***
  • Posts: 122
Re: Darwin x86_64, Cannot Find Units (Indy 10 ) AND More Generally
« Reply #13 on: February 14, 2019, 11:15:28 pm »
@Remy Lebeau,
FYI, support for OSX 64bit is scheduled for release later this year in Delphi 10.3.x.

Yes thanks, I've been following the roadmap that gets updated periodically (was 10.3.3, now 'sometime' later this year, it's very vague and there are caveats WRT changing the roadmap). As I said, the simple option for me was to stick with Delphi. Embarcadero have decided to prioritise the RAD Server stuff? No idea why, I would have thought being several months/years late with a 64 bit compiler for macOS might have prioritised things differently. I have seen your other comments noting you are mainly in the Windows world (and I've utilised many of your Delphi related suggestions, thank you for that) so this isn't a big issue for you directly. Regardless, I see a fair bit of negative criticism (for that decision, ie. prioritising RAD Server over a 64 bit macOS compiler, and Embarcadero pricing), just sayin'

@kcandrews

Thanks for the reference.
After upgrading to macOS 10.14, you have to reinstall FPC 3.0.4 so it can generate a new fpc.cfg for that OS. There is unfortunately no way anymore to generate a config file that is appropriate for all macOS versions.
I have a lot to learn...

Cheers,
Kevin
« Last Edit: February 15, 2019, 01:32:23 am by kevin.black »