Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2013-01

Startlazarus starting "wrong" Lazarus

17 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Giuliano Colla

I stumbled into a situation which might be rather confusing for an inexperienced user:

Lazarus 1.04, Linux environment.

If you install from rpm a new version, but your local old version has a more recent date (because you recompiled it recently to install some packages), startlazarus will show the splash screen of the new version, but will silently load the old version.

I don't see an easy way out, and maybe we must just live with it, but I felt it appropriate to mention. Maybe someone smarter than me will come out with a brilliant solution to avoid that.

Giuliano

Reply by email

Juha Manninen
to Giuliano Colla

If both versions are in the system path then anything can happen. The one you install from RPM goes maybe to /usr/bin/ and is certainly in the path.
I recommend you put any other version of Lazarus into its own directory which is not in the system path,
for example into "~/Lazarus_test". Then start it from console: $ ./lazarus --pcp=~/.lazarus_test

Juha

Reply by email

Giuliano Colla
to Juha Manninen
Juha Manninen wrote 7 lines
If both versions are in the system path then anything can happen. The one you install from RPM goes maybe to /usr/bin/ and is certainly in the path. I recommend you put any other version of Lazarus into its own directory which is not in the system path, for example into "~/Lazarus_test". Then start it from console: $ ./lazarus --pcp=~/.lazarus_test

I'm not speaking of a special setup with multiple version, which requires appropriate handling.

I'm speaking of just a normal situation, with a /usr/lib/lazarus where the system default executable resides, and a ~/.lazarus/bin directory, where my custom executable resides (when recompiled to install packages).

In the usual case (i.e. new version more recent than my custom copy), after the download a new version, startlazarus pops up a message "Multiple lazarus found - Which Lazarus should be started?".

But if my custom copy happens to be more recent than the new version, my custom copy is started silently, even if it's an older version of Lazarus.

It's not so obvious how to handle this condition, but it may be confusing.

Giuliano

Reply by email

Giuliano Colla
to leledumbo

Il 13/01/2013 13:57, leledumbo ha scritto:

What's the output of: which lazarus

"which lazarus" can't be aware of a lazarus executable in ~/.lazarus/bin/. That's handled by startlazarus.

Giuliano

Reply by email

Mark Morgan Lloyd
to Giuliano Colla
Giuliano Colla wrote 5 lines
Il 13/01/2013 13:57, leledumbo ha scritto: > What's the output of: which lazarus > "which lazarus" can't be aware of a lazarus executable in ~/.lazarus/bin/. That's handled by startlazarus.

which startlazarus

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Giuliano Colla
to Mark Morgan Lloyd
Mark Morgan Lloyd wrote 10 lines
Giuliano Colla wrote: > Il 13/01/2013 13:57, leledumbo ha scritto: >> What's the output of: which lazarus >> > "which lazarus" can't be aware of a lazarus executable in > ~/.lazarus/bin/. > That's handled by startlazarus. which startlazarus

startlazarus shows the correct splash screen (version 1.0.4), meaning that it's the proper one but then it starts my custom copy from ~/.lazarus/bin, which is an older version, but with a more recent date.

I can't possibly have multiple startlazarus, because I don't have more than one installation. I just have one lazarus installation, and a custom copy in my home directory.
Of course, by deleting/renaming my ~/lazarus/bin/lazarus custom executable, then the good lazarus is started, and the problem is solved. I signaled it because it might be confusing.

Giuliano

Reply by email

Mattias Gaertner
to Giuliano Colla

Giuliano Colla hat am 14. Januar 2013 um 13:27
geschrieben:

Show quoted text 17 lines
On 01/14/2013 08:41 AM, Mark Morgan Lloyd wrote: > Giuliano Colla wrote: >> Il 13/01/2013 13:57, leledumbo ha scritto: >>> What's the output of: which lazarus >>> >> "which lazarus" can't be aware of a lazarus executable in >> ~/.lazarus/bin/. >> That's handled by startlazarus. > > which startlazarus > startlazarus shows the correct splash screen (version 1.0.4), meaning that it's the proper one but then it starts my custom copy from ~/.lazarus/bin, which is an older version, but with a more recent date. I can't possibly have multiple startlazarus, because I don't have more than one installation.

Every Lazarus has its startlazarus. If you installed via the rpm and have a svn then you have two startlazarus.

Show quoted text 5 lines
I just have one lazarus installation, and a custom copy in my home directory. Of course, by deleting/renaming my ~/lazarus/bin/lazarus custom executable, then the good lazarus is started, and the problem is solved. I signaled it because it might be confusing.

startlazarus can be extended to store the file dates of the found lazarus executable. If the system one changed, it can ask to delete the custom one and start the system one OR to start the custom one.

Mattias

Reply by email

Giuliano Colla
to Mattias Gaertner
Mattias Gaertner wrote
Giuliano Colla hat am 14. Januar 2013 um 13:27 geschrieben:

