Recent

Author Topic: Project options change by themselves [Solved]  (Read 21732 times)

bobc50

  • New Member
  • *
  • Posts: 30
Project options change by themselves [Solved]
« on: October 31, 2023, 03:11:23 pm »
I'm running RC2 on Windows 11. As an example of the issue I'm running into, I set Project Option | Compilation and Linking | Optimization levels to 1. After debugging for a while, I notice that it has changed to 3. Similarly, checkboxes on the Debugging options change. I occasionally rebuild a package which rebuilds Lazarus, but when I check those Project Options they have not changed. I constantly start debugging, stop either by exiting the program I'm working on or by clicking the Stop button in the Gui but, again, when I check the options, they didn't change. I'm not sure if other options have changed or not. Any ideas? Regards, Bob
« Last Edit: November 13, 2023, 03:38:40 pm by bobc50 »

Dzandaa

  • Hero Member
  • *****
  • Posts: 543
  • From C# to Lazarus
Re: Project options change by themselves
« Reply #1 on: October 31, 2023, 03:19:16 pm »
Hi,

In Project->Options

Did you click/declick "Set compiler options as default"?

B->
Regards,
Dzandaa

bobc50

  • New Member
  • *
  • Posts: 30
Re: Project options change by themselves
« Reply #2 on: October 31, 2023, 03:57:04 pm »
No, but I have now. If that fixes the issue, I will mark this appropriately after about 24 hours of use. Much thanks!

bobc50

  • New Member
  • *
  • Posts: 30
Re: Project options change by themselves
« Reply #3 on: November 01, 2023, 06:58:50 am »
Setting compiler options as default did NOT work for me. Today I noticed that the box was no longer checked and my options had again changed.

I just tried the following. I clicked "Set compiler options as default" on the Project Option screen and then "Save." I then reopened the Project Options screen, and that check box was no longer checked.

I am not a very experience Lazarus user. Here's some additional information that might help diagnose this issue. I installed Lazarus RC2 as a secondary installation. I followed the defaults for the installation and had a config file created on C:\LazConfigs\trunk. As a guess, I've attached projectoptons.xml from that folder thinking that might help. I use the Lazarus (Debug) icon created by the installation to start the debugger. Does any of that help?
Regards, Bob

TRon

  • Hero Member
  • *****
  • Posts: 4377
Re: Project options change by themselves
« Reply #4 on: November 01, 2023, 03:39:41 pm »
I just tried the following. I clicked "Set compiler options as default" on the Project Option screen and then "Save." I then reopened the Project Options screen, and that check box was no longer checked.
That is intended behavior and thank heavens that it is. Would it permanently be checked then that means that each time you open the setting of a project that every change would presumed to be set system-wide (for every project).

To prevent that from happening (by accident because users are not aware) the checkbox is automatically turned off after the save/close.

Quote
I am not a very experience Lazarus user. Here's some additional information that might help diagnose this issue.
I understand why you posted the information that you did but unfortunately it is not helpful. You use multiple installations and from your description it seems like you are using a shared configuration for both these installations, which is a big no-no.

You would be better off verifying how each of the individual Lazarus version is invoked, assuming you use a shortcut then what information is stored in those shortcuts and that is responsible for actually executing the Lazarus executable.

Read up an try to understand multiple Lazarus installations in wiki: https://wiki.freepascal.org/Multiple_Lazarus
Today is tomorrow's yesterday.

bobc50

  • New Member
  • *
  • Posts: 30
Re: Project options change by themselves
« Reply #5 on: November 02, 2023, 09:17:03 pm »

I understand why you posted the information that you did but unfortunately it is not helpful. You use multiple installations and from your description it seems like you are using a shared configuration for both these installations, which is a big no-no.

You would be better off verifying how each of the individual Lazarus version is invoked, assuming you use a shortcut then what information is stored in those shortcuts and that is responsible for actually executing the Lazarus executable.

Read up an try to understand multiple Lazarus installations in wiki: https://wiki.freepascal.org/Multiple_Lazarus
Thanks for your response. Not to quibble but, at least for me, knowing that this behavior could be caused by a secondary installation is very helpful. As it happens, I did have a copy of the document you referenced and followed it to the best of my ability. I certainly could have made mistakes. Since I no longer have a use for the initial install, I simply uninstalled both the RC1 and RC2 versions and reinstalled RC2 following all the defaults. If the issue I reported does not recur over the next day I will mark the issue appropriately.

bobc50

  • New Member
  • *
  • Posts: 30
