Sign in Join

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

Mailing lists / lazarus / 2018-01

Rebuilding IDE Gtk/Qt

7 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

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

Vojtěch Čihák

Hi,
 
I sometimes experienced that IDE does not follow the value in combobox in Tools -> Configure "Build Lazarus". Setting Qt is ignored and IDE rebuilds to GTk. But when I change the value in Project Options -> Additions and Overrides -> LCL Widget Type and then I rebuild IDE, it rebuilds to correct widgetset. However, it is not reproducible always, so I'd like to ask if someone experienced this too.  
Note that it is not new, it was there before 1.8.
 
Thanks, V.

Reply by email

zeljko
to Vojtěch Čihák
Vojtěch Čihák wrote 6 lines
Hi, I sometimes experienced that IDE does not follow the value in combobox in Tools -> Configure "Build Lazarus". Setting Qt is ignored and IDE rebuilds to GTk. But when I change the value in Project Options -> Additions and Overrides -> LCL Widget Type and then I rebuild IDE, it rebuilds to correct widgetset. However, it is not reproducible always, so I'd like to ask if someone experienced this too. Note that it is not new, it was there before 1.8.

I can confirm that. Don't know how to reproduce - it just happens sometimes especially if current project ws is eg gtk2. Laz rebuild looks into project ws, not one mentioned in laz build dialog. Similar problem perists with build many modes. I've spotted that max 2 months ago ... eg I'm using linux 64bit qtlcl for my builds , all builds are qt based (win32, linux32,linux64) and for win32 & linux32 cpu = i386, for win32 os = win32, for linux32 and linux64 it's "Default", but sometimes when I rebuild all modes, after win32 is finished (note that win32 OS = win32, not "Default"), it tries to build next one as win32 OS
- eg linux 64bit, and stops since I don't have win64 compiler ...do OS target isn't updated.

zeljko

Reply by email

Vojtěch Čihák

Thanks to zeljko for confirming.
 
I was able to reproduce right now:
 
I have my Lazarus 1.9.0 r56925M FPC 3.0.4 x86_64-linux-qt. I started new project. I saved it. I open Project Options -> Addition and Overrides and added LCLWidgetType "gtk2". I run the project once just to see it is really GTk2 - it is. Now I enter Tools -> Configure Bulid Lazarus. Options are Debug IDE, LCL WIdgetType = qt. I don't change them. I switch to "Clean common files" and click Build.
After restart I have Lazarus 1.9.0 r56925M FPC 3.0.4 x86_64-linux-gtk2.  
V.
 

Reply by email

Vojtěch Čihák

I found the reason but to make a patch is beyond my powers. When I used the steps described below, I got this in console:  
NOTE: Window with stalled focus found!, faking focus-out event NOTE: Window with stalled focus found!, faking focus-out event Hint: (lazarus) [TBuildManager.SetBuildTarget] Old=x86_64-linux-gtk2 New=x86_64-linux-qt FPC=False LCL=True HERE1 lpQT
Hint: (lazarus) [TBuildManager.SetBuildTarget] Old=x86_64-linux-qt New=x86_64-linux-gtk2 FPC=False LCL=True HERE2 lpQT
HERE3 lpQT
Hint: (lazarus) [TBuildManager.SetBuildTarget] Old=x86_64-linux-gtk2 New=x86_64-linux-qt FPC=False LCL=True Note: (lazarus) deleted backup "/home/v1/Lazarus_Qt/lazarus/lazarus.old" Note: (lazarus) renamed file "/home/v1/Lazarus_Qt/lazarus/lazarus" to "/home/v1/Lazarus_Qt/lazarus/lazarus.old" Info: (lazarus) Execute Title="Build IDE"
Info: (lazarus) Working Directory="/home/v1/Lazarus_Qt/lazarus/" Info: (lazarus) Executable="/usr/bin/make"
Info: (lazarus) Param[0]="idepkg"
Info: (lazarus) Param[1]="-w"
HERE4 lpQT
Hint: (lazarus) [TBuildManager.SetBuildTarget] Old=x86_64-linux-qt New=x86_64-linux-gtk2 FPC=False LCL=True HERE5 lpQT
Hint: (lazarus) TMainIDE.DoRestart 
LAZARUS END - cleaning up ...
Hint: (lazarus) [TMainIDE.Destroy] B  -> inherited Destroy... TMainIDE Hint: (lazarus) [TMainIDE.Destroy] END
Heap dump by heaptrc unit
3185022 memory blocks allocated : 308622317/315523376 3185022 memory blocks freed     : 308622317/315523376 0 unfreed memory blocks : 0
True heap size : 1572864
True free heap : 1572864
TLazarusManager.Run starting /home/v1/Lazarus_Qt/lazarus/lazarus ... Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] PrimaryConfigPath="/home/v1/.lazarus" Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] SecondaryConfigPath="/etc/lazarus" Hint: (lazarus) [TBuildManager.SetBuildTarget] Old=x86_64-linux-gtk2 New=x86_64-linux-gtk2 FPC=True LCL=False TComponentTreeView.SetSelection: Updating component node values. TLazSourceFileManager.InitOpenedProjectFile select form in designer: Form1:TForm1 TDesigner NOTE: Window with stalled focus found!, faking focus-out event NOTE: Window with stalled focus found!, faking focus-out event See several "Hint: (lazarus) [TBuildManager.SetBuildTarget]..." about changing widgetset.Lines "HEREx lpQt" are from me, they indicates that state of MiscellaneousOptions.BuildLazProfiles.Current.TargetPlatform); is unchangedThe changes come from method MainBuildBoss.SetBuildTargetProject1 which is called several times in main.pp, mainly in TMainIDE.mnuToolConfigBuildLazClicked at line 4595.It calls TBuildManager.SetBuildTarget and nested function GetEffectiveLCLWidgetType where is line: Result:=FBuildTarget.CompilerOptions.GetEffectiveLCLWidgetTypeIt is probably the reason why combobox in "Configure Build Lazarus" is ignored and is replaced by value from Compiler Options.V.______________________________________________________________

Show quoted text 5 lines
Od: Vojtěch Čihák via Lazarus Komu: Lazarus mailing list Datum: 02.01.2018 22:21 Předmět: Re: [Lazarus] Rebuilding IDE Gtk/Qt

Thanks to zeljko for confirming.
 
I was able to reproduce right now:
 
I have my Lazarus 1.9.0 r56925M FPC 3.0.4 x86_64-linux-qt. I started new project. I saved it. I open Project Options -> Addition and Overrides and added LCLWidgetType "gtk2". I run the project once just to see it is really GTk2 - it is. Now I enter Tools -> Configure Bulid Lazarus. Options are Debug IDE, LCL WIdgetType = qt. I don't change them. I switch to "Clean common files" and click Build.
After restart I have Lazarus 1.9.0 r56925M FPC 3.0.4 x86_64-linux-gtk2.  
V.
 

Reply by email

Mattias Gaertner
to Vojtěch Čihák
I found the reason but to make a patch is beyond my powers. When I used the steps described below, I got this in console: [...]is unchangedThe changes come from method MainBuildBoss.SetBuildTargetProject1 which is called several times in main.pp, mainly in TMainIDE.mnuToolConfigBuildLazClicked at line 4595.

Yes, these are the switches between project and IDE settings.

It calls TBuildManager.SetBuildTarget and nested function GetEffectiveLCLWidgetType where is line: Result:=FBuildTarget.CompilerOptions.GetEffectiveLCLWidgetTypeIt is probably the reason why combobox in "Configure Build Lazarus" is ignored and is replaced by value from Compiler Options.

No, when building the IDE the FBuildTarget is nil. See TBuildManager.SetBuildTargetIDE.

Please start the IDE with -v -v to get more output.

