[fpc-devel] Failing Lazarus Codetools Pas2JS-related tests

Maxim Ganetsky ganmax at narod.ru
Mon Dec 25 21:03:08 CET 2023


25.12.2023 18:35, Michael Van Canneyt via fpc-devel пишет:
>
>
> On Mon, 25 Dec 2023, Maxim Ganetsky via fpc-devel wrote:
>
>>> ||
>>> -Fu$CfgDir../lib/fpc/3.3.1/pas2js/rtl/src
>>> |
>>
>> I see that there are missing directory separators after $CfgDir, 
>> maybe this is the reason?
>
> I added it.
>
Thanks. But still no luck. It seems like asterisks in config file are 
not expanded properly. See the output of compilation run for a trivial 
"Hello, World!" program:

$ cat hello.pas
|
program hello;
||
begin
||
writeln('Hello, World!');
end.
||
$ pas2js -va hello.pas
||
Debug: quick handling option "hello.pas"
||
Info: Configfile search: /root/.pas2js.cfg
||
Info: Configfile search: /usr/local/bin/pas2js.cfg
||
Info: Reading options from file "/usr/local/bin/pas2js.cfg"
||
Debug: interpreting file option "#"
||
Debug: interpreting file option "# Minimal config file for pas2js compiler"
||
Debug: interpreting file option "#"
||
Debug: interpreting file option "# -d is the same as #DEFINE"
||
Debug: interpreting file option "# -u is the same as #UNDEF"
||
Debug: interpreting file option "#"
||
Debug: interpreting file option "# Write always a nice logo ;)"
||
Debug: interpreting file option "-l"
||
Debug: handling option "-l"
||
Debug: interpreting file option ""
||
Debug: interpreting file option "# Display Warnings, Notes and Hints"
||
Debug: interpreting file option "-vwnh"
||
Debug: handling option "-vwnh"
||
Debug: interpreting file option "# If you don't want so much verbosity use"
||
Debug: interpreting file option "#-vw"
||
Debug: interpreting file option ""
||
Debug: interpreting file option "#IFDEF FPC_SUBTARGET_NAMESPACED"
||
/usr/local/bin/pas2js.cfg(15,1) Debug: cfg directive "#IFDEF 
FPC_SUBTARGET_NAMESPACED": false -> skip
||
Debug: interpreting file option 
"-Fu$CfgDir/../lib/fpc/3.3.1/pas2js/*/namespaced"
||
Debug: interpreting file option "-Fi$CfgDir/../lib/fpc/3.3.1/pas2js/*/src"
||
Debug: interpreting file option "-Fu$CfgDir/../lib/fpc/3.3.1/pas2js/rtl/src"
||
Debug: interpreting file option "#else"
||
/usr/local/bin/pas2js.cfg(19,1) Debug: cfg directive "#else": execute
||
Debug: interpreting file option "-Fu$CfgDir/../lib/fpc/3.3.1/pas2js/*/src"
||
Debug: handling option "-Fu$CfgDir/../lib/fpc/3.3.1/pas2js/*/src"
||
Debug: interpreting file option "#endif"
||
Debug: interpreting file option ""
||
Debug: interpreting file option "#IFDEF nodejs"
||
/usr/local/bin/pas2js.cfg(23,1) Debug: cfg directive "#IFDEF nodejs": 
false -> skip
||
Debug: interpreting file option "-Jirtl.js"
||
Debug: interpreting file option "#ENDIF"
||
/usr/local/bin/pas2js.cfg(25,1) Debug: cfg directive "#ENDIF": end block
||
Debug: interpreting file option ""
||
Debug: interpreting file option "# Put all generated JavaScript into one 
file"
||
Debug: interpreting file option "-Jc"
||
Debug: handling option "-Jc"
||
Debug: interpreting file option ""
||
Debug: interpreting file option "# end."
||
Info: End of reading config file "/usr/local/bin/pas2js.cfg"
||
Debug: handling option "-va"
||
Debug: handling option "hello.pas"
||
Pas2JS Compiler version 2.3.1 [2023/12/25] for Linux x86_64
||
Info: Message encoding is console
||
Copyright (c) 2023 Free Pascal team.
||
Info: Target platform is Browser
||
Info: Target processor is ECMAScript5
||
Info: Syntax mode is ObjFPC
||
Info: Modeswitch CLASS is on
||
Info: Modeswitch RESULT is on
||
Info: Modeswitch NESTEDCOMMENTS is on
||
Info: Modeswitch REPEATFORWARD is on
||
Info: Modeswitch AUTODEREF is off
||
Info: Modeswitch INITFINAL is on
||
Info: Modeswitch OUT is on
||
Info: Modeswitch DEFAULTPARAMETERS is on
||
Info: Modeswitch HINTDIRECTIVE is on
||
Info: Modeswitch PROPERTIES is on
||
Info: Modeswitch EXCEPTIONS is on
||
Info: Modeswitch ADVANCEDRECORDS is off
||
Info: Modeswitch UNICODESTRINGS is on
||
Info: Modeswitch TYPEHELPERS is off
||
Info: Modeswitch CBLOCKS is on
||
Info: Modeswitch ARRAYOPERATORS is off
||
Info: Modeswitch MULTIHELPERS is off
||
Info: Modeswitch PREFIXEDATTRIBUTES is off
||
Info: Modeswitch IMPLICITFUNCTIONSPECIALIZATION is off
||
Info: Modeswitch FUNCTIONREFERENCES is on
||
Info: Modeswitch ANONYMOUSFUNCTIONS is on
||
Info: Modeswitch EXTERNALCLASS is off
||
Info: Modeswitch OMITRTTI is off
||
Info: Modeswitch MULTILINESTRINGS is off
||
Info: Modeswitch DELPHIMULTILINESTRINGS is off
||
Info: Class interface style is COM
||
Info: Option "Skip default configs" is disabled
||
Info: Option "Build all" is disabled
||
Info: Option "Show logo" is enabled
||
Info: Option "Show errors" is enabled
||
Info: Option "Show warnings" is enabled
||
Info: Option "Show notes" is enabled
||
Info: Option "Show hints" is enabled
||
Info: Option "Show infos" is enabled
||
Info: Option "Show line numbers" is enabled
||
Info: Option "Show tried/used files" is enabled
||
Info: Option "Show conditionals" is enabled
||
Info: Option "Show used tools" is enabled
||
Info: Option "Show debug" is enabled
||
Info: Option "Show message numbers" is disabled
||
Info: Option "Overflow checking" is disabled
||
Info: Option "Range checking" is disabled
||
Info: Option "Method call checking" is disabled
||
Info: Option "Assertions" is disabled
||
Info: Option "Allow C assignments" is disabled
||
Info: Option "Allow macros" is disabled
||
Info: Option "Allows typed constants to be writeable" is enabled
||
Info: Option "Lowercase identifiers" is disabled
||
Info: Option "Use strict" is enabled
||
Info: Option "Write pas2jsdebug.log" is disabled
||
Info: Option "Write messages to StdErr" is disabled
||
Info: Option "Create precompiled units" is disabled
||
Info: Option "Enum values as numbers" is disabled
||
Info: Option "Keep not used private declarations" is disabled
||
Info: Option "Keep not used declarations (WPO)" is disabled
||
Info: Option "Create short local variables for globals" is disabled
||
Info: Option "Obfuscate local identifiers" is disabled
||
Info: Option "Create source map" is disabled
||
Info: Option "Include Pascal sources in source map" is disabled
||
Info: Option "Do not shorten filenames in source map" is disabled
||
Info: Option "Prepend XSSI protection )]} to source map" is enabled
||
Info: Option "Show full filenames" is disabled
||
Info: Option "Show tried/used files" is enabled
||
Info: Option "Search files like FPC" is disabled
||
Info: Option "Strict file case" is disabled
||
Info: Macro defined: Browser
||
Info: Macro ECMAScript set to "5"
||
Info: Macro defined: ECMAScript5
||
Info: Macro defined: FPC_HAS_FEATURE_CLASSES
||
Info: Macro defined: FPC_HAS_FEATURE_DYNARRAYS
||
Info: Macro defined: FPC_HAS_FEATURE_EXCEPTIONS
||
Info: Macro defined: FPC_HAS_FEATURE_EXITCODE
||
Info: Macro defined: FPC_HAS_FEATURE_INIT
||
Info: Macro defined: FPC_HAS_FEATURE_INITFINAL
||
Info: Macro defined: FPC_HAS_FEATURE_RTTI
||
Info: Macro defined: FPC_HAS_FEATURE_SUPPORT
||
Info: Macro defined: FPC_HAS_FEATURE_UNICODESTRINGS
||
Info: Macro defined: FPC_HAS_FEATURE_WIDESTRINGS
||
Info: Macro defined: FPC_HAS_TYPE_DOUBLE
||
Info: Macro defined: FPC_HAS_UNICODESTRING
||
Info: Macro defined: FPC_UNICODESTRINGS
||
Info: Macro defined: FPC_WIDESTRING_EQUAL_UNICODESTRING
||
Info: Macro defined: PAS2JS
||
Info: Macro Pas2JSTargetCPU set to "ECMAScript5"
||
Info: Macro Pas2JSTargetOS set to "Browser"
||
Info: Macro PAS2JS_FULLVERSION set to "20301"
||
Info: Macro defined: STR_CONCAT_PROCS
||
Info: Macro defined: UNICODE
||
Info: Compiler exe: "/usr/local/bin/pas2js"
||
Info: Using working directory: 
"/builds/freepascal.org/lazarus-sandbox/lazarus-test-4"
||
Info: Using unit path: "/usr/local/lib/fpc/3.3.1/pas2js/*/src"
||
Note: unit path not found: "/usr/local/lib/fpc/3.3.1/pas2js/*/src"
||
Info: Output file: ""
||
Info: Parsing hello.pas ...
||
Info: Macro defined: Browser
||
Info: Macro ECMAScript set to 5
||
Info: Macro defined: ECMAScript5
||
Info: Macro defined: FPC_HAS_FEATURE_CLASSES
||
Info: Macro defined: FPC_HAS_FEATURE_DYNARRAYS
||
Info: Macro defined: FPC_HAS_FEATURE_EXCEPTIONS
||
Info: Macro defined: FPC_HAS_FEATURE_EXITCODE
||
Info: Macro defined: FPC_HAS_FEATURE_INIT
||
Info: Macro defined: FPC_HAS_FEATURE_INITFINAL
||
Info: Macro defined: FPC_HAS_FEATURE_RTTI
||
Info: Macro defined: FPC_HAS_FEATURE_SUPPORT
||
Info: Macro defined: FPC_HAS_FEATURE_UNICODESTRINGS
||
Info: Macro defined: FPC_HAS_FEATURE_WIDESTRINGS
||
Info: Macro defined: FPC_HAS_TYPE_DOUBLE
||
Info: Macro defined: FPC_HAS_UNICODESTRING
||
Info: Macro defined: FPC_UNICODESTRINGS
||
Info: Macro defined: FPC_WIDESTRING_EQUAL_UNICODESTRING
||
Info: Macro defined: PAS2JS
||
Info: Macro Pas2JSTargetCPU set to ECMAScript5
||
Info: Macro Pas2JSTargetOS set to Browser
||
Info: Macro PAS2JS_FULLVERSION set to 20301
||
Info: Macro defined: STR_CONCAT_PROCS
||
Info: Macro defined: UNICODE
||
Debug: Opening file 
"/builds/freepascal.org/lazarus-sandbox/lazarus-test-4/hello.pas"...
||
Info: Parsing 
"/builds/freepascal.org/lazarus-sandbox/lazarus-test-4/hello.pas" ...
||
Info: Searching file: System.pp... not found
||
Info: Searching file: System.pas... not found
||
Info: Searching file: System.p... not found
||
Info: Searching file: /usr/local/lib/fpc/3.3.1/pas2js/*/src/System.pp... 
not found
||
Info: Searching file: 
/usr/local/lib/fpc/3.3.1/pas2js/*/src/System.pas... not found
||
Info: Searching file: /usr/local/lib/fpc/3.3.1/pas2js/*/src/System.p... 
not found
||
Debug: $00000000005A123A
||
Debug: $00000000005F6631
||
Debug: $0000000000599347
||
Debug: $0000000000540839
||
Debug: $0000000000540BC0
||
Debug: $000000000053EBC7
||
Debug: $000000000053E784
||
Debug: $000000000053DBBF
||
Debug: $00000000004A4C11
||
Debug: $00000000004A706D
||
Debug: $00000000004B3C51
||
Debug: $00000000004014A3
||
Debug: $0000000000498333
||
Debug: $0000000000401994
||
hello.pas(2,6) Error: can't find unit "System"
||Fatal: Compilation aborted|
>>
>> Also probably it would be worth to consider removing code duplication 
>> between createconfig.pp and fpmake.pp in regards of config file 
>> generation.
>
> I'd rather not. Preferably, the fpmake.pp file should not depend on 
> anything.

Of course it is for you to decide (and I understand your reasons), but 
the amount of time this debug session has already taken suggests the 
opposite (at least shared include file, which can be copied to the 
fpmake.pp body by some script).

Merry Christmas!

-- 
Best regards,
  Maxim Ganetskymailto:ganmax at narod.ru
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20231225/5f988655/attachment-0001.htm>


More information about the fpc-devel mailing list