I just encountered a nasty problem: When I have multiple Lazarus installations (trunk,…
Hans-Peter Diettrich wrote 19 lines
Well, definitely not on Unix.
On unix, the EXE directory should never contain config files.
Michael.

Mailing lists / lazarus / 2011-03
74 messages · 18 people · –
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
I just encountered a nasty problem: When I have multiple Lazarus installations (trunk,…
Well, definitely not on Unix.
On unix, the EXE directory should never contain config files.
Michael.
I just encountered a nasty problem: When I have multiple Lazarus installations (trunk,…
2011/3/30 Hans-Peter Diettrich :
Can somebody please clarify the intended procedure for configuring multiple parallel Lazarus installations?
Always specify the primary config directory, if you have multiple parallel Lazarus installations. You may add the --pcp parameter in the shortcut you use to start lazarus.
http://wiki.freepascal.org/Multiple_Lazarus#The_config_directory
Vincent
Well, definitely not on Unix. On unix, the EXE directory should never contain config…
Well, definitely not on Unix. On unix, the EXE directory should never contain config files.
That depends. I think I'm not the only Lazarus user who has Lazarus "installed" in his home directory; i.e. without "make install". In that case it wouldn't hurt to have the configs being looked up in a subdirectory of that path. However I share Vincent's opinion that the --pcp parameter is far easier and no matter what system, it's always pretty easy to create a launcher (shortcut on windows, shell script on *nix). For example a startlaz_trunk.sh in ~/bin/, that simply executes ~/laztrunk/startlazarus --pcp=...
I just encountered a nasty problem:
When I have multiple Lazarus installations (trunk, branches, snapshot...), the common Lazarus configuration is used by default (when no --pcp is specified). Actually I wondered about many error messages on an IDE rebuild, until I noticed that the (default) configuration referred to a different Lazarus directory :-(
This leads me to the question, how a user should configure and start Lazarus at all?
What exactly happens when the IDE is invoked, from a desktop item or command prompt?
Where does the IDE look for the configuration? Is it sufficient to have a MyLazarus\cfg\ directory, to make the MyLazarus\Lazarus.exe use the configuration in that directory?
IMO the IDE should look for a configuration in the current (EXE) directory first, and only into the common directory when no config can be found there. The config naming instead suggests that the IDE looks into the *primary* (common) config directory first, and into its own directory only next (*secondary* config path).
What exactly happens when the IDE rebuilds itself? Which directory is used for the sources, and for storing the new (compiled) IDE? Does it make any sense to rebuild the IDE from sources in a different directory, and where is the new IDE stored?
Can somebody please clarify the intended procedure for configuring multiple parallel Lazarus installations?
DoDi
That depends. I think I'm not the only Lazarus user who has Lazarus "installed" in …
The problem is many users install a 2nd copy, but do not know....
My idea (but I havent got the time) would be:
- lazarus remembers it's own exe-path in the enviroments-options.xml
- if the exe path changes, lazarus gives a warning (can be switched off)
If a user runs 2 installations he will be warned
Same if the user moves the installation, which imho is ok
Martin
That depends. I think I'm not the only Lazarus user who has Lazarus "installed" in …
I agree, but I think that there could be merit in having a "default default" somewhere that specifies (a) what version of FPC the current lazarus binary was compiled with and (b) what directory its associated files were compiled into. Even if this was only used for a messagebox when the IDE started it would be a useful warning for the numerous people- inexperienced or otherwise- who get bitten by this.
The problem is many users install a 2nd copy, but do not know.... My idea (but I havent…
Martin wroteThe problem is many users install a 2nd copy, but do not know....
True.
My idea (but I havent got the time) would be: - lazarus remembers it's own exe-path in the enviroments-options.xml - if the exe path changes, lazarus gives a warning (can be switched off)
Why not simply do something similar to what Mozilla did (accessible via --ProfileManager), but build it into 'startlazarus' somehow...eg: buttons on the splashscreen or something. So that startlazarus can prompt you for which "profile" you want to load up. You should also be able to add new profiles from that screen. That way you can possibly have one Lazarus icon on you desktop which can launch multiple profiles.
Regards,
- Graeme -
Well, definitely not on Unix. On unix, the EXE directory should never contain config…
I dare to disagree. A SVN checkout is writeable, and this is where the EXE is stored, along with the related source files. Consequently the config should be stored there as well.
You seem to think of a standard Lazarus installation in some protected directory. In this case it should do no harm when that directory does *not* contain any config, whereupon the IDE will search other places.
DoDi
2011/3/30 Hans-Peter Diettrich : Always specify the primary config directory, if you have…
I think it would avoid a lot of trouble if e.g. lazarus put a version number (FPC, Lazarus?) in the central xml file (environment?), and if the number not matches, ask to upgrade or write a new config.
There is some version number, but it looks more like the format of the XML file.
I just encountered a nasty problem: When I have multiple Lazarus installations (trunk,…
On Wed, Mar 30, 2011 at 12:00 PM, Hans-Peter Diettrich <
I used my own patch for windows
http:/msg07179.html
Regards
?
?
Zaher Dirkey hat am 30. M?rz 2011 um 14:26 geschrieben:
?
Related:
Last week I add a check to test if the given Lazarus directory has the same main version as the IDE. It checks 0.9.31. It does not check the svn revision. If the version does not fit it shows a setup dialog. This should help to spot some of such errors.
?
?
?
When you only have one: just start.
When having multiple: use --pcp.
?
?
The installers sets the icon/menu entry to start "startlazarus". You can give it the command line parameter --pcp.
startlazarus reads the config and starts either the default installed Lazarus executable or the custom built Lazarus executable (the one with your installed packages). Under Windows it also renames the newly created IDE executable. ?
?
> Where does the IDE look for the configuration?
?
If no --pcp is given it uses
Under windows:
PrimaryConfigPath:=
ExtractFilePath(ChompPathDelim(SysToUTF8(GetAppConfigDir(False)))) + 'lazarus'; all other:
~/.lazarus
?
If no --lazarus-dir option is given the Lazarus source directory is taken from the environmentoptions.xml.
If there is no environmentoptions.xml it is copied from the secondary config directory.
The default for the Lazarus directory is under windows: DefaultDrive + '\lazarus';
all other:
The IDE searches in a list of common directories.
?
Each distribution/installer adds some gory details. For example to explain all the paths of the debian packages would require at least one wiki page on its own.
The basic Lazarus setup is pretty simple, but you can do it arbitrarily complicated.
?
?
?
I'm not an expert for the windows installer, but the IDE sources do not mention 'cfg'. I guess "cfg" is not used.
?
?
?
... which might be read only and therefore only contains the defaults, not the user settings.
?
?
?
Yes.
?
?
?
It uses "make" with some parameters to compile. If the output directory is read only it passes a parameter to redirect the output to a sub directory (bin) of the pcp. And because Windows locks the running exe the IDE redirects the exe name, which is then later renamed to the final name by startlazarus. ?
?
> Which directory is used for the sources,
?
The Lazarus directory.
?
?
> and for storing the new (compiled) IDE?
?
It the Lazarus directory is writable the output is created there, just as if you use "make" yourself.
If not, it redirects it. See above.
?
?
Vincents already answered that.
Mattias
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110330/d618a00c/attachment-0001.html>
I dare to disagree. A SVN checkout is writeable, and this is where the EXE is stored,…
But that is only where to search:
- That is: IF there was a config in the local director, then yes maybe it would be good to use this local config
- Except: people who had lazarus for a long time, and kept upgrading, may still have an old 0.9.24 config there => and that may be very outdated, so that would not be good either.
It doesn't solve the problem for newbies.
An SVN checkout has no config files in the beginning.
So if the IDE starts without any config file (let's assume, there are none in the default location either); then the IDE must decide where to create them.
And that is in the default location.
Defining some rule where new config will be autocreated, sometimes here, sometimes there... IMHO the worst idea ever...
So, even if the IDE was scanning the local dir first, users who want 2 or more installs would have to know that they must hand-create (or otherwise force) this local config before they use the 2nd install. (currently it is knowing the --pcp switch).
Either ways, users who do not know, will be in trouble...
Martin
? ? Zaher Dirkey hat am 30. M?rz 2011 um 14:26 geschrieben: ? Related: Last week I add a…
Why only chec the version?
why not check, if the lazarus.exe is in the same folder, as it was the on the previous run?
an lazarus.exe in a new/different folder is very likely in need of it's own config.
---
btw, I just saw that conf dialog: very cool
Martin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110330/8c66ba8a/attachment.html>
I dare to disagree. A SVN checkout is writeable, and this is where the EXE is stored,…
No, no and once more: no.
This is a typical Windows user reasoning which is total nonsense on unix. You should never ever leave a config file or an executable in a source directory, it's plain wrong to do so. I don't know a single unix application that does this.
Config files belong in 1 of 3 places:
under /etc/myapp
under ~/.myapp
under ~/config/myapp
If you want to support multiple configurations, create subdirectories of these directories, period.
Don't try to force Windows habits on Unix users.
Michael.
Don't try to force Windows habits on Unix users.
Beware!
It's more a single user versus multi user mindset. And it is a memory optimization, by having the same executable on disk, and in memory, for multiple users.
It has also the downside that, for it to be effective, it forces all the users to use the same version of each application.
Paulo Costa
No, no and once more: no. This is a typical Windows user reasoning which is total…
Maybe Lazarus should simply come with a sh script and a batch script, which would do:
./startlazarus --pcp=./config
and
startlazarus.exe --pcp=config
They could be called: singleuserlazarus.sh and singleuserlazarus.bat
?
?
Felipe Monteiro de Carvalho hat am 30. M?rz
2011 um 16:20 geschrieben:
It's not only for single user.
Maybe better localconfiglazarus?
Mattias
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110330/ccf8b49a/attachment.html>
2011/3/30 Mattias Gaertner :
It's not only for single user. Maybe better localconfiglazarus?
Indeed, that's a better name.
This will be the common configuration, that only can apply to *one* installation. As long…
?
?
Hans-Peter Diettrich hat am 30. M?rz 2011 um 17:29 geschrieben:
[...] What's the purpose of specifying a Lazarus directory, other than the one with the IDE??
I guess, with 'IDE' you mean the lazarus executable. This executable may be in the config directory, when the Lazarus directory itself was not writable.
And you can debug the IDE with another IDE.
?
?
[...] Why do you see complications all around? What's so complicated in removing the "Lazarus directory" entry from the stored entries, and replacing it (at IDE start) with the EXE directory??
Removing options is always easy for the implementor, but not for the users. ?
Felipe gave a simple solution.
?
No, no, it's easy to understand. You want something existing except for some part. You have a different opinion about the defaults.
Mattias
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110330/bb62f778/attachment.html>
? ? Zaher Dirkey hat am 30. M?rz 2011 um 14:26 geschrieben: ? Related: Last week I add a…
This will be the common configuration, that only can apply to *one* installation. As long as we consider only that single installation, *everything* is acceptable for the config path.
What's the purpose of specifying a Lazarus directory, other than the one with the IDE?
IOW is there a purpose for specifying a Lazarus directory other than the one with the IDE?
If not, that directory must not be stored anywhere, making a single configuration usable with multiple installations, and every installation uses its EXE path for the Lazarus directory. That's perfectly compatible with the commandline (make all...).
Why do you see complications all around? What's so complicated in removing the "Lazarus directory" entry from the stored entries, and replacing it (at IDE start) with the EXE directory?
Okay, name it as you like. The config directory name only must not conflict with any name in a Lazarus directory.
In which case the IDE is free to look somewhere else. All I want is stopping the IDE from looking somewhere else, when the EXE directory contains a config directory (of a name to be specified). Is that so hard to understand?
DoDi
No, no and once more: no. This is a typical Windows user reasoning which is total…
I'm sorry, but I disagree. There are not three but FOUR places, where the first one is the information built into the executable during compilation.
If the implicit information in the executable (version of the compiler and location of the lazarus directory) doesn't match what's explicitly in the configuration files then the user needs to be told- this is not usually something which can be silently overridden.
The point was where to put "config files". That every binary contains defaults is a given.
Michael.
But that is only where to search: - That is: IF there was a config in the local director,…
But that is only where to search: - That is: IF there was a config in the local director, then yes maybe it would be good to use this local config
That's what I want.
- Except: people who had lazarus for a long time, and kept upgrading, may still have an old 0.9.24 config there => and that may be very outdated, so that would not be good either.
The config typically is updated on every IDE termination. I don't see how that would cause problems. In contrast *automatic* use of *newer* configs will prevent recompilation of the IDE, due to breaking changes in the FPC.
It doesn't solve the problem for newbies.
Which newbie problems are solved with the current procedure?
An SVN checkout has no config files in the beginning.
In which case the old (common) config will be used - with unknown outcome. On my working system the default config stems from 0.9.28 (FPC 2.2.4), and consequently is unusable with newer Lazarus checkouts. Newbies may have that problem with outdated installations, too.
So if the IDE starts without any config file (let's assume, there are none in the default location either); then the IDE must decide where to create them. And that is in the default location.
An SVN checkout has no IDE/EXE, so that it must be built using Make. The settings for FPC and the current directory should be enough to build a new config, in the current directory.
Defining some rule where new config will be autocreated, sometimes here, sometimes there... IMHO the worst idea ever...
ACK, the simplest solution should take into account all real-life cases.
Let's separate the corner cases:
1) Installation from distribution packages (snapshot, deb, rpm) --------------------------------------------------------------- The installation may end up in a privileged directory, what IMO is a bad idea. The Windows installer (and snapshots) already install Lazarus in a non-standard directory (C:\Lazarus), just to prevent trouble with access rights. The same could be made the standard on other platforms. Otherwise the config can be stored in the default place, i.e. ~/.lazarus on Linux.
2) Snapshot installation
------------------------
IMO snapshots should always install into user-land, because they are subject to updates/overwrites. I.e. we have a writeable Lazarus directory for storing the config.
3) SVN installation
-------------------
The checkout must be bootstrapped, with meaningful FPC settings. Here I like the Windows snapshots, that come with their own FPC, so that everything can be setup from and in the new Lazarus directory (used for Make).
In all these cases [1..3] we'll have to consider what will happen on a second install. Here I see a need to *split* the configuration, into general and version specific items:
A) FPC source and binaries
--------------------------
The last used version may be reusable, but after dramatic changes the user has to choose the FPC version to use. Error messages should be sufficient to let the user know when to switch to a different FPC version.
B) Other binaries (Make...)
---------------------------
These should always be reusable, subject to a default config.
C) Lazarus source and binaries
------------------------------
These are always private to an installation, and consequently cannot reside in the default config.
D) IDE history
--------------
Filenames, projects and packages contain path information, so that these are incompatible across multiple installations. No such information must reside in the default config.
E) User settings and additional (non-standard) packages ------------------------------------------------------- These also can be stored in a default config, provided that the config format is compatible across Lazarus versions!
These different requirements suggest to me a config separation into:
- machine specific (default FPC config?)
- user specific (default config)
- version specific (config in every single Lazarus directory)
- project specific (stored together with every project)
Conclusion:
A single config directory doesn't make sense!
Some settings have to go into a common (default) config, others have to go into a version specific config,
and project configs can override some of these settings.
DoDi
No, no and once more: no. This is a typical Windows user reasoning which is total…
Reality check, please!
Your considerations apply to standard installations only, not to SVN checkouts. Standard installations, regardless of the OS, should have separate *and versioned* places for sources, binaries and settings.
Bullshit :-(
Windows suffered, and still suffers, from a monolithic registry - and this exactly is what you suggest with version-subdirectories.
SVN checkouts and other experimental stuff should reside in user-land, fully contained inside their own directory tree, so that they are independent from any parallel installations.
Don't try to force Windows habits on Unix users.
I'm not Windows multiple versions of the same
application are installed, every installation must have its private configuration. So it's only natural to keep that configuration together with the source and binaries, in user-land.
DoDi
Beware! It's more a single user versus multi user mindset. And it is a memory…
Right, and Lazarus is in what category???
In a multi-user environment (company network) an administrator will manage all shared resources. In this case it makes sense to have user-specific configurations separated from the other (read-only) resources. Such environments will have only one Lazarus installation, and no user will be ever allowed to modify or rebuild his local Lazarus copy.
In all other cases (99.99%) of the Lazarus installations a single user will use one or more copies of Lazarus, and should have best control over his isolated copies. He must be able to update and rebuild Lazarus at any time, even without administrative rights, what defeats the installation of Lazarus in a protected directory or, even worse, in multiple directories all over his machine, tied together by links and artificial rules :-(
IMO the multi-user paradigm *only* applies to the official Lazarus releases, if ever, while the SVN checkouts should support isolated installations by default.
DoDi
Beware! It's more a single user versus multi user mindset. And it is a memory…
This is not true.
Afaik all *nix package systems (ports, rpm, deb) support building install trees in user's directories.
I do this regularly with ports.
It is also not uncommon on big multiuser systems to have prefixes for groups of users.
The only problem that I know with that is that there is no guaranteed paramstr(0) on unix. This means that in such cases, the app will have to be compiled with the specific prefix compiled in. Not a problem for source based install systems (like ports). Harder with the binary systems.
The problem is many users install a 2nd copy, but do not know.... My idea (but I havent…
My idea (but I havent got the time) would be:
- if the lazarus directory was not given on the command line and if the exe is in a lazarus directory
and the setup directory is a different one,
lazarus shows the setup dialog.
- Since startlazarus passes the command line options too, it must do the check too.
If a user runs 2 installations he will be warned Same if the user moves the installation, which imho is ok
Mattias
Reality check, please! Your considerations apply to standard installations only, not to…
I think this applies to you more than to me :-)
Your considerations apply to standard installations only, not to SVN checkouts.
Try compiling any unix application from source (be that from CVS, SVN or a .tar.gz). Then check whether it takes its config files in the directory *where it was compiled*, as you propose. You will see that no such thing exists on unix.
For really configurable tools, you get a command-line option to specify a location, different from the default /etc or ~/.yourapp.
Lazarus has such a command-line option, see the mail of Vincent.
Michael.
You all repeat another discuses, while the end user like me, still have problem to share him config espicialy for IDE.
The real question, without using command line how to share config file between Windows and Linux at the same computer, (export/import it is bad idea).
Let me point where is my config files.
And another problem u must care about it that not all config setting suite for Linux if i made it in Windows
Why it is bad idea if i put head config file in the config directory (whatever it placed) to forward the config dir to another one?.
On Wed, Mar 30, 2011 at 9:01 PM, Michael Van Canneyt <
You can place the config path wherever you want. See:
http://wiki.lazarus.freepascal.org/Multiple_Lazarus#The_config_directory
So you can use
lazarus --primary-config-path=/my/shared/config/directory/for/lazarus
or
lazarus --primary-config-path=/my/private/settings
This, combined with some windows batch files or desktop shortcuts, will cover almost anything you are likely to encounter.
The only point I was trying to make is that on UNIX (and only on Unix) looking by default in the directory where the binary is, goes against long-standing unix practise and recommendations. No unix tool does this. Not even when it is freshly (re)built from sources. And neither should Lazarus.
I claimed no more, no less.
Michael.
On Thu, Mar 31, 2011 at 12:17 AM, Michael Van Canneyt <
I already have this answer before. this command line params, that mean i must make shortcut for it, and i am not sure if lazarus will take it when rebuild packages and restart.
I am sure there is tool use Environment to change the workspace place in linux/unix.
No, no and once more: no. This is a typical Windows user reasoning which is total…
+1000000
+1000000
Don't try to force Windows habits on Unix users.
+1000000 and lets see about teaching winwhatever users about this and how it should actually be done... m$ has finally gotten some of the right idea(s) and does, now, provide similar directories for similar purposes... ie: documents and settings which leads to specific user directories with "local" directories containing certain installation specific files like these ;)
On Thu, Mar 31, 2011 at 12:17 AM, Michael Van Canneyt < I already have this answer…
Zaher Dirkey wroteI already have this answer before. this command line params, that mean i must make shortcut for it, and i am not sure if lazarus will take it when rebuild packages and restart.
I use Lazarus with the --pcp=SomePath from a Desktop Shortcut under Windows (and Linux).
When I rebuild the IDE I tend to do that from commandline, but last time I accidentally rebuild the IDE from the Tools-Rebuild menu, and Lazarus started back up again with all my settings that are stored in "SomePath". So this seems to work...
Just try and see what happens, it will NOT break your Lazarus...
Bart
Yes, lazarus passes the pcp, scp and lazarus dir parameters to startlazarus and that back to lazarus.
Mattias
I think this applies to you more than to me :-) Try compiling any unix application from…
Please note: your assumption about Windows is absolutely wrong.
Please don't shift the context :-(
It doesn't matter how an application came to a machine, as long as only the latest version of it is used.
Try compiling different versions of any unix application - this is where repository checkouts enter the scene. And then try to use all these versions in parallel...
(be that from CVS, SVN or a .tar.gz). Then check whether it takes its config files in the directory *where it was compiled*, as you propose. You will see that no such thing exists on unix.
This is the typical situation, also on Windows. And we all know that this is not suited for working with multiple versions in parallel :-(
For really configurable tools, you get a command-line option to specify a location, different from the default /etc or ~/.yourapp. Lazarus has such a command-line option, see the mail of Vincent.
Right, but this is only a workaround, that requires much care in making it work. Did you ever notice the many error messages and warnings, at the first start of a another Lazarus installation, when it tries to initialize itself from an inapplicable default configuration?
Just the newbie, and even the average user, should not be burdened with remembering the location of the configuration, that applies to every single Lazarus installation. No wonder why many peoply consider Lazarus still unusable, when another try to install and use the current Lazarus version fails miserably, because it uses the configuration left over from a previous try :-(
DoDi
You all repeat another discuses, while the end user like me, still have problem to share…
You all repeat another discuses, while the end user like me, still have problem to share him config espicialy for IDE.
IMO the current config is not shareable, due to the many absolute pathes in it.
The real question, without using command line how to share config file between Windows and Linux at the same computer, (export/import it is bad idea). Let me point where is my config files.
You can do so, if you like, but nobody should assume that other users will like it this way, too.
And another problem u must care about it that not all config setting suite for Linux if i made it in Windows
Just my argument for splitting up the config, into something like shareable IDE settings (layout, shortcuts...), and machine or installation settings (with pathes).
Why it is bad idea if i put head config file in the config directory (whatever it placed) to forward the config dir to another one?.
Forward to what/where?
Currently I have to locate the default configuration directory, what's not so easy on Windows, and move or rename it, before I can e.g. install another snapshot or branch. Then I have to update the desktop shortcut of the previous installation, to use the moved or renamed config. For simplicity I decided to have all my configurations in a cfg subdirectory, in every Lazarus directory, so that I don't have to remember arbitrary pcp pathes. This way I can backup and restore installations easily, because the config is saved and restored together with the Lazarus directory.
DoDi
You can place the config path wherever you want. See:…
The only point I was trying to make is that on UNIX (and only on Unix) looking by default in the directory where the binary is, goes against long-standing unix practise and recommendations.
Depends on what you consider UNIX. I understand that ParamStr[0] may get into the way, when a process has no chance to find out where it resides on disk.
No unix tool does this. Not even when it is freshly (re)built from sources. And neither should Lazarus. I claimed no more, no less.
I never said that Lazarus should *break* that convention.
I only want a chance for removing the *need* for the explicit specification of an pcp, on every Lazarus invocation. It won't break anything and requires only a few lines in source code, when the IDE searches for a config in the EXE directory, before starting the standard search.
DoDi
If the convention is to "never do it", and then below you say, it's only a few lines of code, in order to do it, then I don't see the you "never said"....
Anyway, another point.
This whole discussion seems to mix 2 issues into one:
- problems caused by using the wrong config due to none awareness (imho the main issue)
- convenience of using multiply configs.
Searching for config files in the exe dir (even if done) doesn't solve the first issue, as there may not be any config files in that directory to start with.
In this case the unaware user is still screwed.
And even if there are config files there, the unaware user, may just have started a 2nd build (with different set of installed packages), by copying another lazarus dir, and moved config files into the new dir, which have values pointing back to the old dir, causing problems again.
Only checking, if the config files match the current installation can solve that.
AFAIK Mattias added a version check.
IMHO for example any error about installed/not found packages at start up, could also offer to run the setup dialog again (and point out which config is used / warn about a potential conflict)
Only when the user is aware of the need to properly set up several config dirs, the convenience of using them comes into play.
Please note: your assumption about Windows is absolutely wrong. Please don't shift the…
Hans-Peter Diettrich wroteTry compiling different versions of any unix application - this is where repository checkouts enter the scene. And then try to use all these versions in parallel...
I do this often, and have no problems. Why? Because the apps I use (in this example Mozilla Firefox), supports just like Lazarus a parameter to say which "profile directory to use". So when I run Firefox 3.x in uses the default profile directory. When I run Firefox 4.x beta, it uses the profile directory I specified in the command line (or in the desktop shortcut settings).
I do the exact same thing with Lazarus (trunk) and Lazarus 0.9.30.x (fixes). I don't have any problems.... so I'm a bit confused really what this whole message thread is all about. Have two or more desktop icons... each pointing to a specific version of lazarus, and each with a --pcp parameter.
Regards,
- Graeme -
That's only the very last step. But how do I construct such a configuration before?…
?
?
Hans-Peter Diettrich hat am 31. M?rz 2011 um 13:50 geschrieben:
Yes. The wiki text was once true. Nowadays the Lazarus sources contains a lot of packages that changes more often, so it is no longer advisable to share a config directory between two versions.
?
[...] IMO this page deserves an update, to reflect the current state and opinions of the contributors to this thread.?
I will update the wiki.
?
Mattias
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110331/83214180/attachment-0001.html>
IMO the current config is not shareable, due to the many absolute pathes in it. You can…
Hans-Peter Diettrich wrote> problem to share him config espicialy for IDE. IMO the current config is not shareable, due to the many absolute pathes in it.
Interesting. How did you test this? Did you try the lazarus-dir parameter approach? IIRC one can make everything relative to lazarus-dir and then pass lazarusdir on the cmdline (though that is mainly meant for portable versions, the problem is the same).
The only problem I see is that fpc will have to be installed in the lazarus dir everywhere.
I don't think this is very usuable for really complex situations, but could be useful for a little test.
Just my argument for splitting up the config, into something like shareable IDE settings (layout, shortcuts...), and machine or installation settings (with pathes).
I think this is horrible complication of afairs without much benefit, morever since usually most multiple lazarus installations will span multiple versions, it is flat out unworkable.
Currently I have to locate the default configuration directory, what's not so easy on Windows, and move or rename it, before I can e.g. install another snapshot or branch.
I never use the global dir. I simply use a batchfile to start lazarus that sets --lazarus-dir and pcp.
I think that if you want to fix issues like this, the installer is the place to work. It should allow "advanced" or movable installs.
2011/3/30 Hans-Peter Diettrich : Always specify the primary config directory, if you have…
That's only the very last step. But how do I construct such a configuration before?
Thanks for this link - as is, it fully supports my opinions :-]
>
The config directory
[...]
The config directory can be shared between different lazarus. [...]
<<
I wonder how this should work, when the abolute path to the Lazarus directory is stored in the config (environmentoptions.xml), and the loaded packages are built into the IDE executable. IMO the same config can be used only for Lazarus versions, that are compiled from the same Lazarus directory, e.g. for a debug and release version of the IDE itself.
>
The lazarus files
The normal Lazarus is only one directory. Just copy this directory and get a whole new lazarus. The normal lazarus can be downloaded as zip or from svn. When you compile this lazarus all files will be created in sub directories of this directory.
You don't need to 'install lazarus. But if you install lazarus you get some nice shortcuts on your desktop and some files are associated. These things are platform dependent and there is always only one lazarus installed. The official installers do not support to install lazarus multiple times. But you can add another lazarus manually quite easily. <<
The first paragraph favors the "all-in-one-directory" scheme, and the second one points out that only a single installation is really supported.
IMO this page deserves an update, to reflect the current state and opinions of the contributors to this thread.
DoDi
Please note: your assumption about Windows is absolutely wrong. Please don't shift the…
Sorry, but a newbie shouldn't juggle with a bunch of lazarus installations of different versions in the first place. Either you know what you are doing, or you don't. In the latter case: stay away from it until you do :D
I don't say it would be nice to have a friendlier solution, but it's definitely not that important - there are more important things than supporting multiple concurrent installations out-of-the-box (in a newbie-friendly way).
However, it is indeed very important to verify the validity of the configs, since the case you mentioned (upgrading lazarus and then having the wrong compiler paths etc.) is not that uncommon and indeed can hit newbies pretty hard.
If the convention is to "never do it", and then below you say, it's only a few lines of…
?
?
Martin hat am 31. M?rz 2011 um 13:22 geschrieben:
[...] This whole discussion seems to mix 2 issues into one: - problems caused by using the wrong config due to none awareness (imho the main issue)?
+1
?
Then the IDE creates defaults.
?
In this case the unaware user is still screwed.?
Why do you think he is screwed?
?
?
?
And even if there are config files there, the unaware user, may just have started a 2nd build (with different set of installed packages), by copying another lazarus dir, and moved config files into the new dir, which have values pointing back to the old dir, causing problems again.?
Since 0.9.29 packages in the Lazarus directory are stored relative. Changing the Lazarus directory will load the lpk files of the new Lazarus directory. lpk files outside are used from the old positions. ?
?
?
Only checking, if the config files match the current installation can solve that. AFAIK Mattias added a version check.?
I added a check for the ide/version.inc.
Configs from another version are quietly loaded and updated. Maybe a check could be added to warn if the environmentoptions.xml is from a future Lazarus with two options: Quit and continue. ?
?
IMHO for example any error about installed/not found packages at start up, could also offer to run the setup dialog again (and point out which config is used / warn about a potential conflict)?
Yes.
?
?
Only when the user is aware of the need to properly set up several config dirs, the convenience of using them comes into play.
Mattias
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110331/b946fd40/attachment.html>
No. This is:
- if a search in the exe-dir is added, (so the the behaviour will be: search exe-dir, search global-conf dir)
- if a global config exists
The IDE will search the exe dir, will not find a config, will find the global conf
If no global conf exists, it will search all places, and then create the globa conf
> In this case the unaware user is still screwed. Why do you think he is screwed?
Because if the user is unaware, and never creates a config by hand, or forces it into the exe dir, then he./she always ends up with a global conf.
So searching the exe dir first, doesn't help. (unless the user is aware, but an aware user can use -pcp too)
if they exist...
if a user installed lnet, in his lazarus dir, it may not exist in another laz dir...
Imho on any conflict:
- diff version
- diff last exe path (doesn't work on linux, since recompiled exe goes into user dir)
- missing package source
the user should be:
- informed which config is used
- offered to create a new one, in a new place (run some kind of profile manager)
=> and be told how to load this.
- offered to load a diff config
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110331/c5a72b74/attachment.html>
Sorry, but a newbie shouldn't juggle with a bunch of lazarus installations of …
What about a casual user, who is somewhat familiar, usually runs and uses stable snapshots of both FPC and Laz and wants to try new Lazarus/FPC pair version without removing the old one first (e.g. using lazarus from SVN) to see whether his program will still be compiling/running, even if he's not going to put this version of Laz/FPC into production YET...? (and, not willing to use another physical/virtual machine for this purpose...) (trivial example : Juha's work on Lazarus interface... or the new features of FPC 2.5.X)
I'd like to try that, but >for me< the threshold is a tad too high to understand and perform this in say 15 minutes, on a non-trivial project? (here I assume I will do a special SVN checkout of my project to a different working directory, intended only for non-production use)
I don't say it would be nice to have a friendlier solution, but it's definitely not that important - there are more important things than supporting multiple concurrent installations out-of-the-box (in a newbie-friendly way).
See above. I'd happily try even SVN of FPC/Laz without it eating up my production environment.
Not just any newbies. Maybe just newbies-to-Lazarus-development, that.
L.
If the convention is to "never do it", and then below you say, it's only a few lines of…
This whole discussion seems to mix 2 issues into one: - problems caused by using the wrong config due to none awareness (imho the main issue) - convenience of using multiply configs.
The first problem disappears as soon as a config resides in the Lazarus directory, next the EXE file. Then Lazarus will definitiely use that config, and nothing can be screwed up by omission of a pcp.
The second problem seems to be the *need* for using a dedicated config for every Lazarus installation. Using the same installation with different configs looks as weird to me, as using multiple installations with the same config.
Searching for config files in the exe dir (even if done) doesn't solve the first issue, as there may not be any config files in that directory to start with. In this case the unaware user is still screwed.
This situation is not different from the current one.
And even if there are config files there, the unaware user, may just have started a 2nd build (with different set of installed packages), by copying another lazarus dir, and moved config files into the new dir, which have values pointing back to the old dir, causing problems again.
You see what weird ideas a user can have, once he encounters problems with another installation? :-(
Only checking, if the config files match the current installation can solve that.
This cannot solve anything, except alerting the user that something's screwed up.
AFAIK Mattias added a version check.
I don't see what should or could be checked at all, when the EXE doesn't reside in its Lazarus directory.
IMHO for example any error about installed/not found packages at start up, could also offer to run the setup dialog again (and point out which config is used / warn about a potential conflict)
The problem occured when *no* config directory was specified on setup, and the setup decided *not* to overwrite the existing (default) config.
Setup better should know (no need to find out) that an already existing config cannot be reused without modifications.
Only when the user is aware of the need to properly set up several config dirs, the convenience of using them comes into play.
That's why I don't like the *need* to create, maintain and specify multiple configs in the first place :-(
DoDi
No, well only if....
...let me explain a bit more what I tried to explain before (and had in my last mail too)
It would only help, if you totally abandon all global config. don't even look for a global anymore, only check the exe folder, nowhere else.
But if the search order for config would be:
- exe-dir
- global as current
Then as soon as a global config exist you are back to were you are now.
- download a new lazarus, into some folder "lazfoo"
- now lazfoo does not yet contain config, but the global folder does.
so in your way, one has to first create a config in lazfoo. This is an explicit action the user must undertake, same as adding the -pcp.
=> But if the user is unaware of the issue, he will not ad that config to lazfoo, and run with the global config => same as now
Let me guess, now you say, then every lazarus should come with a local config?
That is the same as abandoning the global config completely (because if always a local conf exists, it will always use the local, never the global) => but the proposal was an optional local, that would be found first, if and only if present.
So were (or how) exactly, in which scenario, does an additional search for a local config actual help the unaware user?
Sure, once you know,it may be more convenient to some, but a startup script is no less convenient to most.
? ? Martin hat am 31. M?rz 2011 um 13:22 geschrieben: +1 ? Then the IDE creates defaults.
Where is that default config created, in the primary or secondary config path?
Since 0.9.29 packages in the Lazarus directory are stored relative. Changing the Lazarus directory will load the lpk files of the new Lazarus directory.
Ah! :-)
Does it really make sense to use a Lazarus directory, different from the one the IDE was built from?
If not, the build-path could be stored in the IDE, so that the Lazarus Directory must not normally be specified, and the IDE can use the correct directory automatically (variation of the EXE directory approach).
A bit more detailed: the Lazarus Directory (in the config) could be made automatic, by adding a checkbox "Use this Lazarus directory". When unchecked, the IDE uses the Lazarus directory from which it was built (and shows the selected path in the options dialog). In the rare cases where the Lazarus directory has been moved, this option can be used to specify the new directory, to be used in the next IDE rebuild.
The checkbox could be initialized automatically, to unchecked when a valid config was found, and to checked when an invalid config was detected. No need to store this new option in the config.
I added a check for the ide/version.inc. Configs from another version are quietly loaded and updated.
What exactly is updated?
(also see above suggestion)
Does this update permanently affect the stored config?
Maybe a check could be added to warn if the environmentoptions.xml is from a future Lazarus with two options: Quit and continue.
This problem suggests to use versioned configs, at least in the default config location, using the ide/version.inc. Then the config also could be splitted, into an common part in the config root directory itself (user preferences), and extensions or otherwise config/build specific settings in the version subdirectories.
IMO such a repair feature should be built into the IDE, so that it can be used even without an installer (which might be unavailable or may repeat the wrong initial configuring). It might become part of the startlazarus application as well...
DoDi
No. This is: - if a search in the exe-dir is added, (so the the behaviour will be: search…
If a global config is found, but is invalid/incompatible, a local config should be created.
The requirement for an explicit -pcp can be reduced to the single invocation, that shall create a new config. This job also could become a menu option, or an option button in the IDE settings dialog. Why press the user to specify a new pcp at the commandline, when the config always is created by the started IDE?
About primary and secondary config paths:
At least on my Windows the Lazarus directory is listed as the secondary config path. [I cannot check this for Linux, having only an old Lazarus version without display of the config]
This indicates to me that the IDE already is aware of the Lazarus (source or EXE?) directory, so that it can/should look there for a config anyway, before looking into the default directory.
I'm confused about the use of the secondary config path. In which case is this path used at all?
When I copy e.g. environmentoptions.xml into the scp, the IDE still seems to load the config from the default location (when started without -pcp).
- offered to create or update an according desktop icon
- offered to load a diff config
DoDi
Interesting. How did you test this? Did you try the lazarus-dir parameter approach? IIRC…
It bites me whenever I try to start any IDE without or with an empty pcp :-(
Now I've learned that I should exit the IDE after such startup problems, before consequential damage can occur. It's very inconvenient then, when I don't check the path of the source files, loaded into the editor, and start editing files in the default Lazarus installation :-(
Did you try the lazarus-dir parameter approach?
What's that?
IIRC one can make everything relative to lazarus-dir and then pass lazarusdir on the cmdline (though that is mainly meant for portable versions, the problem is the same).
As suggested in a parallel mail, the IDE could include the Lazarus directory path from which it was compiled. This would eliminate the chance for loading inappropriate files (lpk...) from a different (inapplicable) installation.
The only problem I see is that fpc will have to be installed in the lazarus dir everywhere.
The detached FPC is a big mess :-(
I'd prefer to indicate both the fpc binary and source path in a single reference, by e.g. pointing to the according fpc config.
Similarly for the Make path, when an installer didn't put all required tools into that bin directory (maybe a Windows-specific problem). That's why I still have to specify the fpc 2.2.4 bin directory for Make (which came with Lazarus 0.9.26). That's confusing, because that directory is in the global PATH, but Run issues error messages about tools not found, when I specify an different path for Make. Maybe a 32/64 bit issue, because the old (complete) bin directory is for 64 bit, while I found it less complicated to build all projects for 32 bit (the fpc default on a 64 bit Windows!). AFAIR the show stopper was the debugger, which I couldn't make work for 64 bit apps.
Huh?
Just when multiple versions are installed, the user settings (language, shortcuts...) should be shareable.
That's amusing ;-)
First everybody claims that a common config in the default place is a must, then you say that you don't use that config. So it's not only me who wants simplified procedures for using multiple Lazarus versions in parallel?
I think that if you want to fix issues like this, the installer is the place to work. It should allow "advanced" or movable installs.
Which installer do you mean, for SVN checkouts???
It would help a lot, when a SVN checkout would start out-of-the-box, after Make, without any special configuring. As already mentioned, eventual non-standard behaviour could be made specific to non-release builds.
DoDi
I do this often, and have no problems. Why? Because the apps I use (in this example…
[...]
You possibly forget that then you'll have to initialize all those added configs, and when you want to change something, for all installations, every single config has to be edited - a maintenance nightmare :-(
DoDi
Where is that default config created, in the primary or secondary config path? Ah! :-)…
?
Hans-Peter Diettrich hat am 1. April 2011 um 05:46 geschrieben:
[...] Where is that default config created, in the primary or secondary config path??
It seems you don't know what the secondary configs are. The secondary configs are templates for the primary configs. The installers and administrators can create templates.
?
?
Yes.
It depends on your workflow, so it does not make sense to every one. ?
?
If not, the build-path could be stored in the IDE, so that the Lazarus Directory must not normally be specified, and the IDE can use the correct directory automatically (variation of the EXE directory approach).?
Does not work with installers.
?
?
I think even the eclipse solution of always asking for the workspace is better than this.
?
?
> The checkbox could be initialized automatically, to unchecked when a valid config was found, and to checked when an invalid config was detected. No need to store this new option in the config.?
I think there is a general problem with these "tests for valid config": Either the test is exact and it will show "invalid" after every rebuild of the IDE or the test is fuzzy and will not work in some situations. ?
?
The config loading functions check the config version and contains heuristics to map old values to current values. On saving the config to disk the new version is created.?
?
?
(also see above suggestion) Does this update permanently affect the stored config??
Yes.
?
?
There is no common idea what settings are "common" and which ones are not. Ask 2 users and you will get 3 answers.?
Use --pcp if you want multiple versions.?
?
?
?
Dito.?
Mattias
?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110401/bd8df7be/attachment-0001.html>
If a global config is found, but is invalid/incompatible, a local config should be…
?
Hans-Peter Diettrich hat am 1. April 2011 um 06:23 geschrieben:
[...]? If a global config is found, but is invalid/incompatible, a local config should be created.?
Define invalid.
?
?
Windows does not have a location for application config templates. The first windows laz devel has set the scp to the lazarus directory for windows. No one has changed/questioned this yet.
?
?
[...]?
?
Mattias
?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110401/26f2e02b/attachment.html>
It bites me whenever I try to start any IDE without or with an empty pcp :-( Now I've…
+1
+1
DoDi
L.
If a global config is found, but is invalid/incompatible, a local config should be…
sounds good at first, but is actually worse.
Because this behaviour is unpredictable from the end users view.
Rules for "invalid/incompatible" may be complex. They may not always apply, even if the user hopes for.
In fact they may change, later. 2 installations that have shared the global conf for a long time, may become "invalid/incompatible" at some point (maybe only for a short time) => but then all the sudden one of them has a conf in the exe-dir => not good at all.
the requirement to create a script, is a single invocation too... where is the difference?
a profile manager, selectable from menu, could create this script for you (or the windows shortcut). Again where is the difference?
-----
btw , whith config in the exe dir => it can get really fuzzy.
if you have a link (or shortcut) to your exe, and there is config in the real exe-dir, and the link-dir... which one to take?
I think it's for backward compatibility? 0.9.24 had the config in the exe dir... so it must still be found...
+1
> - offered to load a diff config
[...] You possibly forget that then you'll have to initialize all those added configs,…
You possibly forget that then you'll have to initialize all those added configs, and when you want to change something, for all installations, every single config has to be edited - a maintenance nightmare :-(
Maintenance nightmare?
This starts to get ridiculous. How often do you change config per hand? Normally you do it from inside your programs. And if you really need to change many config files directly I heard perl is quite capable of parsing stuff and changing files. Rumor has it that even bash, batch files or higher level programming languages can be used to automate things you do not want to do by hand. Regarding Lazarus, if you talk about maintenance of two (or more) different Lazarus/FPC versions what is so hard about writing a start up script? Yes, the svn version will have problems if you have another lazarus installed and not specified a new config directory. As it sounds like that the config will be versioned there is no warns you at startup and you can give the command line option on next start. Btw I cannot stand the 'think of the newbies' argument anymore. Mess everything up to satisfy the needs of the unknown noob, no thanks. For me this discussion is a non issue. Config files in app directories are a no go, no discussion. Write two lines in the wiki (svn install) that you must specify a different config directory if you intend to use this install in parallel to another one. Newbie has problems, tell him to RTFM, issue solved. We are talking about software developers here not Joe User.
just my 2 cents
R.
Completely agree. There is a difference between a newbie in lazarus and a newbie in ms word. If a newbie in lazarus isn't capable of reading up or asking, then he will probably stay a newbie forever.
Henry
? Hans-Peter Diettrich hat am 1. April 2011 um 06:23 geschrieben: Define invalid. ? ?…
That's up to the (already existing) IDE code.
I'm only curious how the IDE can know about that directory, without reading an config file. That's why I assumed that the EXE directory is used for this path, so that the IDE could read a config from there.
BTW, my experiments indicate that putting an environmentoptions.xml into the Lazarus directory (scp) will make the IDE use these settings, but only if there exists no config in the default location. The full config then is written back to the *default* location (pcp), not into the Lazarus directory.
That's why I'd appreciate some information about the usage of the primary/secondary config paths by the IDE.
Why does the IDE store an updated config *always* in the default directory, instead in the same directory from which (parts of) the config have been loaded before?
DoDi
sounds good at first, but is actually worse. Because this behaviour is unpredictable from…
Unpredictable why?
Currently the results are unpredictable, when the IDE finds a config unusable, or does not find out, and produces consequential errors :-(
checks and solutions. I only can assist in improving the current state.
E.g. split the config into an always compatible (user preferences), and an installation specific part. This will allow to retain as much of the settings as possible, in case of problems somewhere else. Next offer the user a menu item, to save the config into the Lazarus directory (current scp), and later load from that location whatever config files are found there, before loading missing files from other locations.
The difference is, what the user must know about the script. When the IDE creates it, the user only has to know about the invocation of the script (filename or desktop icon), not about the contents of that script.
Then it's up to the creator of that link, to make it work as it should.
Windos "links" (desktop shortcuts) allow to specify the working directory, so it's up to the creator of the link to fill in that information. Console users on any system may create an equivalent script, and create links to that script instead of to the executable.
That's why I suggested to have the LazDir path stored in every compiled IDE, so that the EXE can be moved around freely.
> I'm confused about the use of the secondary config path. In which case > is this path used at all? I think it's for backward compatibility? 0.9.24 had the config in the exe dir... so it must still be found...
This special case requires an accordingly old FPC, due to the breaking changes in the FPC versions. This makes old configs and Lazarus sources unusable with a newer IDE, so that this feature can either be dropped or must be made work in the new model.
DoDi
? Hans-Peter Diettrich hat am 1. April 2011 um 05:46 geschrieben: It seems you don't…
That's why I'm asking ;-)
The secondary configs are templates for the primary configs. The installers and administrators can create templates.
There exist other opinions as well :-(
Where can I find the documentation for the templates?
Can you give at least one example?
Installers can do what they like, in order to make a binary installation work out-of-the-box. The distribution package creator already can build the binaries accordingly.
I think there is a general problem with these "tests for valid config":
ACK :-(
Either the test is exact and it will show "invalid" after every rebuild of the IDE or the test is fuzzy and will not work in some situations.
That's why a rebuild should make sure that the result will be usable, without *any* need for checks. The IDE can be built to contain all essential information, like the Lazarus and config directories, applicable to that specific build.
The overwritten config may become unusable with the Lazarus installation that created it. IMO the user should be asked whether it's okay to overrite, or where to store the updated config else. When the config is stored in a new location, this should be handled properly on the next start of the IDE.
It's not a matter of user opinions, but of the IDE requirements, which settings may deserve modifications (see your answer above).
Current (Windows) installers leave an existing default config untouched, so that all user settings are used in the new installation. What's missing is an adaptation of the installation-specific pathes (LazDir, FPC...), which consequently should always be stored in an non-shareable config part.
Another way for the specification of non-shared settings could be the existence of config files themselves. When a config file exists in the pcp, it will be updated there, otherwise all changes will go into the shared config. Then every advanced user can copy the desired files or directories into the pcp. The IDE only has to check for existing files, in order to know where to store every single updated file :-)
And finally all users *which don't want anything shared* can...
Use --pcp if you want multiple versions.
DoDi
No, well only if.... ...let me explain a bit more what I tried to explain before (and had…
Why that?
When multiple directories are in a search path, the search stops on the first item (file...) found. That's common practice, isn't it?
Something seems to be wrong with your list. Mine looks like this:
1) explicit -pcp
2) EXE dir (meaning the Lazarus dir from which the EXE was built)
3) global dir
The IDE already *is* clever enough to handle non-existing or inappropriate configs. Remains only to specify where the updated config should be stored.
=> But if the user is unaware of the issue, he will not ad that config to lazfoo, and run with the global config => same as now
When no global (default) config exists, the new config (eventually) can be stored there, else the obvious place is the Lazarus(~EXE) directory.
Perhaps we should separate two cases:
1) When the IDE can determine the Lazarus directory to use, then the entire (remaining) config *can* be stored in a common place. This applies at least to Windows.
2) When the IDE can *not* determine this, it must either look into an common place, or a pcp must be supplied on every invocation. This seems to apply to Linux?
Case [2] deserves no further considerations, no automatism can be added. But this is not a valid argument to force the users of more comfortable systems <BG> to suffer from poor UNIX functionality.
So were (or how) exactly, in which scenario, does an additional search for a local config actual help the unaware user?
The IDE can keep certain (required) modifications in the local config, e.g. an non-standard FPC required to compile this version. This compiler may be part of the installation, what's just the default in Windows installations.
Sure, once you know,it may be more convenient to some, but a startup script is no less convenient to most.
I have no problems with startup scripts, as long as I do not have to write them myself, must remember where I placed and how I named them, etc. ;-)
But I have a BIG problem with non-shareable configs. When I have to configure manually every new Lazarus installation, because it is too stupid to configure itself, or it overwrites the configs required for my other installations, then something is wrong :-(
Concrete example:
After every Lazarus checkout a couple of adaptations are required.
- For the bootstrap I have to update the PATH, to include the required compiler and tools, before I can invoke "make all". This is the point where that compiler *could* become the default for *this* installation.
- Next I *must* copy a config from somewhere else, create a desktop icon, and add the -pcp to it.
- Then, in the first run of the new IDE, I have to update the pathes to the Lazarus and compiler directories, copied from the old config. Then I must exit and restart the IDE, so that I can hope that it uses the updated config.
This may look not very complicated, but on the next checkout I have to remember all the details, what must be updated manually etc.
DoDi
That's up to the (already existing) IDE code. I'm only curious how the IDE can know about…
Already existing: file is readable and xml syntax is ok.
Yes.
See the include files in ide/include/*
Yes, that's what I meant with used as template.
If you want that you can set pcp and scp to the same directory.
Mattias
That's why I'm asking ;-) There exist other opinions as well :-( Where can I find the…
I explained how it is implemented. And I don't see anything bad about other opinions.
Where can I find the documentation for the templates?
There is not much to know:
The secondary have obviously the same format as the primary configs. The values depends on version. They are human readable xml and you should not edit them manually. Use the IDE to create/edit them.
I already gave the debugging example. Another is to have a second copy with a patched version, but using the normal lazbuild.
[...]
Mattias
Unpredictable why? Currently the results are unpredictable, when the IDE finds a config…
Because as I wrote a line further down:
"Rules for "invalid/incompatible" may be complex. They may not always apply, even if the user hopes for. "
Also I wrote "from the end users view. "
Someone knowning all the "rules" can predict, if the current config is "invalid/incompatible" or not.
But a "normal"/"les experienced" end user will not be able to predict that, for him it will look random what happens.
Note: I never said the current solution was perfect. But it doesn't need replacement by something that isn't any better.
Currently the results are unpredictable, when the IDE finds a config unusable, or does not find out, and produces consequential errors :-(
apparently it now comes up with one single setup dialog...
splitting may be a good idea. but is a new topic
Sorry, but I am not sure what you mean. Isn't that the idea of a script, just run it?
That wasn't the question. How should it?
Ok, "creator"? The end user, or the lazarus developper?
if the end user, then that is the same as --pcp, or scripts, the user has to set it up onc
if the laz-developer, then tyes, it is easy to implement some rule, but the bigger the set of overall rules grows, the more confusing for the usser...
Martin
Why that? When multiple directories are in a search path, the search stops on the first…
I explained below, but I do again.
In order for that to work, WITHOUT the user needing to be aware of doing anything. EVERY lazarus must come by default with local config. Then local config will ALWAYS be found, which is the same as having NO GLOBAL
If Lazarus comes without a local conf by default, then we are back to where we are now => a global copy will be created, and used
*** There is one option though, since we have the setup dialog => it could ask the user where (e.g. exe dir) to create the config.
BUT that is at best a partial solution.
Because, if a user installs a 2nd lazarus, it may not (yet) have a problem with the global config. However the use may then change it, and the glabal config gets updated. The global conf now is incompatible with the 1st/original installation. That is almost never what the user wants. the user wanted a new config for the 2nd installation. (but now the 1st install will ask about creating a new one).
Since the 2nd installation (if the config is compatible at the time of first startup) has no way of knowing there is another install, it just requires the user to tell it.
the explicit pcp dir makes no difference to anything that I said below
Yes, but see my above explanation
Well that leaves the question why almost every software has moved from exe config to global config?
Config in the user dir has many advantages. Various backup solutions will take care of it, user profiles that can be used accross many workstations.....
Well that's a new topic. If a profile manager was created, it could have the functionality of creating desktop shortcuts (including fro linux)
Though personally, on linux I never use the desktop, I always use a shell. And I have my own startup scripts for most apps that I use
But the config is currently shared? That was the whole point of this discussion.
With local/exe-dir configs, that problem remains/becomes bigger.
Otherwhise this is a change of topic: Keeping the config directory as it is, but make sure the data in the config will not conflict between installations
On Sat, 02 Apr 2011 00:45:56 +0200 Already existing: file is readable and xml syntax is…
Okay, that explains a lot :-)
Remains to mention that the "template" term has to be explained to the user. Normally a template is used to create *different* versions (installations) from it, but Lazarus - by default - does it the opposite way: templates are taken from an *installation*, and the result is put into a *common* place.
This behaviour makes sense only because -pcp overwrites the *common* place, so that effectively *no* place exists where common (installation-independent) templates or settings can be stored :-(
Now I understand why it is near impossible to convince the inventors of that model, that some users would prefer to have their common settings in an common place, while every single installation only should hold overrides of these common settings. The argument, that these users most probably will disagree about *what* should be common, is a valid one, so that it is the *simplest* solution for the Lazarus team to have everything in a separate config. Nonetheless that solution sucks :-(
That's not a solution of the problem, because then still no place exists, where defaults could be stored - they are overwritten when pcp=scp :-(
DoDi
Because as I wrote a line further down: "Rules for "invalid/incompatible" may be complex.…
My above rule is so simple, that just the *end user* must not know more.
In either case, when the *end user* has to adopt a config, he *must* know what he must change, or else the result *is* unpredictable. Whatever is updated automatically, by the IDE or installer, eliminates the need to know about just these issues.
IOW your argumentation is based on the unpredictable behaviour, that results from arbitrary changes to the config, while my argumentation is based on the unpredictable settings that have to be changed, in order to provide an *intended* behaviour.
All such argumentation IMO ends up in the same conclusion: the user must be told what he has to know about Lazarus, because he cannot know in advance, whatever items affect the behaviour of a Lazarus installation, in what way.
See my above argumentation. The user must not learn anything about details, that are handled automatically by some tool (installer, IDE...).
I'm not used to write scripts myself, nor to understand the scripts of other people. This is not a Windows issue, as some people believe. There exist users that have no use for a GUI, and others that have no use for consoles. While commandline freaks prefer to use Emacs for all their development, GUI freaks will use Lazarus instead <BG>
When a (Linux) console user knows how to write scripts and create links, a (Windows, KDE, Gnome...) GUI user knows how to create and configure desktop shortcuts. A GUI user rarely will create links himself, except for desktop shortcuts, so your question obviously addresses an very different context. Unless you provide more information, why such a link is created at all, I cannot understand nor answer your question <sheepish grin>. Until then I only can suggest to store the Lazarus dir in the IDE (executable), so that it always knows from which directory it was built; this preserves the chance to override whatsoever in a script, whenever desired.
Whoever gave the OS the instruction to create the thingy. Nothing materializes out of thin air.
Confusion can be reduced a lot, when obviously incompatible platforms are described and managed separately, so that a Windows installation has not to suffer from problems specific only to UNIX installations.
When a Lazarus installation will work out-of-the-box on Windows, or can be made to behave so very easily, why not take that chance?
DoDi
On Sat, 02 Apr 2011 02:48:06 +0200 I explained how it is implemented. And I don't see…
Sorry, there remains much more to know :-(
Why, or in how far, do template values depend on a version? It's obvious that the *amount* of entries can differ, but what about installation specific entries (pathes...)?
How can the IDE be used to create or edit templates? (so that nothing but the template is affected)
Which macros can be used in a template? (absolute path issue) Which macros will be retained, when a config is created from a template?
What has to be done after using the IDE for template editing? (Most probably the IDE should be closed, at least. Anything else?)
Cannot find it - can you provide a link or explain again?
Another is to have a second copy with a patched version, but using the normal lazbuild.
Lazbuild is documented as a command-line tool, so that I don't see how the IDE is involved?
DoDi
I explained below, but I do again. In order for that to work, WITHOUT the user needing to…
No. When the global config is in the search path as well, as should be, and is without -pcp, then the global config is found.
It smells like you search for an excuse for the weird decision, that (currently) the *global* config path is overwritten by -pcp. The global location can be used (be in the searchpath) implicitly, as the last resort, no need to ever specify it explicitly.
A global config is be created only when none exists. Otherwise that global config is used *and* updated, by default. The unaware user may wonder afterwards, why his other Lazarus install will fail or behave unpredictable, due to the changes in the global config :-(
Specifiying an (non yet existing) -pcp creates a config in that place, but its unclear from where the settings are read.
Exactly what I mentioned above.
As long as the Lazarus directory is stored in the config, the IDE can compare it with the current/given directory. When both differ, a new config can be created automatically, in the actual Lazarus dir. At least the user should be informed of such an obvious mismatch, and be asked for specification/confirmation of the directory to use (create/overwrite).
In the simple case, when the next IDE invocation with the same arguments finds the same Lazarus directory mismatch, it also will find the previously created config in the Lazarus directory, and can use it automatically - no need for any further updates.
But when its required to specify the new config explicitly as -pcp, then a new script or desktop shortcut will have to be created, or an existing one has to be updated accordingly. This should be told and left to the user, because IMO any automatic updates may fail for various reasons.
It does, even if you may not have noticed yet (see above).
For several reasons:
1) Apps usually are stored in directories, which are not writeable by the user.
This is okay to prevent the user from garbling his system, but is inapplicable when the user is allowed, and may be forced, to rebuild the IDE. That's why a Lazarus EXE *never* should be stored in a place, that is not writeable by the user.
2) In multi-user environments, typically managed by an administrator, all users shall share common binaries, while every user shall be free to use his own preferred settings.
3) After [2] it turned out that most apps will deserve machine specific (protected) settings, in addition to user-editable settings. That's why most configs are organized in a hierarchical manner, not only in a simple global/local fashion.
This is the situation where I vote for a separation of the Lazarus config, into an installation specific part (mostly the pathes to external tools), and into user preferences, which are applicable to multiple installations (versions) of an application.
4) Apart from all that, it still makes sense to have all-in-one distribution kits, for e.g. evaluation purposes, that can be installed and removed without affecting the machine permanently, and do not require administrator privileges for that purpose. Recent examples are plug-in distributions, on chip cards or USB sticks.
Config in the user dir has many advantages. Various backup solutions will take care of it, user profiles that can be used accross many workstations.....
When backup solutions have to take explicit care of such things, this is *not* an advantage.
Current Lazarus configs are *not* shareable, neither across multiple local installs, nor across workstations. This argument deserves a redesign of the config storage, with a separation into installation-specific and -independent settings.
Vive la diff?rence :-)
I've often been thinking about writing my own installation manager, but finally I was happy whenever I could make a new installation work, without going into implementation details.
What nerved me specifically was the inability to have multiple user accounts for isolated Lazarus installations. If this had been working on Windows, I had been happy with dedicated users for e.g. standard release versions, and other(s) for current development (SVN/Git based).
I think that you pointed out yourself, above, that effectively no two Lazarus installations can share the same config.
But perhaps I overlooked something, so a last question: where can I find the documentation of the Lazarus commandline options, mentioned allover this thread?
Right, we can close this thread, after all arguments have been exchanged.
DoDi
Okay, that explains a lot :-) Remains to mention that the "template" term has to be…
It seems to me you misunderstood.
It is taken from the installation (e.g. under Linux the scp is /etc/lazarus). The Windows installer puts the files into the Lazarus directory, which can be a system wide directory, not writable for the user.
And put into a user specific place. Under Linux this is ~/.lazarus, under Windows it is GetAppConfigDir(False).
This behaviour makes sense only because -pcp overwrites the *common* place, so that effectively *no* place exists where common (installation-independent) templates or settings can be stored :-(
Your information is outdated.
Please take a look at ide/include/win/lazbaseconf.inc. You can see that only for fpc 2.2.0 the scp was the same as the pcp.
I can't follow you here. Maybe you are talking about a different kind of "defaults"? The purpose of the scp is to provide defaults for the first start of the IDE.
Mattias
Sorry, there remains much more to know :-( Why, or in how far, do template values depend…
There is only one value per key. No version.
It's obvious that the *amount* of entries can differ, but what about installation specific entries (pathes...)?
For example the debian package puts configs into /etc/lazarus to setup Lazarus directory, compile file name, make path, gdb and help files.
How can the IDE be used to create or edit templates? (so that nothing but the template is affected)
Just copy a config to the scp and strip all values from the xml you don't need.
Which macros can be used in a template? (absolute path issue)
The same as in the config files. See
http://wiki.lazarus.freepascal.org/IDE_Macros_in_paths_and_filenames#Paths_and_Parts
Which macros will be retained, when a config is created from a template? What has to be done after using the IDE for template editing? (Most probably the IDE should be closed, at least. Anything else?)
Quit IDE, delete your configs (primary), start IDE.
[...] > I already gave the debugging example. Cannot find it - can you provide a link or explain again?
You can use one Lazarus to debug another.
It uses the same configs as the IDE.
Mattias
On Sat, 02 Apr 2011 14:15:22 +0200 It seems to me you misunderstood. It is taken from the…
Exactly as I wrote: a new installation copies its config files (templates) from the Lazarus directory into the common config directory.
I accept the argument, that the Lazarus directory may be write protected, so that the new config may have to be stored in user-land. And I accept that typical installs of new versions, of the same application, should update the common application config.
But this IMO is what an *installer* should do, the IDE itself should behave differently, to better support *multiple* installations. In fact the Windows installer creates a rudimentary environmentoptions.xml, that only contains the absolute references to the applications (fpc, make) that come with the installation. The behaviour on Linux may be different, AFAIK Linux installations don't include their own FPC and tools.
We still seem to differ in the meaning of "template". You mean installation-specific settings, like the pathes to the tools that came with a new installation. Instead I mean all the other settings, which the user has used before (e.g. language, window positions...).
Unfortunately both sets of settings are stored in the same file, environmentoptions.xml, so that *all* user-specific settings in that file are lost, when a new config is created by the IDE in the given -pcp :-(
No, my tests are based on both 0.9.30 release and trunk.
Please take a look at ide/include/win/lazbaseconf.inc. You can see that only for fpc 2.2.0 the scp was the same as the pcp.
You better test the real behaviour of the IDE, as I did. Then you may understand better what I wrote.
See above. The current contents of a "template" are the *installation-specific* pathes, that apply to a concrete installation. In so far it makes sense to copy *these* values from the scp, i.e. from the Lazarus directory. But then we should have another kind of templates, that contain all the remaining settings, AKA *user preferences*.
Perhaps you'll better understand my point when you try to configure a new SVN checkout, based on the current user-specific settings. How can this be accomplished?
In a more perfect world we would have:
- user config path (ucp, my templates, default: common config place)
- installation config path (scp, your templates, default: LazDir)
- primary config path (pcp, as is, default: [SVN] working copy)
DoDi
On Sat, 02 Apr 2011 16:17:25 +0200 There is only one value per key. No version. For…
The Windows installer puts essentially the same informations into the Lazarus directory. But these configs are very rudimentary, from which place are the remaining settings taken?
This is against the wiki suggestion, therefore my question.
Which xml do you mean? The environmentoptions.xml only, or other config files as well?
> Which macros can be used in a template? (absolute path issue) The same as in the config files. See http://wiki.lazarus.freepascal.org/IDE_Macros_in_paths_and_filenames#Paths_and_Parts
This should be mentioned in the wiki as well.
DoDi