Re: Project options change by themselves
« Reply #6 on: November 04, 2023, 12:02:50 am »
Seems like we can remove secondary install issues as a cause of this behavior. Uninstalling RC1 and RC2 and then reinstalling RC2 did NOT fix my issue. At some point the optimization level switches from 1 to 3 making it virtually impossible to debug. Also, in Project Options | Debugging the following options become checked when they were not initially: "Include assertion code" and "Use external debug symbols file".

For the record I aways start Lazarus with Lazarus (Debug) created by the installation.

Any ideas on what else can be tried or what other information can be provided to help eliminate this behavior? Thanks.

TRon

  • Hero Member
  • *****
  • Posts: 4377
Re: Project options change by themselves
« Reply #7 on: November 04, 2023, 12:22:47 am »
Any ideas on what else can be tried or what other information can be provided to help eliminate this behavior? Thanks.
At the moment I have no idea whatsoever.

To make sure, did you stated that this is specific to Lazarus 3.0RC2 for you (e.g. you have never experienced similar behavior with previous version of Lazarus like RC1, fixes or even older) ?
Today is tomorrow's yesterday.

bobc50

  • New Member
  • *
  • Posts: 30
Re: Project options change by themselves
« Reply #8 on: November 04, 2023, 02:31:48 am »
Any ideas on what else can be tried or what other information can be provided to help eliminate this behavior? Thanks.
To make sure, did you stated that this is specific to Lazarus 3.0RC2 for you (e.g. you have never experienced similar behavior with previous version of Lazarus like RC1, fixes or even older) ?
Thanks for the question. I don't recall running into this issue with 3.0RC1. I haven't changed the way I use Lazarus after I upgraded but this issue has come up once or more every day. I know that didn't happen with RC1. Nor did I remember it happening the 2. version I was running. I never have applied any fixes. I just tried quitting and starting Lazarus about 8 times. I clicked all the icons I could have possibly hit. Nothing changed. I do frequently stop execution of a large app that I'm debugging. I will try and remember to check the options each time I start Lazarus and each time I quit and restart the app. Perhaps that will enable us to figure out what triggers this behavior.

TRon

  • Hero Member
  • *****
  • Posts: 4377
Re: Project options change by themselves
« Reply #9 on: November 05, 2023, 12:36:08 pm »
Ok thank you for the feedback bobc50.

Unfortunately I have not been able to run into something similar (yet).

I will try and remember to check the options each time I start Lazarus and each time I quit and restart the app. Perhaps that will enable us to figure out what triggers this behavior.
One thing I noticed in the project options file that you posted. There is no optimization level defined. If you state that you changed the default options to use another optimization level then it should have been present int that file.

BTW: if that is truly your default project options file then I am assuming that something did go horribly wrong because as it stands right now every new project would be named BridgeCompass with its default units/settings etc.

For setting default options the the idea is that you open a new (empty) project, start fiddling with the default settings that were just copied from the default settings into your newly created project, then checkmark the set as default options to then save the options (as new default options). Meaning that from then on every new project will use these project options as saved as default. Other than that it depends on the build mode.

If you not have done so already then I think I would advise you start with a new configuration altogether, e.g. just wipe the contents of your Lazarus configuration directory and start over by starting Lazarus and let it generate new default configuration options for you.

If you want to then you can always opt for making a backup of that directory contents before the wiping but as i can see it right now it isn't really worth the effort to try and fix.

If you start a new then pay close attention to the projectoptions.xml file in your Lazarus configuration directory (make regular backups of that file if you want to keep track) and also pay attention to your individual project's .lpi file. If you use another optimization level than default for your project then an entry for optimization level should be created in your lpi file. SO whenver the issue pops up, check those two files and compare their contents especially wrt the OptimizationLevel item.
« Last Edit: November 05, 2023, 12:52:45 pm by TRon »
Today is tomorrow's yesterday.

bobc50

  • New Member
  • *
  • Posts: 30
Re: Project options change by themselves
« Reply #10 on: November 06, 2023, 12:39:12 pm »
One thing I noticed in the project options file that you posted. There is no optimization level defined. If you state that you changed the default options to use another optimization level then it should have been present int that file.
Thanks for your additional comments. They've been most helpful, not only with this issue, but to better understand how Lazarus deals with configurations. The project options file that I previously posted was before I uninstalled RC1 and RC2 and then reinstalled RCE to eliminate secondary installation issues. I've attached my latest one.

