[Lazarus] Lazarus 2.0.2 EditorMacroScript error on first startup RPi4B

classic Classic list List threaded Threaded
30 messages Options
12
Reply | Threaded
Open this post in threaded view
|

[Lazarus] Lazarus 2.0.2 EditorMacroScript error on first startup RPi4B

Free Pascal - Lazarus mailing list
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
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus 2.0.2 EditorMacroScript error on first startup RPi4B

Free Pascal - Lazarus mailing list
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
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus 2.0.2 EditorMacroScript error on first startup RPi4B

Free Pascal - Lazarus mailing list
On Tue, 9 Jul 2019 19:39:23 +0200, Martin Frb via lazarus
<[hidden email]> 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
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus 2.0.2 EditorMacroScript error on first startup RPi4B

Free Pascal - Lazarus mailing list
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
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus 2.0.2 EditorMacroScript error on first startup RPi4B

Free Pascal - Lazarus mailing list
On Fri, 16 Aug 2019 23:02:57 +0200, Martin Frb via lazarus
<[hidden email]> 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
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus 2.0.2 EditorMacroScript error on first startup RPi4B

Free Pascal - Lazarus mailing list
On 16/08/2019 23:34, Bo Berglund via lazarus wrote:

> On Fri, 16 Aug 2019 23:02:57 +0200, Martin Frb via lazarus
> <[hidden email]> 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
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus 2.0.2 EditorMacroScript error on first startup RPi4B

Free Pascal - Lazarus mailing list
On Fri, 16 Aug 2019 23:57:51 +0200, Martin Frb via lazarus
<[hidden email]> 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
>> <[hidden email]> 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 mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus 2.0.2 EditorMacroScript error on first startup RPi4B

Free Pascal - Lazarus mailing list
On 17/08/2019 10:03, Bo Berglund via lazarus wrote:
> On Fri, 16 Aug 2019 23:57:51 +0200, Martin Frb via lazarus
> <[hidden email]> 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
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus 2.0.2 EditorMacroScript error on first startup RPi4B

Free Pascal - Lazarus mailing list
On Sat, 17 Aug 2019 11:41:01 +0200, Martin Frb via lazarus
<[hidden email]> 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
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus 2.0.2 EditorMacroScript error on first startup RPi4B

Free Pascal - Lazarus mailing list
On 17/08/2019 13:31, Bo Berglund via lazarus wrote:

> On Sat, 17 Aug 2019 11:41:01 +0200, Martin Frb via lazarus
> <[hidden email]> 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
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus 2.0.2 EditorMacroScript error on first startup RPi4B

Free Pascal - Lazarus mailing list
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
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus 2.0.2 EditorMacroScript error on first startup RPi4B

Free Pascal - Lazarus mailing list
On Sat, 17 Aug 2019 14:12:02 +0200, Martin Frb via lazarus
<[hidden email]> 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
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus 2.0.2 EditorMacroScript error on first startup RPi4B

Free Pascal - Lazarus mailing list
On 17/08/2019 15:31, Bo Berglund via lazarus wrote:
On Sat, 17 Aug 2019 14:12:02 +0200, Martin Frb via lazarus
[hidden email] 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 




--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus

emsselftest.pas (35K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus 2.0.2 EditorMacroScript error on first startup RPi4B

Free Pascal - Lazarus mailing list
On Sat, 17 Aug 2019 16:43:38 +0200, Martin Frb via lazarus
<[hidden email]> 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
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus 2.0.2 EditorMacroScript error on first startup RPi4B

Free Pascal - Lazarus mailing list
On 17/08/2019 18:23, Bo Berglund via lazarus wrote:

> On Sat, 17 Aug 2019 16:43:38 +0200, Martin Frb via lazarus
> <[hidden email]> 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
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus 2.0.2 EditorMacroScript error on first startup RPi4B

Free Pascal - Lazarus mailing list
On Sat, 17 Aug 2019 18:43:01 +0200, Martin Frb via lazarus
<[hidden email]> 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
>> <[hidden email]> 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:

<?xml version="1.0" encoding="UTF-8"?>
<CONFIG/>

>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
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus 2.0.2 EditorMacroScript error on first startup RPi4B

Free Pascal - Lazarus mailing list
On 17/08/2019 21:52, Bo Berglund via lazarus wrote:
> On Sat, 17 Aug 2019 18:43:01 +0200, Martin Frb via lazarus
> <[hidden email]> 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:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <CONFIG/>
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
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus 2.0.2 EditorMacroScript error on first startup RPi4B

Free Pascal - Lazarus mailing list
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:
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <CONFIG/>
> 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
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus 2.0.2 EditorMacroScript error on first startup RPi4B

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
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
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Lazarus 2.0.2 EditorMacroScript error on first startup RPi4B

Free Pascal - Lazarus mailing list
On Sun, 18 Aug 2019 01:27:12 +0200, Martin Frb via lazarus
<[hidden email]> 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
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
12