Recent

Author Topic: 2.0.8 Clean Install - EditorMacroScript Self-Test Failed Error  (Read 3047 times)

Dan3468298

  • Full Member
  • ***
  • Posts: 131
Hi, did a clean install.   On startup I received error EditorMacroScript failed self-test.   Screenshot attached.  Please advise on how I should handle this error.  Thx, Dan
MacOS 10.15.5/Lazarus 2.0.10 Build 2020-07-07

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9791
  • Debugger - SynEdit - and more
    • wiki
Re: 2.0.8 Clean Install - EditorMacroScript Self-Test Failed Error
« Reply #1 on: June 02, 2020, 04:47:32 pm »
Have you tried to "re-test"?

Tools > Options > Editor macro: test again.
Then restart the IDE, and it will test again.

If it works, then it should be ok.


There is one known (and unsolvable) issue:
The test can fail, if 2 or more IDE are started at the same time. Each IDE, during start, locks the file. If an IDE finds the file locked, it will fail the test.
That is by design. (Its just a fraction of a second, but that fraction can not be avoided).

If it keeps failing, report back with the content of
C:\Users\USERNAME\AppData\Local\lazarus\editormacroscript.xml

It will only report the error again, if you enable the test again. You can check the status in the options

Dan3468298

  • Full Member
  • ***
  • Posts: 131
Re: 2.0.8 Clean Install - EditorMacroScript Self-Test Failed Error
« Reply #2 on: June 02, 2020, 05:17:37 pm »
Failed again.   Below is the contents of stated file found in /System/Volumes/Data/Users/user/.lazarus:

Code: Pascal  [Select][+][-]
  1. $ cat editormacroscript.xml
  2. <?xml version="1.0" encoding="UTF-8"?>
  3. <CONFIG>
  4.   <EMS>
  5.     <Settings SelfTestError="Failed point param X [Exp: 1001 / Got: -1 / Info: False  / SynTxt: ]" SelfTestFailed="1"/>
  6.   </EMS>
  7. </CONFIG>
MacOS 10.15.5/Lazarus 2.0.10 Build 2020-07-07

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9791
  • Debugger - SynEdit - and more
    • wiki
Re: 2.0.8 Clean Install - EditorMacroScript Self-Test Failed Error
« Reply #3 on: June 02, 2020, 05:34:50 pm »
I should have looked at the image you attached....
 The "TPoint" issue on Mac......

I can't currently test it myself, but:
Code: Pascal  [Select][+][-]
  1. {$IFDEF darwin}
  2.   {$DEFINE NeedTPointFix }
  3. {$ENDIF}

Not sure if "darwin" still applies? (Especially if you use cocoa?)