Mattias

Reply by email

Vojtěch Čihák
to Vojtěch Čihák: I found the reason but to make a patch is beyond my powers. When I used the steps…

Hi, so I reproduced again unwanted qt to gtk2 rebuild. Now the -v -v output is bigger:  
https://pastebin.com/MCPe8FE7
 
Thanks, V.
______________________________________________________________

Show quoted text 5 lines
Od: Mattias Gaertner via Lazarus Komu: Datum: 05.01.2018 13:11 Předmět: Re: [Lazarus] Rebuilding IDE Gtk/Qt
I found the reason but to make a patch is beyond my powers. When I used the steps described below, I got this in console: [...]is unchangedThe changes come from method MainBuildBoss.SetBuildTargetProject1 which is called several times in main.pp, mainly in TMainIDE.mnuToolConfigBuildLazClicked at line 4595.

Yes, these are the switches between project and IDE settings.

It calls TBuildManager.SetBuildTarget and nested function GetEffectiveLCLWidgetType where is line: Result:=FBuildTarget.CompilerOptions.GetEffectiveLCLWidgetTypeIt is probably the reason why combobox in "Configure Build Lazarus" is ignored and is replaced by value from Compiler Options.

No, when building the IDE the FBuildTarget is nil. See TBuildManager.SetBuildTargetIDE.

Please start the IDE with -v -v to get more output.

Mattias

Reply by email

Vojtěch Čihák
to Vojtěch Čihák: I found the reason but to make a patch is beyond my powers. When I used the steps…

Hi,
 
I see now, FBuildTarget.CompilerOptions.GetEffectiveLCLWidgetType is never called. Result depends on parameter LCLWidgetType of function TBuildManager.SetBuildTarget(). This code:
procedure TMainIDE.mnuToolConfigBuildLazClicked(Sender: TObject); var
  ...
begin
  //if ToolStatusitNone then exit;
  if fBuilder=Nil then
    fBuilder:=TLazarusBuilder.Create;    // Will be freed in the very end.   MainBuildBoss.SetBuildTargetIDE;
  try
    DlgResult:=fBuilder.ShowConfigureBuildLazarusDlg(MiscellaneousOptions.BuildLazProfiles);   finally
    MainBuildBoss.SetBuildTargetProject1(true);
  end;
 
SetBuildTargetIDE calls SetBuildTarget with correct parameters but in turn in finally section SetBuildTargetProject1 calls: SetBuildTarget('','','',ScanFPCSrc,Quiet);   //note that empty strings It later calls:
 
function GetDefaultLCLWidgetType: TLCLPlatform;
begin
  if (WidgetSetnil) and (WidgetSet.LCLPlatformlpNoGUI) then     Result:=WidgetSet.LCLPlatform
  else
    Result:=BuildLCLWidgetType;
end;
 
where WidgetSet is always assigned and Result is always gtk2.  
V.
______________________________________________________________

Show quoted text 5 lines
Od: Mattias Gaertner via Lazarus Komu: Datum: 05.01.2018 13:11 Předmět: Re: [Lazarus] Rebuilding IDE Gtk/Qt
I found the reason but to make a patch is beyond my powers. When I used the steps described below, I got this in console: [...]is unchangedThe changes come from method MainBuildBoss.SetBuildTargetProject1 which is called several times in main.pp, mainly in TMainIDE.mnuToolConfigBuildLazClicked at line 4595.

Yes, these are the switches between project and IDE settings.

It calls TBuildManager.SetBuildTarget and nested function GetEffectiveLCLWidgetType where is line: Result:=FBuildTarget.CompilerOptions.GetEffectiveLCLWidgetTypeIt is probably the reason why combobox in "Configure Build Lazarus" is ignored and is replaced by value from Compiler Options.

No, when building the IDE the FBuildTarget is nil. See TBuildManager.SetBuildTargetIDE.

Please start the IDE with -v -v to get more output.

Mattias

Reply by email