[..]

Show quoted text 5 lines
> I can't possibly have multiple startlazarus, because I don't have more > than one installation. Every Lazarus has its startlazarus. If you installed via the rpm and have a svn then you have two startlazarus.

In the "deployment" platform I'm speaking of there's just the rpm Lazarus, and nothing else.

In the development platforms, I have multiple Lazarus, and scripts to switch the environment, but in that case I don't ask that some wizard reads my mind to understand which Lazarus I want to start ;-)

Show quoted text 8 lines
> I just have one lazarus installation, and a > custom copy in my home directory. > Of course, by deleting/renaming my ~/lazarus/bin/lazarus custom > executable, then the good lazarus is started, and the problem is solved. > I signaled it because it might be confusing. startlazarus can be extended to store the file dates of the found lazarus executable. If the system one changed, it can ask to delete the custom one and start the system one OR to start the custom one.

This could be a way to solve the issue.

Another one which comes to my mind is to store the version information in the custom directory. While the custom file is just a customization of the same version of the system file, the current policy is flawless. But if the system version is newer than the custom version, it may ask the question you propose, disregarding the file dates.

Giuliano

Reply by email

Mattias Gaertner
to Giuliano Colla

Giuliano Colla hat am 14. Januar 2013 um 15:04
geschrieben:

Show quoted text 32 lines
On 01/14/2013 02:25 PM, Mattias Gaertner wrote: > Giuliano Colla hat am 14. Januar 2013 um 13:27 > geschrieben: [..] >> I can't possibly have multiple startlazarus, because I don't have more >> than one installation. > Every Lazarus has its startlazarus. If you installed via the rpm and have a > svn > then you have two startlazarus. > In the "deployment" platform I'm speaking of there's just the rpm Lazarus, and nothing else. In the development platforms, I have multiple Lazarus, and scripts to switch the environment, but in that case I don't ask that some wizard reads my mind to understand which Lazarus I want to start ;-) >> I just have one lazarus installation, and a >> custom copy in my home directory. >> Of course, by deleting/renaming my ~/lazarus/bin/lazarus custom >> executable, then the good lazarus is started, and the problem is solved. >> I signaled it because it might be confusing. > startlazarus can be extended to store the file dates of the found lazarus > executable. If the system one changed, it can ask to delete the custom one > and > start the system one OR to start the custom one. This could be a way to solve the issue. Another one which comes to my mind is to store the version information in the custom directory. While the custom file is just a customization of the same version of the system file, the current policy is flawless. But if the system version is newer than the custom version, it may ask the question you propose, disregarding the file dates.

There is a version in the ~/.lazarus/environmentoptions.xml. startlazarus should ask when the user installed a Lazarus - no matter if the system version is newer, older or same version.
And it should not be annoying and ask every time. Only once. startlazarus was very stable so far, but there is no guarantee that a startlazarus works with different versions.

Mattias

Reply by email

Giuliano Colla
to Mattias Gaertner
Mattias Gaertner wrote 6 lines
There is a version in the ~/.lazarus/environmentoptions.xml. startlazarus should ask when the user installed a Lazarus - no matter if the system version is newer, older or same version. And it should not be annoying and ask every time. Only once. startlazarus was very stable so far, but there is no guarantee that a startlazarus works with different versions.

I fully agree with you.
I was confident that in the right hands the issue would get an elegant solution.

Giuliano

Reply by email

Mark Morgan Lloyd
to Giuliano Colla: startlazarus shows the correct splash screen (version 1.0.4), meaning that it's the…
Giuliano Colla wrote 18 lines
On 01/14/2013 08:41 AM, Mark Morgan Lloyd wrote: > Giuliano Colla wrote: >> Il 13/01/2013 13:57, leledumbo ha scritto: >>> What's the output of: which lazarus >>> >> "which lazarus" can't be aware of a lazarus executable in >> ~/.lazarus/bin/. >> That's handled by startlazarus. > > which startlazarus > startlazarus shows the correct splash screen (version 1.0.4), meaning that it's the proper one but then it starts my custom copy from ~/.lazarus/bin, which is an older version, but with a more recent date. I can't possibly have multiple startlazarus, because I don't have more than one installation. I just have one lazarus installation, and a custom copy in my home directory.

Darn strange...

/usr/local/share$ find . -executable -name startlazarus |grep -v MacOS ./lazarus-1.0/startlazarus
./lazarus-1.0-rc1/startlazarus
./lazarus-trunk+2.6.2/startlazarus
./lazarus-trunk+2.6.0/startlazarus

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Giuliano Colla
to Mark Morgan Lloyd
Mark Morgan Lloyd wrote 15 lines
Giuliano Colla wrote: [..] > I can't possibly have multiple startlazarus, because I don't have > more than one installation. I just have one lazarus installation, and > a custom copy in my home directory. Darn strange... /usr/local/share$ find . -executable -name startlazarus |grep -v MacOS ./lazarus-1.0/startlazarus ./lazarus-1.0-rc1/startlazarus ./lazarus-trunk+2.6.2/startlazarus ./lazarus-trunk+2.6.0/startlazarus