If that does not apply, try compiling the IDE with -dNeedTPointFix
Or remove the "IFDEF" (in several files in the package / in components/macroscript/* )

If that is getting defined, maybe it is not needed any more, try removing the define.


Note, that the code already has been rewritten in 2.1. So the next major release should not be affected.

Dan3468298

  • Full Member
  • ***
  • Posts: 131
Re: 2.0.8 Clean Install - EditorMacroScript Self-Test Failed Error
« Reply #4 on: June 02, 2020, 06:12:22 pm »
I had to install command line tools for Catalina so yes using Cocoa.    But even after doing this same Script error.  Regarding your Darwin comment, I don't understnad that.  Darwin is the kernel of MacOS.

On running Form1 default code I get:

Compile Project, Target: /Users/user/tmp/project1: Exit code 1, Errors: 1
Linking /Users/user/tmp/project1
ld: file not found: /usr/lib/crt1.10.5.o
An error occurred while linking
project1.lpr(23,0) Error: Error while linking

And I get a start up message about debugger I don't understand so I picked '2 Sets' which was the deflault button.  See attached screenshot. 

« Last Edit: June 02, 2020, 06:15:31 pm by Dan3468298 »
MacOS 10.15.5/Lazarus 2.0.10 Build 2020-07-07

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9791
  • Debugger - SynEdit - and more
    • wiki
Re: 2.0.8 Clean Install - EditorMacroScript Self-Test Failed Error
« Reply #5 on: June 02, 2020, 07:04:10 pm »
Quote
An error occurred while linking
project1.lpr(23,0) Error: Error while linking
That is not related to the MacroScript issue. (Neither is anything that relates to compiling your project).
And I do not know the answer to that part.


The Message you got with the debugger: Yes, "dwarf with sets" is fine. Any of the 3 should work.
Dwarf3 may get better display of watches. But it may (in theory) cause issues with lldb. (There are no known issues with dwarf3 and lldb).

You can change that in Menu: Project > Project Options => Page: Debugger



Quote
Regarding your Darwin comment, I don't understnad that.

My previous post was about recompiling the IDE itself.

A bit of background...

The error you get relates to the "PascalScript" used in the IDE.

The source code editor in the IDE can record (and re-play) macros. https://wiki.lazarus.freepascal.org/IDE_Window:_Editor_Macros
The editor also supports Macros written in PascalScript. https://wiki.lazarus.freepascal.org/Editor_Macros_PascalScript

The first part works independent of the PascalScript. Only the 2nd part requires PascalScript.

If you do not use that 2nd part, then you can ignore the "EditorMacroScript  self-test failed".
The IDE remembers that it failed, it will not repeat the test, and it will not bother you again.
(When Lazarus 2.2 is released you can try it again if you want)

If you want to use PascalScript in editor-macros, then you need to rebuild the IDE.
To rebuild the IDE, you can use menu Tools > "Rebuild IDE"   or "Configure rebuild IDE"
(or the command line)

Since I currently cannot test, I cannot say for sure what the problem is, and what will fix it. But there is a pretty good chance that it has to do with that old workaround for TPoint.
That has caused issues in the past, and was fixed back then. But things may have changed.

"{$IFDEF darwin}"
The fpc compiler defines various values depending on your environment.
I am not sure in which cases it defines "darwin" (I did test that many years back, way before cocoa).

Also that "workaround" was needed and tested back then. It was only ever tested for 32bit.

I can currently not tell, if:
- your IDE compiles with or without that workaround
- if that workaround is needed for 64bit cocoa.

But from the error it is likely that either:
- the workaround is needed, but not included
- the workaround is not needed, but included

So if you want that to work, you need to recompile your IDE, with the setting for the workaround changed.
- Either force it to be included (if it currently is not)
- Or force it to be not included (remove the {$DEFINE NeedTPointFix } from the sources (IIRC 2 source files))

Dan3468298

  • Full Member
  • ***
  • Posts: 131
Re: 2.0.8 Clean Install - EditorMacroScript Self-Test Failed Error
« Reply #6 on: June 02, 2020, 08:04:31 pm »
I should have include all the output code, sorry!  Here it is:

Code: Pascal  [Select][+][-]
  1. Compile Project, Target: /Users/danstar/tmp/project1: Exit code 1, Errors: 1
  2. Linking /Users/danstar/tmp/project1
  3. ld: file not found: /usr/lib/crt1.10.5.o
  4. An error occurred while linking
  5. project1.lpr(23,0) Error: Error while linking
  6.  

So this crt1.10.5.o file is causing the linking error?   The Install Wiki mentions it at https://wiki.freepascal.org/Installing_Lazarus_on_macOS#Uninstalling_Lazarus_and_Free_Pascal

Upgrading from Mojave (10.14) to Catalina (10.15)

run "xcode-select --install"
to find the crt1.10.5 change in /etc/fpc.cfg the -Fl behind "#ifdef cpux86_64" from
-Fl/Applications/Xcode.app/Contents/Developer/Toolchain...
to

-Fl/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/

MacOS 10.15.5/Lazarus 2.0.10 Build 2020-07-07

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9791
  • Debugger - SynEdit - and more
    • wiki
Re: 2.0.8 Clean Install - EditorMacroScript Self-Test Failed Error
« Reply #7 on: June 02, 2020, 08:17:53 pm »
So this crt1.10.5.o file is causing the linking error?   

Probably, but this is off topic to your original question.
And it is unrelated to the subject of this topic. Which means people who may know, may not be reading this thread. Better ask this question in a thread of it's own.

I do not use Mac, so I can not help you with that particular issue.


I am however the author of the EditorMacroScript package (not the PascalScript package, that is 3rd party).
That is why I answered to this thread.

(I also have some background on the debugger, so that's why I happened to be able to answer that too).

TRon

  • Hero Member
  • *****
  • Posts: 2433
Re: 2.0.8 Clean Install - EditorMacroScript Self-Test Failed Error
« Reply #8 on: June 02, 2020, 08:30:52 pm »
So this crt1.10.5.o file is causing the linking error?
How much clearer do you wish for the tool chain to inform you ?  :)

Quote
ld: file not found: /usr/lib/crt1.10.5.o
An error occurred while linking
project1.lpr(23,0) Error: Error while linking
File not found. Name of file "/usr/lib/crt1.10.5.o".

The fact that the file is missing (have you checked for that location/filename?) is causing the issue, the file itself is not the cause for the error as the linker was not even able to process that particular file.

Perhaps a bit of a pedantic reply from my side (sorry for that) but, since you seem to doubt better be clear about it  :)

edit: fixed small typo
« Last Edit: June 02, 2020, 08:35:52 pm by TRon »

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9791
  • Debugger - SynEdit - and more
    • wiki
Re: 2.0.8 Clean Install - EditorMacroScript Self-Test Failed Error
« Reply #9 on: June 02, 2020, 08:49:28 pm »
Btw, search for that filename on the forum. There are plenty of threads. Maybe one of them has the answer.

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2020
  • Former Delphi 1-7, 10.2 user
Re: 2.0.8 Clean Install - EditorMacroScript Self-Test Failed Error
« Reply #10 on: June 03, 2020, 04:27:56 am »
The solution to the file not found is in the bit you quoted above from the Wiki. File locations changed.

On Mojave:

Quote
trev@macmini6 [/Users/trev] $ locate crt1.10.5.o
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/crt1.10.5.o
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/crt1.10.5.o
/usr/lib/crt1.10.5.o
/usr/local/lib/crt1.10.5.o

On Catalina:

Quote
trev@dynamic32 [/Users/trev] $ locate crt1.10.5.o
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/crt1.10.5.o
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/lib/crt1.10.5.o
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/lib/crt1.10.5.o

Dan3468298

  • Full Member
  • ***
  • Posts: 131
Re: 2.0.8 Clean Install - EditorMacroScript Self-Test Failed Error
« Reply #11 on: June 03, 2020, 05:59:14 pm »
Quote
An error occurred while linking
project1.lpr(23,0) Error: Error while linking
That is not related to the MacroScript issue. (Neither is anything that relates to compiling your project).
And I do not know the answer to that part.


The Message you got with the debugger: Yes, "dwarf with sets" is fine. Any of the 3 should work.
Dwarf3 may get better display of watches. But it may (in theory) cause issues with lldb. (There are no known issues with dwarf3 and lldb).

You can change that in Menu: Project > Project Options => Page: Debugger



Quote
Regarding your Darwin comment, I don't understnad that.

My previous post was about recompiling the IDE itself.

A bit of background...

The error you get relates to the "PascalScript" used in the IDE.

The source code editor in the IDE can record (and re-play) macros. https://wiki.lazarus.freepascal.org/IDE_Window:_Editor_Macros
The editor also supports Macros written in PascalScript. https://wiki.lazarus.freepascal.org/Editor_Macros_PascalScript

The first part works independent of the PascalScript. Only the 2nd part requires PascalScript.

If you do not use that 2nd part, then you can ignore the "EditorMacroScript  self-test failed".
The IDE remembers that it failed, it will not repeat the test, and it will not bother you again.
(When Lazarus 2.2 is released you can try it again if you want)

If you want to use PascalScript in editor-macros, then you need to rebuild the IDE.
To rebuild the IDE, you can use menu Tools > "Rebuild IDE"   or "Configure rebuild IDE"
(or the command line)

Since I currently cannot test, I cannot say for sure what the problem is, and what will fix it. But there is a pretty good chance that it has to do with that old workaround for TPoint.
That has caused issues in the past, and was fixed back then. But things may have changed.

"{$IFDEF darwin}"
The fpc compiler defines various values depending on your environment.
I am not sure in which cases it defines "darwin" (I did test that many years back, way before cocoa).

Also that "workaround" was needed and tested back then. It was only ever tested for 32bit.

I can currently not tell, if:
- your IDE compiles with or without that workaround
- if that workaround is needed for 64bit cocoa.

But from the error it is likely that either:
- the workaround is needed, but not included
- the workaround is not needed, but included

So if you want that to work, you need to recompile your IDE, with the setting for the workaround changed.
- Either force it to be included (if it currently is not)
- Or force it to be not included (remove the {$DEFINE NeedTPointFix } from the sources (IIRC 2 source files))

Thank you for your help!
MacOS 10.15.5/Lazarus 2.0.10 Build 2020-07-07

Dan3468298

  • Full Member
  • ***
  • Posts: 131
Re: 2.0.8 Clean Install - EditorMacroScript Self-Test Failed Error
« Reply #12 on: June 03, 2020, 08:15:47 pm »
Lazarus compiles test project and runs OK now.   Thanks for help.  Will keep an eye on the EditorMacroScript issue.
MacOS 10.15.5/Lazarus 2.0.10 Build 2020-07-07

 

TinyPortal © 2005-2018