Problems installing design time package in Lazarus 4.0 RC1 lazarus / 33-macOS - Mac OS X ---------------------------------------------------------------------- carl_caulkett · 2024-10-28 16:58 * Mac Mini M1 * macOS 14.6.1 * Lazarus 4.0 RC1 * FPC 3.3.1 Following on from my thread at https://forum.lazarus.freepascal.org/index.php/topic,69085.0.html, it seems that I am not quite out of the woods yet! I don't know if it's because of the problems I'm having with the startlazarus loader, but I am not able to installed a design time package which worked perfectly well on Lazarus 3.99. If someone could try it out and report back, I would be very grateful! The library is called caLibrary and consists of a runtime package calibraryrun.lpk and calibrarydsgn.lpk. calibraryrun.lpk seems to build okay, and it looks as if calibrarydsgn.lpk builds okay when the install is started. However, Lazarus does not restart successfully and I'm wondering if this is stopping the control being added to the component palette. It is supposed to produce a component called TcaEdit on the caControls tab. ---------------------------------------------------------------------- carl_caulkett · 2024-10-28 17:25 Can I broaden the question: Has anyone been able to install a new component in Lazarus 4.0 RC1? Try this combined design and runtime package. It installs in 3.99 but not on 4.0 RC1 ---------------------------------------------------------------------- dbannon · 2024-10-28 23:17 Yes, I have a working 4.0rc1 (on linux) and have installed kcontrols (design and run time) without problems.  And minor packages like IdentifierDictionary. But I built my initial 4.0rc1 from source so know I have a working system.  That may not solve your problem (you are, after all using beta software) but will allow you to identify the problem. Davo ---------------------------------------------------------------------- carl_caulkett · 2024-10-28 23:39 Quote from: dbannon on October 29, 2024, 12:17:33 amYes, I have a working 4.0rc1 (on linux) and have installed kcontrols (design and run time) without problems.  And minor packages like IdentifierDictionary. But I built my initial 4.0rc1 from source so know I have a working system.  That may not solve your problem (you are, after all using beta software) but will allow you to identify the problem. Davo Thanks for the reply, Davo! Installing from source may have to be my next step, now that you've confirmed that installing components is possible with 4.0RC1... ---------------------------------------------------------------------- TRon · 2024-10-28 23:43 Quote from: carl_caulkett on October 28, 2024, 06:25:19 pmTry this combined design and runtime package. It installs in 3.99 but not on 4.0 RC1 That package installed without any issues for me on Lazarus 4.0rc1 (though Linux x86_64). Quote from: carl_caulkett on October 28, 2024, 05:58:19 pmHowever, Lazarus does not restart successfully and I'm wondering if this is stopping the control being added to the component palette. It is supposed to produce a component called TcaEdit on the caControls tab. When Lazarus is unable to restart that means that there is an issue with the component it tried to install. In case the compilation of the package itself succeeded (the message window is able to show that) then you can assume Lazarus tries to incorporate that package on the rebuild. However, when there is something wrong with the component itself (that is a very broad spectrum) then it might be able to 'crash' the IDE, resulting in failure to load the IDE. Under normal circumstances Lazarus is able to detect this situation and tries to reload an older version of the IDE (it made a backup of itself just before doing a rebuild) which I have not seen failed (yet). As mentioned before afaik that is a feature specific to startlazarus (and as mentioned before, I do not know if that works the same for MacOS). The problem is that the number of issues that could go wrong is pretty substantial and with that a variety of different causes and corresponding solutions. That is why I mentioned before to not mix installations, not have a 'normal' system wide installed FPC/Lazarus setup (in case using FPCUpDeluxe, even though it should not matter but it sure can). To complicate things further you have rosetta that allows to mix-match between architectures. That is why it is very important to distinguish these things and make a clear distinction between one and the other. If things are not clear for you then it is almost impossible to provide any help that is actually helpful for you. For example, the fact that you seem to be mixing/trying 3.99 and 4.0rc1 both at the same time is already a warning sign (of things that could go wrong). ---------------------------------------------------------------------- carl_caulkett · 2024-10-29 11:52 Quote from: TRon on October 29, 2024, 12:43:44 amWhen Lazarus is unable to restart that means that there is an issue with the component it tried to install. In case the compilation of the package itself succeeded (the message window is able to show that) then you can assume Lazarus tries to incorporate that package on the rebuild. Both 3.99 and 4.0rc1 fail to restart properly. This is nothing to do with the component but because the startlazarus.app bundle is badly constructed (nothing to do with me, before you say anything!). The difference is that the component installs correctly on 3.99 but not on 4.0rc1. As I demonstrated in my post https://forum.lazarus.freepascal.org/inde x.php/topic,69059.msg535775.html#msg535775, the Register procedure is not even being called in 4.0rc1 As I also pointed out, attempts to install components via Package -> Install/Uninstall Packages or Package -> Online Package Manager also result in no components being added, under 4.0rc1. The more I think about it, the more I am convinced that this is not a problem with Lazarus 4.0rc1 per se, rather a problem with the lazarus- darwin-aarch64-4.0RC1.zip download on https://sourceforge.net/projects /lazarus/files/Lazarus%20macOS%20aarch64/Lazarus%204.0RC1/, which is why I'm going to follow Davo's advice and rebuild Lazarus 4.0rc1 from source! Quote from: TRon on October 29, 2024, 12:43:44 amFor example, the fact that you seem to be mixing/trying 3.99 and 4.0rc1 both at the same time is already a warning sign (of things that could go wrong). Here we go again   3.99 and 4.0rc1 are in entirely different folders, with separate config paths, separate fpc installations, separate everything, basically! I really wish you would stop trying to portray what I'm doing as a confused mess, followed by "words of wisdom, based on experience"! It does come across as somewhat patronising To illustrate this, one of the last things I did last night was to entirely delete my entire /Applications/Lazarus_4.0 folder, installed from the aforementioned lazarus-darwin-aarch64-4.0RC1.zip download. The old Lazarus 3.99 installation continued to work perfectly. Hardly "mixing/trying 3.99 and 4.0rc1 both at the same time", as any reasonable person would agree, I think! ---------------------------------------------------------------------- TRon · 2024-10-29 12:40 Quote from: carl_caulkett on October 29, 2024, 12:52:45 pmBoth 3.99 and 4.0rc1 fail to restart properly. This is nothing to do with the component but because the startlazarus.app bundle is badly constructed (nothing to do with me, before you say anything!). The difference is that the component installs correctly on 3.99 but not on 4.0rc1. I did not have any intention to blame that on you. It is just annoying that it does not seem to work that way as it does for other platforms. QuoteAs I demonstrated in my post https://forum.lazarus.freepascal.org /index.php/topic,69059.msg535775.html#msg535775, the Register procedure is not even being called in 4.0rc1 Thanks, because I missed that particular post. I get confused by so many threads regarding the same setup (which is my problem, not yours). QuoteAs I also pointed out, attempts to install components via Package -> Install/Uninstall Packages or Package -> Online Package Manager also result in no components being added, under 4.0rc1. Note only because I do not have the foggiest. QuoteThe more I think about it, the more I am convinced that this is not a problem with Lazarus 4.0rc1 per se, rather a problem with the lazarus-darwin-aarch64-4.0RC1.zip download on https://sourceforge.net/ projects/lazarus/files/Lazarus%20macOS%20aarch64/Lazarus%204.0RC1/, which is why I'm going to follow Davo's advice and rebuild Lazarus 4.0rc1 from source! That might very well be the case. I hate to ask but have you tried using the x86_64 version and does that act the same ? e.g. are you able to confirm that suspicion ? QuoteHere we go again   3.99 and 4.0rc1 are in entirely different folders, with separate config paths, separate fpc installations, separate everything, basically! I really wish you would stop trying to portray what I'm doing as a confused mess, followed by "words of wisdom, based on experience"! It does come across as somewhat patronising It is not meant to be patronizing. I am used to have different Lazarus versions installed for over a decade and all it takes to end up in mayhem is one single slip-up. Most common one being not setting the pcp path. Once it is there (at the default location(s) it just lingers and waits for the next subtle fault where things get complicated pretty fast. It is the most common error and one that is repeated over and over again over the years and thus results in a re-occurring  topic. Got another common one: rebuilding the IDE from the command-line instead of letting Lazarus do it for you. And then not mentioning having a system wide installed FPC while Lazarus was installed with FPCUpDeluxe or using FPCUpdeluxe layout with an included compiler). That list goes on and on and the people on the other side of the internet-wire that are trying to help can never be sure if a person fell for the most obvious pitfalls. And knowing it is not your fault but having something like Rosetta adds to the confusion. People even get confused when running make files with WSL and/or wine. You gotta love seamless integration. But, since I do not have the hardware myself, I am unable to test and I get tired of taking blindfolded drives so I wish you good luck ! ---------------------------------------------------------------------- carl_caulkett · 2024-10-29 13:18 Quote from: TRon on October 29, 2024, 01:40:05 pmQuote from: carl_caulkett on October 29, 2024, 12:52:45 pmThe more I think about it, the more I am convinced that this is not a problem with Lazarus 4.0rc1 per se, rather a problem with the lazarus-darwin- aarch64-4.0RC1.zip download on https://sourceforge.net/projects/lazaru s/files/Lazarus%20macOS%20aarch64/Lazarus%204.0RC1/, which is why I'm going to follow Davo's advice and rebuild Lazarus 4.0rc1 from source! That might very well be the case. I hate to ask but have you tried using the x86_64 version and does that act the same ? e.g. are you able to confirm that suspicion ? I haven't tried that yet. I'll do so once I get a build from source done. ---------------------------------------------------------------------- carl_caulkett · 2024-10-29 14:09 Quote from: carl_caulkett on October 29, 2024, 12:39:22 amQuote from: dbannon on October 29, 2024, 12:17:33 amYes, I have a working 4.0rc1 (on linux) and have installed kcontrols (design and run time) without problems.  And minor packages like IdentifierDictionary. But I built my initial 4.0rc1 from source so know I have a working system.  That may not solve your problem (you are, after all using beta software) but will allow you to identify the problem. Davo Thanks for the reply, Davo! Installing from source may have to be my next step, now that you've confirmed that installing components is possible with 4.0RC1... With fpc 3.3.1 installed under /Applications/Lazarus_4.0, I tried make bigide, but almost straight away it failed with... Code: Bash  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i /Applications/Lazarus_4.0  make bigide/Applications/Xcode.app/Contents/Developer/usr/bin/make -C packager/registration/bin/rm -f ../units/aarch64-darwin/fcllaz.ppu/bin/mkdir -p ../units/aarch64- darwin/Applications/Lazarus_4.0/fpc/bin/aarch64-darwin/ppca64 -MObjFPC -Scghi -O1 -g -gl -l -vewnhibq -gw -Fu. -FE. -FU../units/aarch64-darwin -XR/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -daarch64 fcllaz.pasHint: (11030) Start of reading config file /Users/carlcaulkett/.fpc.cfgHint: (11030) Start of reading config file /etc/fpc.cfgHint: (11031) End of reading config file /etc/fpc.cfgHint: (11031) End of reading config file /Users/carlcaulkett/.fpc.cfgFree Pascal Compiler version 3.3.1-16659-g8e58bbea61-dirty [2024/10/16] for aarch64Copyright (c) 1993-2024 by Florian Klaempfl and others(1002) Target OS: Darwin for AArch64(3104) Compiling fcllaz.pasFatal: (10022) Can't find unit system used by fcllazFatal: (1018) Compilation abortedmake[1]: *** [fcllaz.ppu] Error 1make: *** [registration] Error 2  I'm now going to replace fpc 3.3.1 with a FpcUpDeluxe generated fcp 3.2.2 since that seem to be the default choice for 4.0rc1. I shall report back, although I do grow weary of all of these shenanigans ---------------------------------------------------------------------- carl_caulkett · 2024-10-29 16:03 I got exactly the same results with fpc 3.2.2. ---------------------------------------------------------------------- carl_caulkett · 2024-10-29 17:15 So, I tried the build from source option again with @TRon's great suggestion of make clean all bigide FPC="/Applications/lazarus_4.0/fpc/bin/aarch64-darwin/fpc.sh". This is using FPC 3.2.2, btw. Happily, the build completed! However, I am left with 3 problems: The startlazarus.app bundle still doesn't work. It comes up with "Can't find the lazarus executable /Applications/lazarus_4.0/startlazarus.app/Contents/MacOS/lazarus". I may be able to fix this with a shell script I have for constructing .app bundles for macOSWhereas previous attempts, for all of their failures, have, at least, given me a Lazarus which respects the Dark Mode of my macOS, this one seams to resolutely insist on a light mode Worst of all, components still will not install. See below for more details... My test component is... Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i unit testEdit; {$mode ObjFPC}{$H+} interface uses  Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls; type  TtestEdit = class(TEdit)  end; procedure Register; implementation procedure Register;begin  RegisterComponents('Test',[TtestEdit]);  ShowMessage('Register called!');end; end.  With 4.0rc1, the 'Register called!' message is not being displayed when Lazarus is stated after an IDE rebuild, indicating that the Register command is not being called. with 3.99, the message is displayed, the component is installed, and all is well  UPDATE: With regard to item 2 in the list, my Configure "Build Lazarus" settings are: LCL widget type=Cocoa, Target OS=Darwin, Target CPU=aarch64, Options=-WM10.4 -vd I've also tried Options=-WM11.0 -vd which is how it is set in my Dark and Doomy 3.99 I am at a loss as to what else to try ---------------------------------------------------------------------- Martin_fr · 2024-10-29 17:53 There must be an autogenerated unit in that package, that uses your unit and has an initialization section Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i initialization  RegisterPackage('name', @Register);end.  and in your PCP there should be a file staticpackages.inc that contains the name of that unit. Is both there. If the 2nd is missing: - uninstall the package (probably no need to rebuild) - restart ide - install again - rebuild When rebuilding, check that staticpackages.inc is updated => put some comment in there, it should disappear.  Otherwise you probably got the wrong  PCP. ---------------------------------------------------------------------- Martin_fr · 2024-10-29 17:54 you can also check that the IDE is build with your package => but a syntax error into your unit. ---------------------------------------------------------------------- carl_caulkett · 2024-10-29 17:59 Quote from: Martin_fr on October 29, 2024, 06:53:54 pmThere must be an autogenerated unit in that package, that uses your unit and has an initialization section Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i initialization  RegisterPackage('name', @Register);end.  and in your PCP there should be a file staticpackages.inc that contains the name of that unit. Is both there. If the 2nd is missing: - uninstall the package (probably no need to rebuild) - restart ide - install again - rebuild When rebuilding, check that staticpackages.inc is updated => put some comment in there, it should disappear.  Otherwise you probably got the wrong  PCP. The test library is called testpkg.lpk, and yes there is an autogenerated file testpkg.pas, consisting of... Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i { This file was automatically created by Lazarus. Do not edit!  This source is only used to compile and install the package. } unit testpkg; {$warn 5023 off : no warning about unused units}interface uses  testEdit, LazarusPackageIntf; implementation procedure Register;begin  RegisterUnit('testEdit', @testEdit.Register);end; initialization  RegisterPackage('testpkg', @Register);end.  UPDATE: This is my staticpackages.inc, and yes, testpkg is in there! Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i // In case of duplicate identifier errors, see lazarus.pplaztestinsight,datetimec trls,sdflaz,anchordockpkg,lhelpcontrolpkg,pascalscript,testpkg,printer 4lazarus,anchordockingdsgn,charactermap_ide_pkg,chmhelppkg,datetimectr lsdsgn,dbflaz,editormacroscript,exampleprojects,externhelp,fpcunitide, instantfpclaz,jcfidelazarus,lazprojectgroups,memdslaz,printers4lazide, projtemplates,runtimetypeinfocontrols,sqldblaz,allsyneditdsgn,tachartl azaruspkg,todolistlaz,turbopoweripro,dockedformeditor,onlinepackageman ager,simplewebservergui,turbopoweriprodsgn,leakview,pas2jsdsgn, ---------------------------------------------------------------------- carl_caulkett · 2024-10-29 20:13 Quote from: Martin_fr on October 29, 2024, 06:53:54 pmWhen rebuilding, check that staticpackages.inc is updated => put some comment in there, it should disappear.  Otherwise you probably got the wrong  PCP. I put in a comment and it disappeared. Quote from: Martin_fr on October 29, 2024, 06:54:56 pmyou can also check that the IDE is build with your package => but a syntax error into your unit. I put in a syntax error and the Rebuild Lazarus routine picked it up seconds after starting. I'm just wondering how important to the success of the rebuild is the automatic restarting of Lazarus... I'm guessing that because the component gets installed in 3.99 which fails to restart properly, but not in 4.0rc1 which also fails to restart, that the answer is "not very"! UPDATE: Interesting! I've just use FcpUpDeluxe to install FCP 3.22 and Lazarus 3.2 in an entirely separate folder to the others, and this one automatically restarts after a Lazarus Rebuild, and it installs the test component As an experiment, I backed up the 4.0rc1 startlazarus executable and the startlazarus.app bundle which links to it, and then copied in the corresponding files from 3.2! When I ran startlazarus.app it flashed up the start screen from Lazarus 3.2 but then proceeded to open up Lazarus 4.0rc1. Curiouser and curiouser   However, this did not solve the automatic restarting of the Lazarus rebuild in 4.0rc1, and the component remains resolutely uninstalled. I'm going to draw a line over my attempts get this to work, although if @Martin_fr or any of the other Lazarus devs want me to try any thing else, just ask ---------------------------------------------------------------------- carl_caulkett · 2024-10-29 20:43 One of the things I discovered while digging around 4.0rc1 was that there is an option in Settings -> Environment -> IDE Startup -> Initial Checks whereby if you check "Quickcheck Fppkg configuration at start" you get the intial dialog where you can select various options. Great, I thought, I'll do that in 3.99 and at least I'll have a working environment with docked forms. Not so! Lazarus refused to honour this setting... Grrrgh  Is there any other way of invoking this IDE Startup option? I had a dig around and found this the lazarusfppkg.pas project in /Applications/Lazarus_aarch64/lazarus/components/fppkg/standalone and tried to build it. I managed to get round the first stumbling block by adding ../../buildintf to the Paths setting in Project Options, but now it's falling over on these lines... Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TFppkgForm.LoadFppkgConfiguration;var  i: Integer;begin   FFPpkg.Initi alizeGlobalOptions(IDEEnvironmentOptions.GetParsedFppkgConfig);  // <== Cannot find IDEEnvironmentOptions   FFPpkg.Options.GlobalSection.Downloader := 'FPC';   I thought that IDEEnvironmentOptions might be a unit where GetParsedFppkgConfig is defined, but no, it seems to be a global variable! On searching for IDEEnvironmentOptions := I found an entry in /Applications/Lazarus_aarch64/lazarus/ide/buildmanager.pas but it's late and am too tired to work out how to get a working reference to it. I know you've mentioned it in the past, @Davo, so any clues would be really welcome ---------------------------------------------------------------------- Martin_fr · 2024-10-29 20:51 About the importance of the the automatic restart... "automatic" isn't important. "restart" is. Mind, that if your original lazarus in installed, then it would/should be in a folder to which your user account has no write rights. I don't know if that is the case in your situation. That means, when you rebuild, the original Lazarus application could not be replaced => then a new one is created in the PCP (or some subfolder of it). Startlazarus should pick that up, and start the new one (of course startlazarus too, needs the correct PCP for that). You can check the date of the app/executable. You can also make sure to start the correct one yourself. Further since you are on Mac, your Lazarus is not just the executable, but an application bundle. Yet everything is tailored at generating an executable file, the rest is decoration. Usually you would have - the app bundle - inside the app bundle - where the executable would be MacOS/Content/ - would be a sym-link. To a file that resides in the same folder as the app bundle - the file to which the symlink goes That should help you check that a resulting new lazarus was created, and put in the correct place. It should also allow you to manually make sure that you start the correct one. ---------------------------------------------------------------------- Martin_fr · 2024-10-29 20:52 you can get the setup calling Lazarus with --setup ---------------------------------------------------------------------- Martin_fr · 2024-10-29 20:54 Make sure you have separate pcp for all your experiments.... There is a possibility to put the --pcp=somepath into a file called lazarus.cfg But on Mac, I am not sure where exactly it needs to be placed. Next to the app bundle, or inside. If it works on Mac.... ---------------------------------------------------------------------- carl_caulkett · 2024-10-29 21:52 Quote from: Martin_fr on October 29, 2024, 09:52:43 pmyou can get the setup calling Lazarus with --setup Thanks @Martin_fr! On the Mac you have to do open -a /Applications/Lazarus_aarch64/lazarus/lazarus_aarch64.app --args --setup, which does bring up the startup options, but annoying it doesn't include the facility to choose the Docked vs Non-Docked IDE style. Ho hum... I guess I'm going to have to wait for the problem to be fixed, as I'm reasonably certain that I have exhausted the possibilities of it being something daft that I have done, though it's always a possibility... ---------------------------------------------------------------------- Martin_fr · 2024-10-29 21:58 Well docking is still a package. It is no installed by default. It can still be uninstalled, or due to whatever issue you have not been activated. ---------------------------------------------------------------------- carl_caulkett · 2024-10-29 22:50 Quote from: Martin_fr on October 29, 2024, 09:51:55 pmYou can check the date of the app/executable. You can also make sure to start the correct one yourself. I think you may have cracked it @Martin-fr I'm just trying something now. I'll report back soon! ---------------------------------------------------------------------- carl_caulkett · 2024-10-29 23:45 I reinstalled Lazarus 4.0rc1 under ~/Applications/Lazarus_4.0 rather than /Applications/Lazarus_4.0 thinking that maybe running under my own user area might be a bit more relaxed about rebuilding the lazarus executable. Indeed now, when I do an IDE rebuild, the lazarus executable is being updated whereas it wasn't before. However, the test component is still not being added ---------------------------------------------------------------------- carl_caulkett · 2024-10-29 23:49 Quote from: Martin_fr on October 29, 2024, 10:58:39 pmWell docking is still a package. It is no installed by default. It can still be uninstalled, or due to whatever issue you have not been activated. Unfortunately the Docking package seems pretty much unusable compared to how it behaves in 4.0rc1.