BTW: if that is truly your default project options file then I am assuming that something did go horribly wrong because as it stands right now every new project would be named BridgeCompass with its default units/settings etc.
That was a bell ringer and, I believe, is related to my observation. As I stated I've been monitoring the options that change fairly religiously and they were unchanged until a short while ago. Let me spell out the detail of how I use Lazarus because it might be off the beaten track.

I download the newest version of a release from github, nothing unusual there. Rather than using that for my development I completely wipe out my previous development folders, with appropriate backups, and then copy the new release from the download github folders into my development release. I then rebuild the one package that is part of the release and then compile and go. Right after I rebuilt the package, I noticed that the project options had changed. It is possible that they might have changed when I first loaded the new package, I'm not sure I checked then. Based on your input I now believe that this was the root cause of my issue and why you have not seen it.

Questions:
  • Do you agree with my assessment
  • Short of changing my approach, which is based on my need to compare changes to prior versions, do you have a suggestion on how to keep this from happening going forward?
If I'm right about the root cause I can deal with it by simply remembering to change the options back after each new release.

If you start a new then pay close attention to the projectoptions.xml file in your Lazarus configuration directory (make regular backups of that file if you want to keep track) and also pay attention to your individual project's .lpi file. If you use another optimization level than default for your project then an entry for optimization level should be created in your lpi file. SO whenver the issue pops up, check those two files and compare their contents especially wrt the OptimizationLevel item.
For the current phase of development, I don't change the optimization level (at least not intentionally). I will follow your advice which, I believe, will prove or disprove my theory about root cause.

Again, I will keep track of this over the next couple of days and update this issue appropriately with the results. Thanks again!

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4715
  • I like bugs.
Re: Project options change by themselves
« Reply #11 on: November 07, 2023, 06:28:16 pm »
Did you add build modes to your project? Some of them can be stored in a session data (.lps) instead of the project info (.lpi).
See Project Options -> Session.
A session file contains things you don't want to share with other developers, like editor file history etc.
Having build modes there can be useful in some situations, too.
I don't know if this is related to your issue anyhow. Still installing a new Lazarus version does not change your project's settings. There is something else going on.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

n7800

  • Hero Member
  • *****
  • Posts: 709
  • Lazarus IDE contributor
    • GitLab profile
Re: Project options change by themselves
« Reply #12 on: November 07, 2023, 07:49:00 pm »
I just tried the following. I clicked "Set compiler options as default" on the Project Option screen and then "Save." I then reopened the Project Options screen, and that check box was no longer checked.
That is intended behavior and thank heavens that it is. Would it permanently be checked then that means that each time you open the setting of a project that every change would presumed to be set system-wide (for every project).

To prevent that from happening (by accident because users are not aware) the checkbox is automatically turned off after the save/close.

By the way, Juha, I’ve long wanted to suggest replacing the "Set compiler options as default" checkbox with a button. What do you think about it? This will be more clear to users.

It can be located in the panel with the "OK" and "Cancel" buttons (near them or near the "Help" button) so that it is clear that the dialog will then close.

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4715
  • I like bugs.
Re: Project options change by themselves
« Reply #13 on: November 07, 2023, 09:05:02 pm »
By the way, Juha, I’ve long wanted to suggest replacing the "Set compiler options as default" checkbox with a button. What do you think about it? This will be more clear to users.
It can be located in the panel with the "OK" and "Cancel" buttons (near them or near the "Help" button) so that it is clear that the dialog will then close.
You mean it does the same as "OK" and then also sets the default? I am not sure if it makes things any more clear.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

TRon

  • Hero Member
  • *****
  • Posts: 4377
Re: Project options change by themselves
« Reply #14 on: November 07, 2023, 09:32:45 pm »
By the way, Juha, I’ve long wanted to suggest replacing the "Set compiler options as default" checkbox with a button. What do you think about it? This will be more clear to users.
It can be located in the panel with the "OK" and "Cancel" buttons (near them or near the "Help" button) so that it is clear that the dialog will then close.
You mean it does the same as "OK" and then also sets the default? I am not sure if it makes things any more clear.
The gist I got from n7800's post is to replace the checkbox with a button with the caption "Save compiler options as default" or something to that extend.

My initial thought was also to place the button next to the other buttons but that might come across as unrelated to the compiler options in specific (unless using the whole caption to make it crisp and clear)
« Last Edit: November 07, 2023, 09:35:00 pm by TRon »
Today is tomorrow's yesterday.

 

TinyPortal © 2005-2018