Re: [Lazarus] Lazarus 2.0.2 EditorMacroScript error on first startup RPi4B
On 01/11/2019 22:25, Bo Berglund via lazarus wrote: I just installed Lazarus 2.0.6 from sources and when I started it on Raspbian Buster I did get the dialog again. I assume your change is in 2.0.6? Help/About reports revision 62151. No, the change was a bigger change, which will only be in 2.2 -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Lazarus 2.0.2 EditorMacroScript error on first startup RPi4B
On Tue, 17 Sep 2019 22:27:13 +0200, Martin Frb via lazarus wrote: >Can you please retest with >Revision: 61896 >Date: 17 September 2019 22:21:38 >EditorMacroScript: Use "internal" (none-native) calling for object methods > >Making sure you remove your editormacroscript.xml file, or re-request >the self-test from the options page, please. I just installed Lazarus 2.0.6 from sources and when I started it on Raspbian Buster I did get the dialog again. I assume your change is in 2.0.6? Help/About reports revision 62151. On Lazarus startup it created the file and following starts are OK. If I remove the file the error box re-appears (once) on Lazarus start. -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Lazarus 2.0.2 EditorMacroScript error on first startup RPi4B
Can you please retest with Revision: 61896 Date: 17 September 2019 22:21:38 EditorMacroScript: Use "internal" (none-native) calling for object methods Making sure you remove your editormacroscript.xml file, or re-request the self-test from the options page, please. On 19/08/2019 07:08, Bo Berglund via lazarus wrote: On Mon, 19 Aug 2019 00:46:18 +0200, Martin Frb via lazarus wrote: Also on either system. After the error happens once, that is stored in the config. Unless you remove your config each time that you install, you should never see the error again. To verify that, you can (after the error) check the XML file. That xml file should stay there forever. I always make a separate config dir for each installation so a new install starts out with an empty config. I use the --pcp= flag in the start command on Linux to specify this dir. On Windows the installer fixes this during install when I check the "separate installation" flag. -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Lazarus 2.0.2 EditorMacroScript error on first startup RPi4B
On Mon, 19 Aug 2019 00:46:18 +0200, Martin Frb via lazarus wrote: >Also on either system. After the error happens once, that is stored in >the config. Unless you remove your config each time that you install, >you should never see the error again. >To verify that, you can (after the error) check the XML file. That xml >file should stay there forever. I always make a separate config dir for each installation so a new install starts out with an empty config. I use the --pcp= flag in the start command on Linux to specify this dir. On Windows the installer fixes this during install when I check the "separate installation" flag. -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Lazarus 2.0.2 EditorMacroScript error on first startup RPi4B
On 18/08/2019 23:58, Bo Berglund via lazarus wrote: On Sun, 18 Aug 2019 22:51:31 +0200, Martin Frb via lazarus wrote: On 18/08/2019 21:19, Bo Berglund via lazarus wrote: Parameter type not implemented! So on arm that explains the error. It does not implement passing a set as param (must be set, since string worked in other tests). Does this mean that FPC on Arm is not generating the expected code like it does on Windows? So the cross-platform operation is somewhat broken? No, it means PascalScript is not fully implemented I have to see, if there are any options. Otherwise I will disable it for arm (since it does not currently work for anyone, it would not be a regression) As for what happened on windows, no idea. I think I have seen the same first start error for a long time on the RPi. It is quite possible that I don't have the complete set of required packages listed for installation in my script and this is what breaks it. But that is provided that it is not an fpc deviation for arm of course. On Windows I have yet to build a dev system myself, I always use the "official" installers there. It is not a missing package. All the code is compiled into the IDE. PascalScript is a 3rd party package. It includes some asm code that differs for each platform (cpu and general type of OS). The OS type only matters because the calling convention differs. That is fpc (following the rules for each platform) uses different registers to store function param. But there is no diff between win7 (64bit) and win10 (64bit). So if it works on w10 for me, I have no idea why it fails for you (win 7). Arm/linux (raspi) has different code in PS. And apparently that is incomplete. But that only affects RPI. Also on either system. After the error happens once, that is stored in the config. Unless you remove your config each time that you install, you should never see the error again. To verify that, you can (after the error) check the XML file. That xml file should stay there forever. As I said, I will decide (soon / hopefully sometime before the next release) what to do on arm. Maybe disable it for arm. Then there wont be an error. Maybe I find a work around. Then I would have to ask you to test (since I cant currently). -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Lazarus 2.0.2 EditorMacroScript error on first startup RPi4B
On Sun, 18 Aug 2019 22:51:31 +0200, Martin Frb via lazarus wrote: >On 18/08/2019 21:19, Bo Berglund via lazarus wrote: >> >> Parameter type not implemented! >> >So on arm that explains the error. >It does not implement passing a set as param (must be set, since string >worked in other tests). Does this mean that FPC on Arm is not generating the expected code like it does on Windows? So the cross-platform operation is somewhat broken? >I have to see, if there are any options. >Otherwise I will disable it for arm (since it does not currently work >for anyone, it would not be a regression) > >As for what happened on windows, no idea. I know that on RPi Arm I had to figure out what build essentials to install every time I needed to put FPC + Lazarus on a new system. I had to retrieve sources via svn and build on the system so I had to figure out all that was needed to succeed. I put all of this into an installation script I use every time nowadays (I have been doing this for 6-7 years now). It assumes nothing but a pristine out-of-the-box Raspbian installation which needs some more packages in order to work with s/w development. So the script installs that for me. And it has worked every time except once when the RPi went from arm6 to arm7 and a flag had to be added into the fpc build commands in the script. I think I have seen the same first start error for a long time on the RPi. It is quite possible that I don't have the complete set of required packages listed for installation in my script and this is what breaks it. But that is provided that it is not an fpc deviation for arm of course. On Windows I have yet to build a dev system myself, I always use the "official" installers there. -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Lazarus 2.0.2 EditorMacroScript error on first startup RPi4B
On 18/08/2019 21:19, Bo Berglund via lazarus wrote: Parameter type not implemented! So on arm that explains the error. It does not implement passing a set as param (must be set, since string worked in other tests). I have to see, if there are any options. Otherwise I will disable it for arm (since it does not currently work for anyone, it would not be a regression) As for what happened on windows, no idea. -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Lazarus 2.0.2 EditorMacroScript error on first startup RPi4B
On Sun, 18 Aug 2019 14:21:30 +0200, Martin Frb via lazarus wrote: >If you want to go on trying to see if we can find anything, then please >open > components\macroscript\emscriptclasses.pas >around line 555 >replace TEmsSynWrapper.EMS_SearchReplace >with: > >function TEmsSynWrapper.EMS_SearchReplace(ASearch, AReplace: string; > AOptions: TSynSearchOptions): integer; >begin >debugln(['*** EMS_SearchReplace ASearch ', ord(ssoReplaceAll), ' / ', >integer([ssoReplaceAll])]); >debugln(['*** EMS_SearchReplace ', Pointer(ASearch), ' / ', >Pointer(AReplace), ' / ', integer(AOptions), ' / ', Pointer(self)]); >debugln(['*** EMS_SearchReplace ASearch ', ASearch, ' / ', AReplace]); >debugln(['*** EMS_SearchReplace ASearch ', length(ASearch), ' / ', >length(AReplace)]); >debugln(['*** EMS_SearchReplace ASearch ', RawByteString(ASearch), ' / >', RawByteString(AReplace)]); >debugln(['*** EMS_SearchReplace ASearch ', StringCodePage((ASearch)), ' >/ ', StringCodePage((AReplace))]); >debugln(['*** EMS_SearchReplace ASearch ', >StringCodePage(RawByteString(ASearch)), ' / ', >StringCodePage(RawByteString(AReplace))]); >debugln(['*** EMS_SearchReplace ASearch ', self.Text, ' / ', >dbgs(CaretXY)]); > Result := SearchReplace(ASearch, AReplace, AOptions); >debugln(['*** EMS_SearchReplace ASearch ', Result]); >debugln(['*** EMS_SearchReplace ASearch ', self.Text, ' / ', >dbgs(CaretXY)]); >end; > >Start lazarus from console, so you can get the output. Copy the output. >The output only matters, if the error occurs. So self-testing must be >re-enabled. I have done this on my RPi4 with Lazarus 2.0.4. The result after enabling the test and starting again from the console is this sequence (line breaks added by news reader): pi@rpi4-test:~ $ /home/pi/dev/lazarus/2.0.4/startlazarus --pcp=/home/pi/.lazarus_2.0.4 Adding "--pcp=/home/pi/.lazarus_2.0.4" as a parameter is a file SetPrimaryConfigPath NewValue="/home/pi/.lazarus_2.0.4" -> "/home/pi/.lazarus_2.0.4" TLazarusManager.Run starting /home/pi/dev/lazarus/2.0.4/lazarus ... SetPrimaryConfigPath NewValue="/home/pi/.lazarus_2.0.4" -> "/home/pi/.lazarus_2.0.4" Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] PrimaryConfigPath="/home/pi/.lazarus_2.0.4" Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] SecondaryConfigPath="/etc/lazarus" Hint: (lazarus) [TBuildManager.SetBuildTarget] Old=arm-linux-gtk2 New=arm-linux-gtk2 Changed: OS/CPU=True LCL=False Parameter type not implemented! ---Here the error message is shown and it waits for the Start IDE button to be clicked. - [WARNING] SetImageList called without handle for lbMacroView(TListView) [WARNING] SetImageList called without handle for lbMacroView(TListView) [WARNING] SetImageList called without handle for lbMacroView(TListView) --- Here is where the IDE has started and can be used --- --- Now close the Lazarus IDE --- LAZARUS END - cleaning up ... Hint: (lazarus) [TMainIDE.Destroy] B -> inherited Destroy... TMainIDE Hint: (lazarus) [TMainIDE.Destroy] END --- Lazarus IDE closed --- I just copied the command line found in the GUI menu and ran it inside the terminal, except I removed the trailing %f since I had no file to pass in. -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Lazarus 2.0.2 EditorMacroScript error on first startup RPi4B
On 18/08/2019 11:17, Bo Berglund via lazarus wrote: So this Lazarus installer successfully deposits a working Lazarus *without* the initial message about disabling the pascal scripting. And Lazarus options seems to be exactly like the 2.0.4 I installed previously. So the message I previously saw about deactivating scripting seems to be an *installer* bug when in fact the installation has succeeded all the time... I doubt it. Nothing was fixed that could have triggered this. Most likely some condition changed. Maybe simple because of the code grew a few bytes Something like this normally points to incorrect mem access. But running in valgrind revealed nothing. Of course PascalScript has different code for each target CPU and OS. (linux vs win // but not diff version of win afaik). Now after getting 2.0.5 working in Win7 I returned to the RPi4 The editormacroscript.xml now contains this: Does this explain what is wrong on the RPi4 installation? Unfortunately not. This will require deeper debugging. Potentially quite a lot. I do not have access to an RP at the moment. I planed to set one up (or get QEMU to work) for more than 2 years now... But didn't find the time. So that may still be a long time before I get to it. If you want to go on trying to see if we can find anything, then please open components\macroscript\emscriptclasses.pas around line 555 replace TEmsSynWrapper.EMS_SearchReplace with: function TEmsSynWrapper.EMS_SearchReplace(ASearch, AReplace: string; AOptions: TSynSearchOptions): integer; begin debugln(['*** EMS_SearchReplace ASearch ', ord(ssoReplaceAll), ' / ', integer([ssoReplaceAll])]); debugln(['*** EMS_SearchReplace ', Pointer(ASearch), ' / ', Pointer(AReplace), ' / ', integer(AOptions), ' / ', Pointer(self)]); debugln(['*** EMS_SearchReplace ASearch ', ASearch, ' / ', AReplace]); debugln(['*** EMS_SearchReplace ASearch ', length(ASearch), ' / ', length(AReplace)]); debugln(['*** EMS_SearchReplace ASearch ', RawByteString(ASearch), ' / ', RawByteString(AReplace)]); debugln(['*** EMS_SearchReplace ASearch ', StringCodePage((ASearch)), ' / ', StringCodePage((AReplace))]); debugln(['*** EMS_SearchReplace ASearch ', StringCodePage(RawByteString(ASearch)), ' / ', StringCodePage(RawByteString(AReplace))]); debugln(['*** EMS_SearchReplace ASearch ', self.Text, ' / ', dbgs(CaretXY)]); Result := SearchReplace(ASearch, AReplace, AOptions); debugln(['*** EMS_SearchReplace ASearch ', Result]); debugln(['*** EMS_SearchReplace ASearch ', self.Text, ' / ', dbgs(CaretXY)]); end; Start lazarus from console, so you can get the output. Copy the output. The output only matters, if the error occurs. So self-testing must be re-enabled. -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Lazarus 2.0.2 EditorMacroScript error on first startup RPi4B
On Sat, 17 Aug 2019 16:43:38 +0200, Martin Frb via lazarus wrote: >I attached a ready to go replacement file. >Make a copy of your original > components/macroscript/emsselftest.pas >and then put the attached file into it. > >Tools > Option > editor macro script : "Test again" > (this deletes/reset editormacroscript.xml from your primary conf, >which is the file that stores the error) >Tools > Rebuild Lazarus IDE >Restart > >The new error should be shown on IDE start. > Now after getting 2.0.5 working in Win7 I returned to the RPi4 uinstallation of 2.0.4 and replaced the emsselftest.pas file as described above, then rebuilt the IDE and opened Lazarus and clicked the "test again" button. Closed and started Lazarus and received the message again. The editormacroscript.xml now contains this: Does this explain what is wrong on the RPi4 installation? -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Lazarus 2.0.2 EditorMacroScript error on first startup RPi4B
On Sun, 18 Aug 2019 01:27:12 +0200, Martin Frb via lazarus wrote: >I build an installer for 2.0.5 (which does include the extra verbosity) >/ 64 bit only > >https://sourceforge.net/projects/lazarus-snapshots/files/test/ >lazarus-2.0.5-61719-fpc-3.0.4-20190817-win64.exe > Downloaded and installed this 2.0.5 test version as a separate installation (like I always do) on my Windows 7 x64 workstation. Then: - Start Lazarus from installed shortcut - Configure Lazarus IDE - [Start IDE] - Now NO pop-up complaint about missing script - config/editormacroscript.xml is empty (no data) - "Tools/Options/Editor Macro Script/Test again" button is disabled and above there is a "Scripting active" message. So this Lazarus installer successfully deposits a working Lazarus *without* the initial message about disabling the pascal scripting. And Lazarus options seems to be exactly like the 2.0.4 I installed previously. So the message I previously saw about deactivating scripting seems to be an *installer* bug when in fact the installation has succeeded all the time... Now gone in any case! Thanks! -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Lazarus 2.0.2 EditorMacroScript error on first startup RPi4B
On 17/08/2019 21:52, Bo Berglund via lazarus wrote: It will probably only happen wenever I get Lazarus 2.0.6 on board then... I build an installer for 2.0.5 (which does include the extra verbosity) / 64 bit only https://sourceforge.net/projects/lazarus-snapshots/files/test/ lazarus-2.0.5-61719-fpc-3.0.4-20190817-win64.exe https://sourceforge.net/projects/lazarus-snapshots/files/test/lazarus-2.0.5-61719-fpc-3.0.4-20190817-win64.exe/download It contains the following fixes over 2.0.4 https://wiki.lazarus.freepascal.org/index.php?title=Lazarus_2.0_fixes_branch&oldid=126476#Merged_revisions_for_2.0.6 So if you want to, you can try this. -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Lazarus 2.0.2 EditorMacroScript error on first startup RPi4B
On 17/08/2019 22:32, Martin Frb via lazarus wrote: ( editormacroscript.xml is in your primary config path. You can find where that is from the menu: View > IDE Internals > About IDE ) I found it and it contains basically nothing: Which means no error... Just to be sure: editormacroscript.xml NOT: editormacros.xml The latter contains your macros, if you have any. -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Lazarus 2.0.2 EditorMacroScript error on first startup RPi4B
On 17/08/2019 21:52, Bo Berglund via lazarus wrote: On Sat, 17 Aug 2019 18:43:01 +0200, Martin Frb via lazarus wrote: That means, that this install of Lazarus has either not yet encountered the error, or that the "editormacroscript.xml" was deleted/reset (i.e. error removed from content). Could not the actions reported on first start do just that and this is what causes the message not to reappear? If it displays an error, it should create the xml file, and put the error into it. That will then stop it from testing again, and therefore the error does not happen again. When you start a newly installed IDE, do you rebuild it (to get your packages back?) Then maybe the rebuild on works. But that would still leave me wonder, what removed the error from the file. ( editormacroscript.xml is in your primary config path. You can find where that is from the menu: View > IDE Internals > About IDE ) I found it and it contains basically nothing: Which means no error... Anyway if scripting is active, then the self test runs at every start of your IDE. And that leaves the question why it does not report the error anymore. (and when the editormacroscript.xml was deleted/reset) Yes, why? PascalScript can (and needs to) interact with compiled code. For example the instance of a SourceEDitor SynEdit (with limited access) is passed to any macro. The macro can call functions on this SynEdit and interact with it. Because PascalScript is compiled without knowing of all the method signatures it may have to deal with, it actually has no code to call them. Methods are registered at runtime. If they need to be called, PS manually builds the stack (and cpu registers) that the called method would expect. This must match exactly what fpc would have done at compiletime. (there is a 2nd callling method / awaits more testing) If that goes wrong (maybe fpc changed), then the behaviour will be undefined. the code is called with trashed data To avoid happening that while working in the IDE, there is a selftest at startup. Before the selftest starts, it will write that to the xml file. So if the test crashes, never finishes, then the file says "I am in testing". If at start the xml is found to be "in testing", then this is reported as "last test failed" and disables PS. So your IDE did not crash, as the file is not "in testing" and you said you did not use the reset button. If the test fails, it is reported and written to the XML. If it succeeds the xml is updated to have nothing in it. So the self test runs on each start up (since the IDE could have been recompiled). The only way for it not to run, is if it failed or crashed. -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Lazarus 2.0.2 EditorMacroScript error on first startup RPi4B
On Sat, 17 Aug 2019 18:43:01 +0200, Martin Frb via lazarus wrote: >On 17/08/2019 18:23, Bo Berglund via lazarus wrote: >> On Sat, 17 Aug 2019 16:43:38 +0200, Martin Frb via lazarus >> wrote: >> >>> I attached a ready to go replacement file. >>> Make a copy of your original >>> components/macroscript/emsselftest.pas >>> and then put the attached file into it. >> Done! >> >>> Tools > Option > editor macro script : "Test again" >> This button is disabled, cannot click it. >Then it should say "scripting active"? Yes it does... > >That means, that this install of Lazarus has either not yet encountered >the error, or that the "editormacroscript.xml" was deleted/reset (i.e. >error removed from content). Could not the actions reported on first start do just that and this is what causes the message not to reappear? >( editormacroscript.xml is in your primary config path. You can find >where that is from the menu: View > IDE Internals > About IDE ) I found it and it contains basically nothing: >If you get the error again (with or without the changed unit), then >check for >1) the "test again" button >2) the editormacroscript.xml file It will probably only happen wenever I get Lazarus 2.0.6 on board then... >Anyway if scripting is active, then the self test runs at every start of >your IDE. And that leaves the question why it does not report the error >anymore. (and when the editormacroscript.xml was deleted/reset) Yes, why? -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Lazarus 2.0.2 EditorMacroScript error on first startup RPi4B
On 17/08/2019 18:23, Bo Berglund via lazarus wrote: On Sat, 17 Aug 2019 16:43:38 +0200, Martin Frb via lazarus wrote: I attached a ready to go replacement file. Make a copy of your original components/macroscript/emsselftest.pas and then put the attached file into it. Done! Tools > Option > editor macro script : "Test again" This button is disabled, cannot click it. Then it should say "scripting active"? That means, that this install of Lazarus has either not yet encountered the error, or that the "editormacroscript.xml" was deleted/reset (i.e. error removed from content). ( editormacroscript.xml is in your primary config path. You can find where that is from the menu: View > IDE Internals > About IDE ) If you get the error again (with or without the changed unit), then check for 1) the "test again" button 2) the editormacroscript.xml file Anyway if scripting is active, then the self test runs at every start of your IDE. And that leaves the question why it does not report the error anymore. (and when the editormacroscript.xml was deleted/reset) Do I need to replace the file as above with Lazarus closed? I did it while it was running. Lazarus usually detects changed files while running. Though I do not know if a package will be marked for rebuild in that case But save is to do so when closed. Or to choose "clean all" as then the file will be rebuild no matter what But the changes in the file do not affect the button. So could not complete past this step. (this deletes/reset editormacroscript.xml from your primary conf, which is the file that stores the error) Tools > Rebuild Lazarus IDE Restart Will Lazarus not automatically Restart following a rebuild? That is the default setting, it can be changed though -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Lazarus 2.0.2 EditorMacroScript error on first startup RPi4B
On Sat, 17 Aug 2019 16:43:38 +0200, Martin Frb via lazarus wrote: >I attached a ready to go replacement file. >Make a copy of your original > components/macroscript/emsselftest.pas >and then put the attached file into it. Done! >Tools > Option > editor macro script : "Test again" This button is disabled, cannot click it. Do I need to replace the file as above with Lazarus closed? I did it while it was running. So could not complete past this step. > (this deletes/reset editormacroscript.xml from your primary conf, >which is the file that stores the error) >Tools > Rebuild Lazarus IDE >Restart Will Lazarus not automatically Restart following a rebuild? > >The new error should be shown on IDE start. > -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Lazarus 2.0.2 EditorMacroScript error on first startup RPi4B
On 17/08/2019 15:31, Bo Berglund via lazarus wrote: On Sat, 17 Aug 2019 14:12:02 +0200, Martin Frb via lazarus wrote: On 17/08/2019 14:00, Martin Frb via lazarus wrote: Could you apply the following patch please: https://github.com/User4martin/lazarus/commit/5fa7fac42bb55d23b9654984be1e2e1c08049709 Or the patch/commit from latest trunk. Added the verbose to all tests This is somehing I have never done... Could you please explain what you mean I should do in order to "apply the patch"? Step by step please. I attached a ready to go replacement file. Make a copy of your original components/macroscript/emsselftest.pas and then put the attached file into it. Tools > Option > editor macro script : "Test again" (this deletes/reset editormacroscript.xml from your primary conf, which is the file that stores the error) Tools > Rebuild Lazarus IDE Restart The new error should be shown on IDE start. Applying patches (not needed for the above) 1) If it is just a few lines, locate them in your source and edit them. githup shows the line number and changes 2) Download as a patch. Now here is the thing: GitHUB (not git) is actually not as good as in is often praised. There seems to be no intuitive way to get an actual patch. I assumed there would be a button. Sorry about that, but github is not normally my turf. From what I found one has to append .diff to the url https://github.com/User4martin/lazarus/commit/5fa7fac42bb55d23b9654984be1e2e1c08049709.diff That can be saved, and then cd lazarus patch -p1 < the_file.patch The -p1 strips one leading folder from --- a/components/macroscript/emsselftest.pas +++ b/components/macroscript/emsselftest.pas In this case the "a/" If you did cd lazarus/components and therefore you file was macroscript/emsselftest.pas then you would need -p2 and so on you can do --dry-run unit EMSSelfTest; {$mode objfpc}{$H+} interface {$IFDEF darwin} {$DEFINE NeedTPointFix } {$ENDIF} uses Classes, SysUtils, SynEdit, LazLoggerBase, IDECommands, EMScriptClasses, EMScriptMacro, Clipbrd, Dialogs, Controls, uPSCompiler, uPSRuntime, uPSUtils; type TEMScriptSelfTestException = Exception; { TEMSTPSTestExec } TEMSTPSTestExec = class(TEMSTPSExec) protected procedure AddFuncToExec; override; public end; { TEMSPSTestPascalCompiler } TEMSPSTestPascalCompiler = class(TEMSPSPascalCompiler) private FNextOnUses: TPSOnUses; public constructor Create; end; { TEMSelfTestEditorMacro } TEMSelfTestEditorMacro = class(TEMSEditorMacro) public constructor Create(aOwner: TComponent); override; end; function DoSelfTest: Boolean; var SelfTestErrorMsg: String; implementation {$IFDEF NeedTPointFix} type TPoint2 = record x,y,a,b,c: Longint; end; {$ENDIF} {%region RegisterSelfTests} var {%H-}TestResultA: integer; TestResultInt1, TestResultInt2: integer; TestInputInt1, TestInputInt2: integer; TestResultBool1, TestResultBool2: boolean; TestInputBool1, TestInputBool2: boolean; TestResultStr1, TestResultStr2: String; TestInputStr1, TestInputStr2: String; function test_ord_mt(AType: TMsgDlgType): Integer; begin Result := ord(AType); TestResultA := Result; end; function test_ord_mb(ABtn: TMsgDlgBtn): Integer; begin Result := ord(ABtn); TestResultA := Result; end; procedure test_int1(AValue: Integer); begin TestResultInt1 := AValue; end; procedure test_int2(AValue: Integer); begin TestResultInt2 := AValue; end; function test_getint1: Integer; begin Result := TestInputInt1; end; function test_getint2: Integer; begin Result := TestInputInt2; end; procedure test_varint1(var AValue: Integer); begin TestResultInt1 := AValue; AValue := TestInputInt1; end; procedure test_bool1(AValue: boolean); begin TestResultBool1 := AValue; end; procedure test_bool2(AValue: boolean); begin TestResultBool2 := AValue; end; function test_getbool1: Boolean; begin Result := TestInputBool1; end; function test_getbool2: Boolean; begin Result := TestInputBool2; end; procedure test_point(AValue: TPoint); begin TestResultInt1 := AValue.X; TestResultInt2 := AValue.Y; end; function test_getpoint: {$IFDEF NeedTPointFix}TPoint2{$ELSE}TPoint{$ENDIF}; begin Result.X := TestInputInt1; Result.Y := TestInputInt2; end; procedure test_varpoint(var AValue: TPoint); begin TestResultInt1 := AValue.X; TestResultInt2 := AValue.Y; AValue.X := TestInputInt1; AValue.Y := TestInputInt2; end; procedure test_str1(AValue: String); begin TestResultStr1 := AValue; end; procedure test_str2(AValue: String); begin TestResultStr2 := AValue; end; function test_getstr1: String; begin Result := TestInputStr1; end; function test_getstr2: String; begin Result := TestInputStr2; end; procedure test_varstr1(var AValue: String); begin TestResultStr1 := AValue; AValue := TestInputStr1; end; const Decltest_ord_mt = 'function test_ord_mt(AType: TMsgDlgType): Integer;'; Decltest_ord_mb = '
Re: [Lazarus] Lazarus 2.0.2 EditorMacroScript error on first startup RPi4B
On Sat, 17 Aug 2019 14:12:02 +0200, Martin Frb via lazarus wrote: >On 17/08/2019 14:00, Martin Frb via lazarus wrote: >> >> Could you apply the following patch please: >> https://github.com/User4martin/lazarus/commit/5fa7fac42bb55d23b9654984be1e2e1c08049709 > >Or the patch/commit from latest trunk. Added the verbose to all tests This is somehing I have never done... Could you please explain what you mean I should do in order to "apply the patch"? Step by step please. -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Lazarus 2.0.2 EditorMacroScript error on first startup RPi4B
On 17/08/2019 14:00, Martin Frb via lazarus wrote: Could you apply the following patch please: https://github.com/User4martin/lazarus/commit/5fa7fac42bb55d23b9654984be1e2e1c08049709 Or the patch/commit from latest trunk. Added the verbose to all tests -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Lazarus 2.0.2 EditorMacroScript error on first startup RPi4B
On 17/08/2019 13:31, Bo Berglund via lazarus wrote: On Sat, 17 Aug 2019 11:41:01 +0200, Martin Frb via lazarus wrote: I did not get what issue happens on win64? What is missing? I still do not know what error you get on win7/64 bit Exactly the same as on RPi as I described on my first post in this thread back in July 9: Error in EditorMacroScript The package EditorMacroScript (pascalscript macros) has detected a problem and was deactivated. The package failed its selftest with the message: "Replace All [Exp: True / Got: False]" [OK] Strange. I would expect it to be the same on win7/64 and win10/64. Especially since you get it on first start, with the pre-build lazarus.exe, which is the same exe that I tested with (and it works for me/ win10) Could you apply the following patch please: https://github.com/User4martin/lazarus/commit/5fa7fac42bb55d23b9654984be1e2e1c08049709 (this can be applied to any 2.0.x) Recompile the IDE, under Tools > Option > Editor Macro... >> "Test again", and restart the IDE. You should get a more verbose error. Thanks -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Lazarus 2.0.2 EditorMacroScript error on first startup RPi4B
On Sat, 17 Aug 2019 11:41:01 +0200, Martin Frb via lazarus wrote: >>> I did not get what issue happens on win64? What is missing? >I still do not know what error you get on win7/64 bit Exactly the same as on RPi as I described on my first post in this thread back in July 9: Error in EditorMacroScript The package EditorMacroScript (pascalscript macros) has detected a problem and was deactivated. The package failed its selftest with the message: "Replace All [Exp: True / Got: False]" [OK] Upon starting the Lazarus IDE the first time this dialog box pops up saying the macro stuff will be deactivated. It works the same on Raspbian and Windows. If I remember correctly at first there is the dialog informing about the various parts of fpc it has found (sources etc), then the error dialog pops up. Both will only show on the very first start after installation. -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Lazarus 2.0.2 EditorMacroScript error on first startup RPi4B
On 17/08/2019 10:03, Bo Berglund via lazarus wrote: On Fri, 16 Aug 2019 23:57:51 +0200, Martin Frb via lazarus wrote: On 16/08/2019 23:34, Bo Berglund via lazarus wrote: Given I used the "official" installer it should contain "everything" needed for all enabled functions and yet it does not. It looks I missed something? I got that you get an error on rasbi/arm. I did not get what issue happens on win64? What is missing? I still do not know what error you get on win7/64 bit So questions here again: 1) Does editor macro work (self test passed / enabled in global options), if you remove the following changeset: https://github.com/User4martin/pascalscript/commit/269faf94db7be08f243aa1b1f55b28624e0692d5 Ideally also run the testcase in the componet/pascalscript dir. But I leave that optional. 2) Does it work if the IDE (or relevant packages) are compiled with: -dPasMacroNoNativeCalls (That does not affect the test in the pascalscript dir) 3) If both are applied? I don't even know what the macro system is used for or how to invoke it since on *every* Lazarus install I have done I have encountered the dialog that disables it... So I cannot test. But it seems I can program OK in the IDE without it. You can record "EditorMacros" in the IDE. That is a series of commands to the Editor. And then replay it as often as needed. The basic macro work without PascalScript. So the basic will work for you: https://wiki.lazarus.freepascal.org/IDE_Window:_Editor_Macros With PascalScript you can do more complex Macros. https://wiki.lazarus.freepascal.org/Editor_Macros_PascalScript As for "it works". It should work if it passes the self-test at IDE startup. Tools > Options > Editor Macro Script > Status If it says "Scripting active" then it passed the self test. Here is your first reply in this thread taken from my news archive: So that was the same/similar reply -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Lazarus 2.0.2 EditorMacroScript error on first startup RPi4B
On Fri, 16 Aug 2019 23:57:51 +0200, Martin Frb via lazarus wrote: >On 16/08/2019 23:34, Bo Berglund via lazarus wrote: >> On Fri, 16 Aug 2019 23:02:57 +0200, Martin Frb via lazarus >> wrote: >> >>> That is on a new install. Not on an update, correct? >> It is a new x64 install on Windows 7-x64 using the official installer >> downloaded via the link in the release message. I installed a >> secondary installation so I can keep the old for a while. >> >> Given I used the "official" installer it should contain "everything" >> needed for all enabled functions and yet it does not. >It looks I missed something? I got that you get an error on rasbi/arm. > >I did not get what issue happens on win64? What is missing? > > >> >> On Arm (Raspberry Pi units 2-3-4) I always use svn to get the sources >> and install using my established script for Linux. I did so a few days >> ago on an RPi4 I got a month ago. >> >> But the same dialog on first start as always on RPi... >I understand the frustration. But I currently cannot test myself on >rasberry. And I don't know when I will have the time to change that. It is really not a very big issue, since it goes away after first start of Lazarus after the installation. It does not show up after IDE rebuild following a package installation for example. And because of the disabling I have never ever used it, whatever it is. But since I saw the pop-up again when dealing with 2.0.4 on both RPi and Windows I thought I would mention it On Windows I used the official installer and on RPi I used svn to get the sources and compiled myself. Same result. >I thought I had recently answered to a similar mail about rasbi, >including some pointers. But I cannot find that mail Here is where the GMane news mirror of this mail list is so very useful. I have a complete archive starting Sept 2003 of the Lazarus and freepascal lists in my newsreader's cached data, so I can search and find anything without even being on-line Your reply a month ago below. >So questions here again: > >1) >Does editor macro work (self test passed / enabled in global options), >if you remove the following changeset: >https://github.com/User4martin/pascalscript/commit/269faf94db7be08f243aa1b1f55b28624e0692d5 > >Ideally also run the testcase in the componet/pascalscript dir. But I >leave that optional. > >2) Does it work if the IDE (or relevant packages) are compiled with: >-dPasMacroNoNativeCalls > >(That does not affect the test in the pascalscript dir) > >3) If both are applied? I don't even know what the macro system is used for or how to invoke it since on *every* Lazarus install I have done I have encountered the dialog that disables it... So I cannot test. But it seems I can program OK in the IDE without it. Here is your first reply in this thread taken from my news archive: -- 2019-07-09 - On 09/07/2019 19:03, Bo Berglund via lazarus wrote: > I have just installed fpc 3.0.4 + Lazarus 2.0.2 from svn sources on a > pristine Raspberry Pi4B with 4GB RAM. > > But now (again) on a first ever start of the newly installed Lazarus I > am greeted by a pop-up dialog: > > Error in EditorMacroScript > > It was a while now since I last installed on the bare metal from svn > but still this problem pops up. It has done that every time I can > remember and I even posted here back in 2016 about it. > > Apparently nothing has been done, and I do not know what the > pascalscript really does in the IDE so I cannot say if I will be hit > with some unexplainable error down the road. > Yep nothing has been done since (Except for me hoping, that one day I have the time prioritized to install Laz on a RP myself) Well the underlying PasScript was updated (not sure if in 2.0.x but in trunk). But that seems to have done little for arm. The error happens once only, the result is stored and EMS disabled. There is an entry in the Tools > Options to enable it again (or check the xml files in your conf) PasScript sometimes needs to call code from the project (i.e. binary code). For this it needs to pass params, in the correct registers/stack. Since that can change (calling convention), the IDE performs a selftest. It finds that PS does not work on your platform. There is an alternative calling mechanism. I did not test that yet. Compile the IDE with: -dPasMacroNoNativeCalls Then enable the test again. - Before you try that define, check if the following patch (currently applied) is actually needed https://github.com/User4martin/pascalscript/commit/269faf94db7be08f243aa1b1f55b28624e0692d5 It is something that is not in the original. Not sure though if correct or not. You can also test this patch (or its absence) by running the testcase in the PascalScript package. -- -- Bo Berglund Developer in Sweden -- ___ lazarus mail
Re: [Lazarus] Lazarus 2.0.2 EditorMacroScript error on first startup RPi4B
On 16/08/2019 23:34, Bo Berglund via lazarus wrote: On Fri, 16 Aug 2019 23:02:57 +0200, Martin Frb via lazarus wrote: That is on a new install. Not on an update, correct? It is a new x64 install on Windows 7-x64 using the official installer downloaded via the link in the release message. I installed a secondary installation so I can keep the old for a while. Given I used the "official" installer it should contain "everything" needed for all enabled functions and yet it does not. It looks I missed something? I got that you get an error on rasbi/arm. I did not get what issue happens on win64? What is missing? On Arm (Raspberry Pi units 2-3-4) I always use svn to get the sources and install using my established script for Linux. I did so a few days ago on an RPi4 I got a month ago. But the same dialog on first start as always on RPi... I understand the frustration. But I currently cannot test myself on rasberry. And I don't know when I will have the time to change that. I thought I had recently answered to a similar mail about rasbi, including some pointers. But I cannot find that mail So questions here again: 1) Does editor macro work (self test passed / enabled in global options), if you remove the following changeset: https://github.com/User4martin/pascalscript/commit/269faf94db7be08f243aa1b1f55b28624e0692d5 Ideally also run the testcase in the componet/pascalscript dir. But I leave that optional. 2) Does it work if the IDE (or relevant packages) are compiled with: -dPasMacroNoNativeCalls (That does not affect the test in the pascalscript dir) 3) If both are applied? -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Lazarus 2.0.2 EditorMacroScript error on first startup RPi4B
On Fri, 16 Aug 2019 23:02:57 +0200, Martin Frb via lazarus wrote: > >That is on a new install. Not on an update, correct? It is a new x64 install on Windows 7-x64 using the official installer downloaded via the link in the release message. I installed a secondary installation so I can keep the old for a while. Given I used the "official" installer it should contain "everything" needed for all enabled functions and yet it does not. On Arm (Raspberry Pi units 2-3-4) I always use svn to get the sources and install using my established script for Linux. I did so a few days ago on an RPi4 I got a month ago. But the same dialog on first start as always on RPi... -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Lazarus 2.0.2 EditorMacroScript error on first startup RPi4B
On 16/08/2019 21:07, Bo Berglund via lazarus wrote: Back to this issue again after installing the latest Lazarus 2.0.4 just released. It does the same thing... Is there really nothing one can do to stop it from happening? Yes, I know it just happend once on a new install, but still... That is on a new install. Not on an update, correct? The default is on. SO it will test, and the test result will be shown. It could be generally disabled on arm. Assuming that it really fails for everybody. Otherwise those for whom it does not fail, will not like it disabled. You can copy the test result file into your config. It should have editormacros in the filename, and after the failed test, it should be in your primary conf folder. Or fix PS for arm... Maybe it will work with that alternative compiler define. (I need to look it up, there are some ifdef in that code). If it does then that could be set for arm. Actually at some point I want to set this for all platforms. But that needs changes to the self test (maybe), and testing on all targets And I currently have plenty other stuff to deal with. So I am not working on it. -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Lazarus 2.0.2 EditorMacroScript error on first startup RPi4B
On Tue, 9 Jul 2019 19:39:23 +0200, Martin Frb via lazarus wrote: >On 09/07/2019 19:03, Bo Berglund via lazarus wrote: >> I have just installed fpc 3.0.4 + Lazarus 2.0.2 from svn sources on a >> pristine Raspberry Pi4B with 4GB RAM. >> >> But now (again) on a first ever start of the newly installed Lazarus I >> am greeted by a pop-up dialog: >> >> Error in EditorMacroScript >> >> It was a while now since I last installed on the bare metal from svn >> but still this problem pops up. It has done that every time I can >> remember and I even posted here back in 2016 about it. >> >> Apparently nothing has been done, and I do not know what the >> pascalscript really does in the IDE so I cannot say if I will be hit >> with some unexplainable error down the road. >> >Yep nothing has been done since (Except for me hoping, that one day >I have the time prioritized to install Laz on a RP myself) >Well the underlying PasScript was updated (not sure if in 2.0.x but in >trunk). But that seems to have done little for arm. > >The error happens once only, the result is stored and EMS disabled. >There is an entry in the Tools > Options to enable it again (or check >the xml files in your conf) > >PasScript sometimes needs to call code from the project (i.e. binary code). >For this it needs to pass params, in the correct registers/stack. Since >that can change (calling convention), the IDE performs a selftest. > >It finds that PS does not work on your platform. > >There is an alternative calling mechanism. I did not test that yet. >Compile the IDE with: > -dPasMacroNoNativeCalls >Then enable the test again. > >- >Before you try that define, check if the following patch (currently >applied) is actually needed >https://github.com/User4martin/pascalscript/commit/269faf94db7be08f243aa1b1f55b28624e0692d5 > >It is something that is not in the original. Not sure though if correct >or not. > >You can also test this patch (or its absence) by running the testcase in >the PascalScript package. Back to this issue again after installing the latest Lazarus 2.0.4 just released. It does the same thing... Is there really nothing one can do to stop it from happening? Yes, I know it just happend once on a new install, but still... -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
Re: [Lazarus] Lazarus 2.0.2 EditorMacroScript error on first startup RPi4B
On 09/07/2019 19:03, Bo Berglund via lazarus wrote: I have just installed fpc 3.0.4 + Lazarus 2.0.2 from svn sources on a pristine Raspberry Pi4B with 4GB RAM. But now (again) on a first ever start of the newly installed Lazarus I am greeted by a pop-up dialog: Error in EditorMacroScript It was a while now since I last installed on the bare metal from svn but still this problem pops up. It has done that every time I can remember and I even posted here back in 2016 about it. Apparently nothing has been done, and I do not know what the pascalscript really does in the IDE so I cannot say if I will be hit with some unexplainable error down the road. Yep nothing has been done since (Except for me hoping, that one day I have the time prioritized to install Laz on a RP myself) Well the underlying PasScript was updated (not sure if in 2.0.x but in trunk). But that seems to have done little for arm. The error happens once only, the result is stored and EMS disabled. There is an entry in the Tools > Options to enable it again (or check the xml files in your conf) PasScript sometimes needs to call code from the project (i.e. binary code). For this it needs to pass params, in the correct registers/stack. Since that can change (calling convention), the IDE performs a selftest. It finds that PS does not work on your platform. There is an alternative calling mechanism. I did not test that yet. Compile the IDE with: -dPasMacroNoNativeCalls Then enable the test again. - Before you try that define, check if the following patch (currently applied) is actually needed https://github.com/User4martin/pascalscript/commit/269faf94db7be08f243aa1b1f55b28624e0692d5 It is something that is not in the original. Not sure though if correct or not. You can also test this patch (or its absence) by running the testcase in the PascalScript package. -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus
[Lazarus] Lazarus 2.0.2 EditorMacroScript error on first startup RPi4B
I have just installed fpc 3.0.4 + Lazarus 2.0.2 from svn sources on a pristine Raspberry Pi4B with 4GB RAM. All of the commands my script performs finished OK and the IDE is installed without errors. But now (again) on a first ever start of the newly installed Lazarus I am greeted by a pop-up dialog: Error in EditorMacroScript The package EditorMacroScript (pascalscript macros) has detected a problem and was deactivated. The package failed its selftest with the message: "Replace All [Exp: True / Got: False]" [OK] It was a while now since I last installed on the bare metal from svn but still this problem pops up. It has done that every time I can remember and I even posted here back in 2016 about it. Apparently nothing has been done, and I do not know what the pascalscript really does in the IDE so I cannot say if I will be hit with some unexplainable error down the road. Can someone please explain what this is and how to stop the problem from happening? I think I am not alone having it appear... And I know it will not show anymore, but I want to know what caused it and what is unavailable/not working now that it is deactivated. -- Bo Berglund Developer in Sweden -- ___ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus