ppv / NPPFSIPlugin

Plugin for hosting F# interactive inside Notepad++
Other
11 stars 6 forks source link

Build failing on Delphi 10.3 #7

Closed rdipardo closed 1 year ago

rdipardo commented 3 years ago

This project can't be built with Delphi 10.3.3 (version 26.0.36039.7899)

The problem is coming from these two units:

FSIWrapper.pas

The doOnEditorCopyContextMenuClick procedure is never defined in the implementation section, causing 2 errors:

https://github.com/ppv/NPPFSIPlugin/blob/dc5f2c7eb4a89df980583a909af1072c8ae9a395/Source/Plugin/Src/FSIWrapper.pas#L465-L468

Output

Checking project dependencies...
Compiling NPPFSIPlugin.dproj (Release, Win32)
dcc32 command line for "NPPFSIPlugin.dpr"
  c:\program files (x86)\embarcadero\studio\20.0\bin\dcc32.exe -$D0 -$L- -$Y- --no-config -M -Q -TX.dll
  -AGenerics.Collections=System.Generics.Collections;Generics.Defaults=System.Generics.Defaults;WinTypes=Winapi.Windows;WinProcs=Winapi.Windows;
  DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE -DRELEASE -EBin\Release -I"c:\program files (x86)\embarcadero\studio\20.0\lib\Win32\release";
  C:\Users\Rob\Documents\Embarcadero\Studio\20.0\Imports;"c:\program files (x86)\embarcadero\studio\20.0\Imports";
  C:\Users\Public\Documents\Embarcadero\Studio\20.0\Dcp;"c:\program files (x86)\embarcadero\studio\20.0\include"
  -LEC:\Users\Public\Documents\Embarcadero\Studio\20.0\Bpl -LNC:\Users\Public\Documents\Embarcadero\Studio\20.0\Dcp -NULib\Release -NSWinapi;System.Win;
  Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;System;Xml;Data;Datasnap;Web;Soap;Winapi;Vcl; -O"c:\program files
  (x86)\embarcadero\studio\20.0\lib\Win32\release";C:\Users\Rob\Documents\Embarcadero\Studio\20.0\Imports;"c:\program files
  (x86)\embarcadero\studio\20.0\Imports";C:\Users\Public\Documents\Embarcadero\Studio\20.0\Dcp;"c:\program files (x86)\embarcadero\studio\20.0\include"
  -R"c:\program files (x86)\embarcadero\studio\20.0\lib\Win32\release";C:\Users\Rob\Documents\Embarcadero\Studio\20.0\Imports;"c:\program files
  (x86)\embarcadero\studio\20.0\Imports";C:\Users\Public\Documents\Embarcadero\Studio\20.0\Dcp;"c:\program files (x86)\embarcadero\studio\20.0\include"
  -U"c:\program files (x86)\embarcadero\studio\20.0\lib\Win32\release";C:\Users\Rob\Documents\Embarcadero\Studio\20.0\Imports;"c:\program files
  (x86)\embarcadero\studio\20.0\Imports";C:\Users\Public\Documents\Embarcadero\Studio\20.0\Dcp;"c:\program files (x86)\embarcadero\studio\20.0\include"
  -K00400000 -NBC:\Users\Public\Documents\Embarcadero\Studio\20.0\Dcp -NHC:\Users\Public\Documents\Embarcadero\Studio\20.0\hpp\Win32 -NOLib\Release
  NPPFSIPlugin.dpr
[dcc32 Error] FSIWrapper.pas(466): E2004 Identifier redeclared: 'TFSIViewer.doOnEditorClearContextMenuClick'
[dcc32 Error] FSIWrapper.pas(117): E2065 Unsatisfied forward or external declaration: 'TFSIViewer.doOnEditorCopyContextMenuClick'
[dcc32 Hint] FSIWrapper.pas(117): H2219 Private symbol 'doOnEditorCopyContextMenuClick' declared but never used
[dcc32 Fatal Error] NPPFSIPlugin.dpr(40): F2063 Could not compile used unit 'FSIWrapper.pas'
Failed
Elapsed time: 00:00:00.4
[Warning] W1002 Symbol 'TThreadPriority' is specific to a platform
[Warning] W1000 Symbol 'RaiseList' is deprecated: 'Use AcquireExceptionObject'
[Warning] W1000 Symbol 'RaiseLastWin32Error' is deprecated: 'Use RaiseLastOSError'

Pipes.pas

Windows.WriteProcessMemory is being passed a DWORD for the lpNumberOfBytesWritten parameter, but the function specification requires the wider SIZE_T type. The compiler is throwing E2033 wherever WriteProcessMemory is called:

Output

