Recent

Author Topic: Unable to install packages  (Read 10610 times)

Grahame Grieve

  • Sr. Member
  • ****
  • Posts: 379
Unable to install packages
« on: October 19, 2023, 12:32:51 pm »
I'm stuck. I've just done a new install of Lazarus fixes_3_0 on OSX (M1 MacBook Pro, Sonoma 14.0) which was forced on me by the Xtools command line upgrade (argh - I have *never* had a happy experience installing Lazarus on OSX).

The install is done, but now I cannot install packages. All my additional packages say:

Current state: not installed, RunAndDesignTime

But they're compiled (fail if I change the source), and the only binary I can find ('lazarus') is updated when I do a compile. (see image attachment). So I'm mystified as to why the packages won't actually get installed?

Lazarus: Lazarus 3.0RC2 (rev lazarus_3_0_RC2-29-ga6ee92da7b) FPC 3.2.2 aarch64-darwin-cocoa

Packages that won't install: anchor docking, anchor docking design, Project groups etc (none of mine - I haven't got to that yet)

dbannon

  • Hero Member
  • *****
  • Posts: 3681
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Unable to install packages
« Reply #1 on: October 19, 2023, 01:51:25 pm »
Grahame, this is something that TRon suggested in another thread.

Are your installing pre-made Lazarus as a dmg ?  And are you using startlazarus to launch your lazarus install ?

Background - if you install from the sourceforge dmg, you will (we suspect) end up with the Lazarus binaries somewhere in read only space. As such, you MUST use startlazarus to, well, start Lazarus !  It redirects you away from the binaries in read only and instead, uses the newly build ones in your pcp space.

I always build Lazarus from source code, especially on the Mac, I have no trouble at all. Hmm, no, I do have the easily fixed but very annoying quarantine issue, Trev found a solution but for some reason did not want it on the Installing wiki page, I recently added it,  https://wiki.freepascal.org/Installing_Lazarus_on_macOS#Installing_non-release_versions_of_the_Lazarus_IDE, see the 'Note'. Sorry Trev, too important !

Anyway, I install from source, I install packages, it all works for me.

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

TRon

  • Hero Member
  • *****
  • Posts: 4377
Re: Unable to install packages
« Reply #2 on: October 19, 2023, 01:58:30 pm »
Very much obliged to have noticed and referring to the other thread dbannon as I wasn't sure how to incorporate it into a reply to TS.

This is indeed exactly what I was trying to describe in the other thread. My only problem (besides not able to test myself due to not having this platform) is that I do not know for sure if not using startlazarus is the actual cause for the issue that TS reported. The only thing I know is that the symptoms look similar.
Today is tomorrow's yesterday.

Grahame Grieve

  • Sr. Member
  • ****
  • Posts: 379
Re: Unable to install packages
« Reply #3 on: October 19, 2023, 02:13:01 pm »
I installed Lazarus using the instruction for fixes_3_0 here: https://wiki.freepascal.org/Installing_Lazarus_on_macOS#Lazarus_Fixes_3.0

Grahame Grieve

  • Sr. Member
  • ****
  • Posts: 379
Re: Unable to install packages
« Reply #4 on: October 19, 2023, 02:17:51 pm »
> see the 'Note'

The note about FPC compiler and Apple Silicon? I build from fpc main anyway so that didn't seem relevant to me

Grahame Grieve

  • Sr. Member
  • ****
  • Posts: 379
Re: Unable to install packages
« Reply #5 on: October 19, 2023, 02:26:46 pm »
Duh. My fault, but...

When I tried to install the packages, the rebuild couldn't find staticpackages.inc. I commented the include out since I couldn't find it... that was the culprit.

But I still can't find it... where is this file, and why couldn't it find it, and how can it compile without it? I don't understand what's going on there

TRon

  • Hero Member
  • *****
  • Posts: 4377
Re: Unable to install packages
« Reply #6 on: October 19, 2023, 02:28:34 pm »
@Grahame:
I've looked at those instructions multiple times now and for me they work confusing. It talks about fixes 3.0 but further refers to fixes 2.2. I am not sure what part of the wiki belongs to what exactly. The fact that it refers to other wiki pages is adding on top of my confusion.

At some point, when you build Lazarus, did you use make install ? And if you did, to what directory did you "install" ? If not "installed" using make then how did you setup your final results from the Lazarus build (e.g. to where did you copy the result, if you made a copy at all).

Do you have another (previous) installation of Lazarus present as well ? In case you have did you use the --pcp option for your new build ?

There are actually more questions and it would be easier to pinpoint what is going wrong when you explicitly mention what steps you took to build and 'install' you new build of Lazarus. Not to mention that it is important to know how you start Lazarus. That is unless something comes up what is obvious that causes your issue.

Note: I can't test myself so all I have to go on is your feedback.
« Last Edit: October 19, 2023, 02:31:57 pm by TRon »
Today is tomorrow's yesterday.

TRon

  • Hero Member
  • *****
  • Posts: 4377
Re: Unable to install packages
« Reply #7 on: October 19, 2023, 02:29:17 pm »
But I still can't find it... where is this file, and why couldn't it find it, and how can it compile without it? I don't understand what's going on there
In your --pcp directory (usually as a result of a crash of Lazarus).
Today is tomorrow's yesterday.

