Closed polluks2 closed 2 years ago
Please provide more context like: OS, PasFetch version and where you are building this from (e.g. AUR package), with this alone I can't find any decernable reason for those Errors except for your FPC version being broken or a missing use in the source.
I know you have no BSD support, but compiling should be possible... NetBSD version 8.2 (netbsd@localhost) (gcc version 5.5.0) NetBSD 8.2 (GENERIC) #0: Tue Mar 31 05:08:40 UTC 2020
This is very strange, could you, inorder to verify that the problem is not with your fpc installation, try to compile this test program and tell me if it compiles?
program Test;
uses StrUtils, SysUtils;
begin
writeln(SplitString('foo bar', ' ')[1]);
end.
This seems to be the explanation
$ find /usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/ -iname s??utils*
/usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/rtl/sysutils.ppu
/usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/rtl/sysutils.o
/usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/rtl-objpas/strutils.o
/usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/rtl-objpas/strutils.ppu
/usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/rtl-objpas/strutils.rsj
Ah, seems like strutils are only available in ObjectPascal. You could try adding the objfpc compiler flag (`{$mode objfpc}) to PasFetch.pas, that should allow it to use the strutils unit. I'm currently not sure if that flag conflicts with the delphi flag, but it is worth a try.
EDIT: The current source code does not work in Object Pascal mode because of some type mismatches between ShortStrings and AnsiStrings in PasFetch. You could still test what i stated above with my previous code example instead of pasfetch.
Indeed, Error: Mode switch "OBJFPC" not allowed here
...
Ok, but could you test compiling the example I gave above with the objfpc mode? If that works, I'll gladly refactor PasFetch to work in objfpc.
Well, the example cannot find StrUtils in both modes, rtl-objpas is not part of the path.
[0.105] (TEST) Load from TEST (implementation) unit STRUTILS
[0.105] (STRUTILS) Loading unit STRUTILS
[0.105] Unitsearch: StrUtils.ppu
[0.105] Searching file StrUtils.ppu... not found
[0.105] Searching file strutils.ppu... not found
[0.105] Searching file STRUTILS.PPU... not found
[0.105] Unitsearch: StrUtils.pp
[0.105] Searching file StrUtils.pp... not found
[0.105] Searching file strutils.pp... not found
[0.105] Searching file STRUTILS.PP... not found
[0.105] Unitsearch: StrUtils.pas
[0.105] Searching file StrUtils.pas... not found
[0.105] Searching file strutils.pas... not found
[0.105] Searching file STRUTILS.PAS... not found
[0.105] Unitsearch: /usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/rtl/StrUtils.ppu
[0.105] Searching file /usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/rtl/StrUtils.ppu... not found
[0.105] Searching file /usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/rtl/strutils.ppu... not found
[0.105] Searching file /usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/rtl/STRUTILS.PPU... not found
[0.105] Unitsearch: /usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/rtl/StrUtils.pp
[0.105] Searching file /usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/rtl/StrUtils.pp... not found
[0.105] Searching file /usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/rtl/strutils.pp... not found
[0.105] Searching file /usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/rtl/STRUTILS.PP... not found
[0.105] Unitsearch: /usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/rtl/StrUtils.pas
[0.105] Searching file /usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/rtl/StrUtils.pas... not found
[0.105] Searching file /usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/rtl/strutils.pas... not found
[0.105] Searching file /usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/rtl/STRUTILS.PAS... not found
[0.105] Unitsearch: /usr/local/bin/StrUtils.ppu
[0.109] Searching file /usr/local/bin/StrUtils.ppu... not found
[0.109] Searching file /usr/local/bin/strutils.ppu... not found
[0.109] Searching file /usr/local/bin/STRUTILS.PPU... not found
[0.109] Unitsearch: /usr/local/bin/StrUtils.pp
[0.109] Searching file /usr/local/bin/StrUtils.pp... not found
[0.109] Searching file /usr/local/bin/strutils.pp... not found
[0.109] Searching file /usr/local/bin/STRUTILS.PP... not found
[0.109] Unitsearch: /usr/local/bin/StrUtils.pas
[0.109] Searching file /usr/local/bin/StrUtils.pas... not found
[0.109] Searching file /usr/local/bin/strutils.pas... not found
[0.109] Searching file /usr/local/bin/STRUTILS.PAS... not found
[0.109] Unitsearch: StrUtils.pp
[0.109] Searching file StrUtils.pp... not found
[0.109] Searching file strutils.pp... not found
[0.109] Searching file STRUTILS.PP... not found
[0.109] Unitsearch: StrUtils.pas
[0.109] Searching file StrUtils.pas... not found
[0.109] Searching file strutils.pas... not found
[0.109] Searching file STRUTILS.PAS... not found
[0.109] Unitsearch: /usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/rtl/StrUtils.pp
[0.109] Searching file /usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/rtl/StrUtils.pp... not found
[0.109] Searching file /usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/rtl/strutils.pp... not found
[0.109] Searching file /usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/rtl/STRUTILS.PP... not found
[0.109] Unitsearch: /usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/rtl/StrUtils.pas
[0.109] Searching file /usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/rtl/StrUtils.pas... not found
[0.109] Searching file /usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/rtl/strutils.pas... not found
[0.109] Searching file /usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/rtl/STRUTILS.PAS... not found
[0.109] Unitsearch: /usr/local/bin/StrUtils.pp
[0.109] Searching file /usr/local/bin/StrUtils.pp... not found
[0.109] Searching file /usr/local/bin/strutils.pp... not found
[0.109] Searching file /usr/local/bin/STRUTILS.PP... not found
[0.109] Unitsearch: /usr/local/bin/StrUtils.pas
[0.109] Searching file /usr/local/bin/StrUtils.pas... not found
[0.109] Searching file /usr/local/bin/strutils.pas... not found
[0.109] Searching file /usr/local/bin/STRUTILS.PAS... not found
[0.109] xx.pas(4,16) Fatal: Can't find unit StrUtils used by Test
ok this is most definetly a netbsd specific fpc bug and not with pasfetch.
Thanks, now it compiles with these paths:
-Fu/usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/fcl-base
-Fu/usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/fcl-process
-Fu/usr/local/lib/fpc/3.2.2/units/x86_64-netbsd/rtl-objpas