Checking project dependencies...
Compiling NPPFSIPlugin.dproj (Release, Win32)
dcc32 command line for "NPPFSIPlugin.dpr"
  c:\program files (x86)\embarcadero\studio\20.0\bin\dcc32.exe -$D0 -$L- -$Y- --no-config -M -Q -TX.dll
  -AGenerics.Collections=System.Generics.Collections;Generics.Defaults=System.Generics.Defaults;WinTypes=Winapi.Windows;WinProcs=Winapi.Windows;
  DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE -DRELEASE -EBin\Release -I"c:\program files (x86)\embarcadero\studio\20.0\lib\Win32\release";
  C:\Users\Rob\Documents\Embarcadero\Studio\20.0\Imports;"c:\program files (x86)\embarcadero\studio\20.0\Imports";
  C:\Users\Public\Documents\Embarcadero\Studio\20.0\Dcp;"c:\program files (x86)\embarcadero\studio\20.0\include"
  -LEC:\Users\Public\Documents\Embarcadero\Studio\20.0\Bpl -LNC:\Users\Public\Documents\Embarcadero\Studio\20.0\Dcp -NULib\Release -NSWinapi;System.Win;
  Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;System;Xml;Data;Datasnap;Web;Soap;Winapi;Vcl; -O"c:\program files
  (x86)\embarcadero\studio\20.0\lib\Win32\release";C:\Users\Rob\Documents\Embarcadero\Studio\20.0\Imports;"c:\program files
  (x86)\embarcadero\studio\20.0\Imports";C:\Users\Public\Documents\Embarcadero\Studio\20.0\Dcp;"c:\program files (x86)\embarcadero\studio\20.0\include"
  -R"c:\program files (x86)\embarcadero\studio\20.0\lib\Win32\release";C:\Users\Rob\Documents\Embarcadero\Studio\20.0\Imports;"c:\program files
  (x86)\embarcadero\studio\20.0\Imports";C:\Users\Public\Documents\Embarcadero\Studio\20.0\Dcp;"c:\program files (x86)\embarcadero\studio\20.0\include"
  -U"c:\program files (x86)\embarcadero\studio\20.0\lib\Win32\release";C:\Users\Rob\Documents\Embarcadero\Studio\20.0\Imports;"c:\program files
  (x86)\embarcadero\studio\20.0\Imports";C:\Users\Public\Documents\Embarcadero\Studio\20.0\Dcp;"c:\program files (x86)\embarcadero\studio\20.0\include"
  -K00400000 -NBC:\Users\Public\Documents\Embarcadero\Studio\20.0\Dcp -NHC:\Users\Public\Documents\Embarcadero\Studio\20.0\hpp\Win32 -NOLib\Release
  NPPFSIPlugin.dpr
[dcc32 Warning] Pipes.pas(678): W1002 Symbol 'TThreadPriority' is specific to a platform
[dcc32 Warning] Pipes.pas(678): W1002 Symbol 'TThreadPriority' is specific to a platform
[dcc32 Warning] Pipes.pas(699): W1002 Symbol 'TThreadPriority' is specific to a platform
[dcc32 Warning] Pipes.pas(699): W1002 Symbol 'TThreadPriority' is specific to a platform
[dcc32 Warning] Pipes.pas(702): W1002 Symbol 'TThreadPriority' is specific to a platform
[dcc32 Warning] Pipes.pas(702): W1002 Symbol 'TThreadPriority' is specific to a platform
[dcc32 Warning] Pipes.pas(727): W1002 Symbol 'TThreadPriority' is specific to a platform
[dcc32 Warning] Pipes.pas(727): W1002 Symbol 'TThreadPriority' is specific to a platform
[dcc32 Warning] Pipes.pas(1163): W1002 Symbol 'TThreadPriority' is specific to a platform
[dcc32 Warning] Pipes.pas(1163): W1002 Symbol 'TThreadPriority' is specific to a platform
[dcc32 Warning] Pipes.pas(1164): W1002 Symbol 'TThreadPriority' is specific to a platform
[dcc32 Warning] Pipes.pas(1164): W1002 Symbol 'TThreadPriority' is specific to a platform
[dcc32 Warning] Pipes.pas(1192): W1002 Symbol 'TThreadPriority' is specific to a platform
[dcc32 Warning] Pipes.pas(1192): W1002 Symbol 'TThreadPriority' is specific to a platform
[dcc32 Hint] Pipes.pas(2275): H2443 Inline function 'TList.Remove' has not been expanded because unit 'System.Types' is not specified in USES list
[dcc32 Hint] Pipes.pas(3937): H2443 Inline function 'TList.Remove' has not been expanded because unit 'System.Types' is not specified in USES list
[dcc32 Error] Pipes.pas(4156): E2033 Types of actual and formal var parameters must be identical
[dcc32 Error] Pipes.pas(4255): E2033 Types of actual and formal var parameters must be identical
[dcc32 Error] Pipes.pas(4265): E2033 Types of actual and formal var parameters must be identical
[dcc32 Fatal Error] NPPFSIPlugin.dpr(37): F2063 Could not compile used unit 'Pipes.pas'
Failed
Elapsed time: 00:00:00.5
[Warning] W1002 Symbol 'TThreadPriority' is specific to a platform
[Warning] W1000 Symbol 'RaiseList' is deprecated: 'Use AcquireExceptionObject'
[Warning] W1000 Symbol 'RaiseLastWin32Error' is deprecated: 'Use RaiseLastOSError'
ppv commented 3 years ago

If I remember right, code was developed in Delphi 2007. That was pre-unicode and pre all the stuff that came after that. So I don't expect the code to compile in newer versions of Delphi. Porting the code might not be an easy task.

I didn't know that the plugin was still being used. I had plans for a newer version that had better integration with F# but never got the time to do it.

rdipardo commented 3 years ago

It's still available from the official plugin repository:

Screenshot 2021-08-07 212206

I find it useful, and very fast (thanks to Russell Libby's Pipes unit).

If you ever decide to make a new version, you may want to use the newer Pipes unit that François Piette shared on his blog some time ago. The inline assembly was updated for 64-bit registers.

rdipardo commented 1 year ago

My fork resolves this problem, among others.