That's because you're keeping a number of different Lazarus versions, like I do on my development platforms.

But in a deployment platform, where there's just one Lazarus what I see is:

[colla at localhost ~]$ which startlazarus
/usr/bin/startlazarus

and:

[colla at localhost ~]$ locate startlazarus
/usr/bin/startlazarus
/usr/lib/lazarus/startlazarus
/usr/lib/lazarus/ide/startlazarus.ico
/usr/lib/lazarus/ide/startlazarus.lpi
/usr/lib/lazarus/ide/startlazarus.lpr
/usr/lib/lazarus/ide/startlazarus.res
/usr/lib/lazarus/install/man/man1/startlazarus.1
/usr/lib/lazarus/lazarus.app/Contents/Resources/startlazarus.app /usr/lib/lazarus/lazarus.app/Contents/Resources/startlazarus.app/Contents /usr/lib/lazarus/lazarus.app/Contents/Resources/startlazarus.app/Contents/Info.plist /usr/lib/lazarus/lazarus.app/Contents/Resources/startlazarus.app/Contents/MacOS /usr/lib/lazarus/lazarus.app/Contents/Resources/startlazarus.app/Contents/PkgInfo /usr/lib/lazarus/lazarus.app/Contents/Resources/startlazarus.app/Contents/Resources /usr/lib/lazarus/lazarus.app/Contents/Resources/startlazarus.app/Contents/MacOS/startlazarus /usr/lib/lazarus/units/i386-linux/gtk2/startlazarus.o /usr/lib/lazarus/units/i386-linux/gtk2/startlazarus.or /usr/lib/lazarus/units/i386-linux/gtk2/startlazarus.res /usr/share/man/man1/startlazarus.1.gz

where the only executable is /usr/lib/lazarus/startlazarus, and /usr/bin/startlazarus is nothing but a symlink to the same.

Giuliano

Reply by email

Mark Morgan Lloyd
to Giuliano Colla
Giuliano Colla wrote 23 lines
On 01/15/2013 10:46 AM, Mark Morgan Lloyd wrote: > Giuliano Colla wrote: > [..] >> I can't possibly have multiple startlazarus, because I don't have >> more than one installation. I just have one lazarus installation, and >> a custom copy in my home directory. > > Darn strange... > > /usr/local/share$ find . -executable -name startlazarus |grep -v MacOS > ./lazarus-1.0/startlazarus > ./lazarus-1.0-rc1/startlazarus > ./lazarus-trunk+2.6.2/startlazarus > ./lazarus-trunk+2.6.0/startlazarus > That's because you're keeping a number of different Lazarus versions, like I do on my development platforms. But in a deployment platform, where there's just one Lazarus what I see is: [colla at localhost ~]$ which startlazarus /usr/bin/startlazarus

I thought you'd already said that you'd go another copy hidden in ~/.lazarus/bin

and: [colla at localhost ~]$ locate startlazarus /usr/bin/startlazarus

..

Are you sure that you can trust locate's results, or is it stopping when it sees ~/.lazarus I'd not trust locate in this situation, but instead would use find.

Whatever, I agree it's undesirable- if you're really seeing what you think you're seeing.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Giuliano Colla
to Mark Morgan Lloyd
Mark Morgan Lloyd wrote
I thought you'd already said that you'd go another copy hidden in ~/.lazarus/bin

That's where Lazarus puts its executable when recompiled (to install packages) and the installation directory is not writable. But it's started by the system's unique startlazarus, which checks both locations.

[..]

Show quoted text 5 lines
Are you sure that you can trust locate's results, or is it stopping when it sees ~/.lazarus I'd not trust locate in this situation, but instead would use find.

Output of find:

[root at localhost /]# find . -name startlazarus
./usr/lib/lazarus/lazarus.app/Contents/Resources/startlazarus.app/Contents/MacOS/startlazarus ./usr/lib/lazarus/startlazarus
./usr/bin/startlazarus

Just a subset of the output of locate, which actually finds *startlazarus*

Giuliano

Reply by email

Mark Morgan Lloyd
to Giuliano Colla
Giuliano Colla wrote 7 lines
On 01/15/2013 04:13 PM, Mark Morgan Lloyd wrote: > I thought you'd already said that you'd go another copy hidden in > ~/.lazarus/bin > That's where Lazarus puts its executable when recompiled (to install packages) and the installation directory is not writable. But it's started by the system's unique startlazarus, which checks both locations.

Ah- that's clearer :-)

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email