Grahame Grieve

  • Sr. Member
  • ****
  • Posts: 379
Re: Unable to install packages
« Reply #8 on: October 19, 2023, 09:23:53 pm »
I agree the wiki is confusing. Par for the course installing on OSX, which seems to be the domain of the inner experts. Anyway, here's what I did:

Code: Text  [Select][+][-]
  1. git clone -b fixes_3_0 https://gitlab.com/freepascal.org/lazarus/lazarus.git laz
  2. cd laz
  3. make distclean all LCL_PLATFORM=cocoa CPU_TARGET=aarch64 bigide    
  4. ; at this point I had to create ~/.fpc.cfg
  5. ; #include /etc/fpc.cfg
  6. ; -XR/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
  7. ; so that the linker could find c. I don't know why given that the expected folder exists. Beats me
  8. make distclean all LCL_PLATFORM=cocoa CPU_TARGET=aarch64 bigide
  9. open startlazarus.app --args "--pcp=~/.Lazarus"
  10.  

interesting.. I have a .lazarus instead of a .Lazarus... that might be the problem

TRon

  • Hero Member
  • *****
  • Posts: 4377
Re: Unable to install packages
« Reply #9 on: October 19, 2023, 10:31:41 pm »
interesting.. I have a .lazarus instead of a .Lazarus... that might be the problem
DON'T mix an older existing Lazarus configuration directory with a new one. Let the (start)lazarus app create a new one instead. It makes sure that none of the remnants of an older installation are picked up (and can meddle with your new Lazarus build).
Today is tomorrow's yesterday.

dbannon

  • Hero Member
  • *****
  • Posts: 3681
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Unable to install packages
« Reply #10 on: October 20, 2023, 12:20:18 am »
Yes, as you note, I was half way through updating the wiki from talking about fixes 2.2 to fixes 3.0 but principles still apply. Sorry !

My test run was on Intel Monteray, I don't have a Apple Silicon box but, apart from where noted, I'd expect it to be the same (But, honestly, knowing how Apple work, would not be surprised if it was not.).

From what I have seen, MacOS seems happy to ignore capitalization when it suits itself. Crazy, should be either case sensitive or not.

It sounds like Graham is building from source so no need to use startlazarus, but one more problem I should have mentioned. If you start Lazarus from the Finder, by double clicking on the lazarus.app bundle (or, I think, the startlazarus.app bundle) it does not look at your lazarus.cfg file, that says to me its not starting it in the main lazarus directory, that could mean a relative path to the config dir won't work. Just speculation.

A solution, at least as a test, would be to open Lazarus from the command line.

Code: Bash  [Select][+][-]
  1. $> cd some-lazarus-dir <enter>
  2. $> open lazarus.app <enter>

Next suggestion is to try and capture the console output from Lazarus, not that easy on MacOS, needs to be sent to a file with a command line switch.

Code: Bash  [Select][+][-]
  1. open start.app --args "--debug-log=Set-some-absolutepath-to-writeable-file"  <enter>

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

dbannon

  • Hero Member
  • *****
  • Posts: 3681
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Unable to install packages
« Reply #11 on: October 20, 2023, 04:03:01 am »
I have ticked up that wiki page a bit (actually, quite a lot). Firstly to update it and make it a touch more 'timeless' although still has one or two refs to Fixes 3.0.

But also to make the use of a source install somewhat more mainstream. And downplay the need to build your own M1 compiler, installing FPC3.2.2 gets you a universal binary so I expect few users would want to use < fpc322.

I still think a whole lot of updates to configuring the debugger is necessary, its a huge section and as of 3.0 most is unnecessary. But I'll have to do a new install to document just what is necessary so cannot do it immediately.

Graham may remember the (much simpler) steps needed to get the debugger working ?

David
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

TRon

  • Hero Member
  • *****
  • Posts: 4377
Re: Unable to install packages
« Reply #12 on: October 20, 2023, 05:15:28 am »
Thank you very much for the cleanup and rewrite dbannon.

This is now a much more understandable read.

fwiw it is not so much that it is focused on a certain branch as I can understand and translate that (In that regards it is the same for any other platform) but the mixing between different branches is very confusing (even for me as my memory has about the size of a pea so can't even remember what I just executed in the previous line  ;) ).

Learned something new as well (about the quarantine attribute). Appreciated !
Today is tomorrow's yesterday.

dbannon

  • Hero Member
  • *****
  • Posts: 3681
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Unable to install packages
« Reply #13 on: October 20, 2023, 06:21:17 am »
.....
Learned something new as well (about the quarantine attribute). Appreciated !
Its a Mac thing. If you keep your hands clean, you don't need to know about it !

 :D

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

Grahame Grieve

  • Sr. Member
  • ****
  • Posts: 379
Re: Unable to install packages
« Reply #14 on: October 21, 2023, 01:53:55 pm »
I think that it would be good for the instructions to cover the issue of deleting any existing settings directory, and also it would be good to discuss the relationship between startLazarus and the standard ways of launching Applications in OSX

 

TinyPortal © 2005-2018