Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2023-12

Failing Lazarus Codetools Pas2JS-related tests

19 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Maxim Ganetsky

Hello.

After recent update of FPC 3.3.1 (and Pas2JS) in Lazarus CI several Codetools tests related to Pas2JS started failing:

TTestPas2js.TestPas2js_ReadSettings: pas2js system unit not found TTestPas2js.TestPas2js_FindDeclaration: pas2js system unit not found TTestPas2js.TestPas2js_FindDeclaration_AWait: pas2js system unit not found

They worked fine with FPC 3.3.1 from November 30.

Is this an FPC regression or the tests should be adapted somehow? Can this be related to introduction of subtargets to Pas2JS?

Contents of /usr/local/bin/pas2js.cfg:

#
# Minimal config file for pas2js compiler
#
# -d is the same as #DEFINE
# -u is the same as #UNDEF
#
# Write always a nice logo 😉
-l

# Display Warnings, Notes and Hints
-vwnh
# If you don't want so much verbosity use
#-vw

-Fu$CfgDir/../lib/fpc/3.3.1/pas2js/*

#IFDEF nodejs
-Jirtl.js
#ENDIF

# Put all generated JavaScript into one file
-Jc

# end.

Best regards, Maxim Ganetsky

Reply by email

Michael Van Canneyt
to Maxim Ganetsky
Maxim Ganetsky wrote 13 lines
Hello. After recent update of FPC 3.3.1 (and Pas2JS) in Lazarus CI several Codetools tests related to Pas2JS started failing: TTestPas2js.TestPas2js_ReadSettings: pas2js system unit not found TTestPas2js.TestPas2js_FindDeclaration: pas2js system unit not found TTestPas2js.TestPas2js_FindDeclaration_AWait: pas2js system unit not found They worked fine with FPC 3.3.1 from November 30. Is this an FPC regression or the tests should be adapted somehow? Can this be related to introduction of subtargets to Pas2JS?

It could be, although I suspect it is more likely that the sources moved to a subdir src in each of the package directories, to support namespaced files.

I was not aware that there were tests for pas2js in the lazarus codebase, so yes, probably some tests or the underlying code in the IDE need to be adapted.

Michael.

Reply by email

Mattias Gaertner
to Michael Van Canneyt
Michael Van Canneyt wrote 8 lines
[...] > Is this an FPC regression or the tests should be adapted somehow? Can > this be related to introduction of subtargets to Pas2JS? It could be, although I suspect it is more likely that the sources moved to a subdir src in each of the package directories, to support namespaced files.

Yes.

I was not aware that there were tests for pas2js in the lazarus codebase, so yes, probably some tests or the underlying code in the IDE need to be adapted.

utils/createconfig.pas needs to be adapted...

Mattias

Mattias

Reply by email

Maxim Ganetsky
to Mattias Gaertner

20.12.2023 12:36, Mattias Gaertner via fpc-devel пишет:

Show quoted text 22 lines
On 20.12.23 10:18, Michael Van Canneyt via fpc-devel wrote: > > [...] >> Is this an FPC regression or the tests should be adapted somehow? >> Can this be related to introduction of subtargets to Pas2JS? > > It could be, although I suspect it is more likely that the sources > moved to > a subdir src in each of the package directories, to support namespaced > files. Yes. > I was not aware that there were tests for pas2js in the lazarus > codebase, so yes, probably some tests or the underlying code in the > IDE need to be adapted. utils/createconfig.pas needs to be adapted...

Any news on this? What changes are needed?

Best regards, Maxim Ganetsky

Reply by email

Michael Van Canneyt
to Maxim Ganetsky
Maxim Ganetsky wrote 24 lines
20.12.2023 12:36, Mattias Gaertner via fpc-devel пишет: > > > On 20.12.23 10:18, Michael Van Canneyt via fpc-devel wrote: >> >> [...] >>> Is this an FPC regression or the tests should be adapted somehow? >>> Can this be related to introduction of subtargets to Pas2JS? >> >> It could be, although I suspect it is more likely that the sources >> moved to >> a subdir src in each of the package directories, to support namespaced >> files. > > Yes. > > >> I was not aware that there were tests for pas2js in the lazarus >> codebase, so yes, probably some tests or the underlying code in the >> IDE need to be adapted. > > > utils/createconfig.pas needs to be adapted... Any news on this? What changes are needed?

As far as I know, Mattias is busy with it and has at least fixed the tests ?

Michael.

Reply by email

Maxim Ganetsky
to Michael Van Canneyt

24.12.2023 01:07, Michael Van Canneyt via fpc-devel пишет:

Show quoted text 31 lines
On Sat, 23 Dec 2023, Maxim Ganetsky via fpc-devel wrote: > 20.12.2023 12:36, Mattias Gaertner via fpc-devel пишет: >> >> >> On 20.12.23 10:18, Michael Van Canneyt via fpc-devel wrote: >>> >>> [...] >>>> Is this an FPC regression or the tests should be adapted somehow? >>>> Can this be related to introduction of subtargets to Pas2JS? >>> >>> It could be, although I suspect it is more likely that the sources >>> moved to >>> a subdir src in each of the package directories, to support namespaced >>> files. >> >> Yes. >> >> >>> I was not aware that there were tests for pas2js in the lazarus >>> codebase, so yes, probably some tests or the underlying code in the >>> IDE need to be adapted. >> >> >> utils/createconfig.pas needs to be adapted... > Any news on this? What changes are needed? As far as I know, Mattias is busy with it and has at least fixed the tests ?

I see the commit by Mattias now, but it does not affect config file created by `make install`, because the following duplicated code is used for creating config files when running `make install`:

https://gitlab.com/freepascal.org/fpc/pas2js/-/blob/main/fpmake.pp?ref_type=heads#L20

Best regards, Maxim Ganetsky

Reply by email

Michael Van Canneyt
to Maxim Ganetsky
Maxim Ganetsky wrote 38 lines
24.12.2023 01:07, Michael Van Canneyt via fpc-devel пишет: > > > On Sat, 23 Dec 2023, Maxim Ganetsky via fpc-devel wrote: > >> 20.12.2023 12:36, Mattias Gaertner via fpc-devel пишет: >>> >>> >>> On 20.12.23 10:18, Michael Van Canneyt via fpc-devel wrote: >>>> >>>> [...] >>>>> Is this an FPC regression or the tests should be adapted somehow? >>>>> Can this be related to introduction of subtargets to Pas2JS? >>>> >>>> It could be, although I suspect it is more likely that the sources >>>> moved to >>>> a subdir src in each of the package directories, to support namespaced >>>> files. >>> >>> Yes. >>> >>> >>>> I was not aware that there were tests for pas2js in the lazarus >>>> codebase, so yes, probably some tests or the underlying code in the >>>> IDE need to be adapted. >>> >>> >>> utils/createconfig.pas needs to be adapted... >> Any news on this? What changes are needed? > > As far as I know, Mattias is busy with it and has at least fixed the > tests ? I see the commit by Mattias now, but it does not affect config file created by `make install`, because the following duplicated code is used for creating config files when running `make install`: https://gitlab.com/freepascal.org/fpc/pas2js/-/blob/main/fpmake.pp?ref_type=heads#L20

I updated the config file writing. 2 files are written now. My local tests are all OK.

Michael.

Reply by email

Maxim Ganetsky
to Michael Van Canneyt

24.12.2023 17:24, Michael Van Canneyt пишет:

Show quoted text 46 lines
On Sun, 24 Dec 2023, Maxim Ganetsky via fpc-devel wrote: > 24.12.2023 01:07, Michael Van Canneyt via fpc-devel пишет: >> >> >> On Sat, 23 Dec 2023, Maxim Ganetsky via fpc-devel wrote: >> >>> 20.12.2023 12:36, Mattias Gaertner via fpc-devel пишет: >>>> >>>> >>>> On 20.12.23 10:18, Michael Van Canneyt via fpc-devel wrote: >>>>> >>>>> [...] >>>>>> Is this an FPC regression or the tests should be adapted somehow? >>>>>> Can this be related to introduction of subtargets to Pas2JS? >>>>> >>>>> It could be, although I suspect it is more likely that the sources >>>>> moved to >>>>> a subdir src in each of the package directories, to support >>>>> namespaced >>>>> files. >>>> >>>> Yes. >>>> >>>> >>>>> I was not aware that there were tests for pas2js in the lazarus >>>>> codebase, so yes, probably some tests or the underlying code in >>>>> the IDE need to be adapted. >>>> >>>> >>>> utils/createconfig.pas needs to be adapted... >>> Any news on this? What changes are needed? >> >> As far as I know, Mattias is busy with it and has at least fixed the >> tests ? > > I see the commit by Mattias now, but it does not affect config file > created by `make install`, because the following duplicated code is > used for creating config files when running `make install`: > > https://gitlab.com/freepascal.org/fpc/pas2js/-/blob/main/fpmake.pp?ref_type=heads#L20 I updated the config file writing. 2 files are written now. My local tests are all OK.

Please elaborate. I just updated FPC and Pas2Js, nothing changed in behavior. Where is the commit?

Best regards, Maxim Ganetsky

Reply by email

Michael Van Canneyt
to Maxim Ganetsky
Maxim Ganetsky wrote 15 lines
>>> As far as I know, Mattias is busy with it and has at least fixed the >>> tests ? >> >> I see the commit by Mattias now, but it does not affect config file >> created by `make install`, because the following duplicated code is >> used for creating config files when running `make install`: >> >> https://gitlab.com/freepascal.org/fpc/pas2js/-/blob/main/fpmake.pp?ref_type=heads#L20 > > I updated the config file writing. 2 files are written now. My local > tests are all OK. Please elaborate. I just updated FPC and Pas2Js, nothing changed in behavior. Where is the commit?

Sorry, forgot to push. fpmake.pp in pas2js repo.

Michael.

Reply by email

Maxim Ganetsky
to Michael Van Canneyt

25.12.2023 13:01, Michael Van Canneyt via fpc-devel пишет:

Show quoted text 22 lines
On Sun, 24 Dec 2023, Maxim Ganetsky via fpc-devel wrote: >>>> As far as I know, Mattias is busy with it and has at least fixed >>>> the tests ? >>> >>> I see the commit by Mattias now, but it does not affect config file >>> created by `make install`, because the following duplicated code is >>> used for creating config files when running `make install`: >>> >>> > https://gitlab.com/freepascal.org/fpc/pas2js/-/blob/main/fpmake.pp?ref_type=heads#L20 > >> >> I updated the config file writing. 2 files are written now. My local >> tests are all OK. > > Please elaborate. I just updated FPC and Pas2Js, nothing changed in > behavior. Where is the commit? Sorry, forgot to push. fpmake.pp in pas2js repo.

OK, now config contents have changed, but Codetools tests still fail with the same error (pas2js system unit not found). Config contents:

Contents of /usr/local/bin/pas2js.cfg:
|
#
||
# Minimal config file for pas2js compiler
||
#
||
# -d is the same as #DEFINE
||
# -u is the same as #UNDEF
||
#
||
# Write always a nice logo ;)
||
-l
||

||
# Display Warnings, Notes and Hints
||
-vwnh
||
# If you don't want so much verbosity use
||
#-vw
||||
#IFDEF FPC_SUBTARGET_NAMESPACED
||||
-Fu$CfgDir../lib/fpc/3.3.1/pas2js/*/namespaced
||
-Fi$CfgDir../lib/fpc/3.3.1/pas2js/*/src
||
-Fu$CfgDir../lib/fpc/3.3.1/pas2js/rtl/src
||
#else
||
-Fu$CfgDir../lib/fpc/3.3.1/pas2js/*/src
||
#endif
||

||
#IFDEF nodejs
||
-Jirtl.js
||
#ENDIF
||

||
# Put all generated JavaScript into one file
||
-Jc
||

||
# end.

||
Contents of /usr/local/bin/pas2js-namespaced.cfg:
||-dUNICODERTL|

Best regards, Maxim

Reply by email

Maxim Ganetsky
to Maxim Ganetsky

25.12.2023 16:51, Maxim Ganetsky via fpc-devel пишет:

Show quoted text 63 lines
25.12.2023 13:01, Michael Van Canneyt via fpc-devel пишет: > > > On Sun, 24 Dec 2023, Maxim Ganetsky via fpc-devel wrote: > >>>>> As far as I know, Mattias is busy with it and has at least fixed >>>>> the tests ? >>>> >>>> I see the commit by Mattias now, but it does not affect config >>>> file created by `make install`, because the following duplicated >>>> code is used for creating config files when running `make install`: >>>> >>>> >> https://gitlab.com/freepascal.org/fpc/pas2js/-/blob/main/fpmake.pp?ref_type=heads#L20 >> >>> >>> I updated the config file writing. 2 files are written now. My >>> local tests are all OK. >> >> Please elaborate. I just updated FPC and Pas2Js, nothing changed in >> behavior. Where is the commit? > > Sorry, forgot to push. fpmake.pp in pas2js repo. OK, now config contents have changed, but Codetools tests still fail with the same error (pas2js system unit not found). Config contents: Contents of /usr/local/bin/pas2js.cfg: | # || # Minimal config file for pas2js compiler || # || # -d is the same as #DEFINE || # -u is the same as #UNDEF || # || # Write always a nice logo ;) || -l || || # Display Warnings, Notes and Hints || -vwnh || # If you don't want so much verbosity use || #-vw |||| #IFDEF FPC_SUBTARGET_NAMESPACED |||| -Fu$CfgDir../lib/fpc/3.3.1/pas2js/*/namespaced || -Fi$CfgDir../lib/fpc/3.3.1/pas2js/*/src || -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?

Also probably it would be worth to consider removing code duplication between createconfig.pp and fpmake.pp in regards of config file generation.

Show quoted text 28 lines
||| #else || -Fu$CfgDir../lib/fpc/3.3.1/pas2js/*/src || #endif || || #IFDEF nodejs || -Jirtl.js || #ENDIF || || # Put all generated JavaScript into one file || -Jc || || # end. || Contents of /usr/local/bin/pas2js-namespaced.cfg: ||-dUNICODERTL|
Best regards, Maxim

Reply by email

Michael Van Canneyt
to Maxim Ganetsky
Maxim Ganetsky wrote 6 lines
> || > -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.

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.

Michael.

Reply by email

Maxim Ganetsky
to Michael Van Canneyt

25.12.2023 18:35, Michael Van Canneyt via fpc-devel пишет:

Show quoted text 13 lines
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|

Show quoted text 7 lines
> > 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

Reply by email

Michael Van Canneyt
Maxim Ganetsky wrote 17 lines
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:

They are expanded. I've been using it for quite some time now. I don't think I've been hallucinating. See below :-)

Show quoted text 11 lines
|| 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"

Is the path correct to begin with ?

i.e. do the directories /usr/local/lib/fpc/3.3.1/pas2js/*/src actually exist ?

Partial output here:

pas2js -va hello.pas

Debug: quick handling option "hello.pas"
Info: Configfile search: /home/michael/.pas2js.cfg Info: Reading options from file "/home/michael/.pas2js.cfg" Debug: interpreting file option "#ifdef FPC_SUBTARGET_NAMESPACED" .pas2js.cfg(1,1) Debug: cfg directive "#ifdef FPC_SUBTARGET_NAMESPACED": false -> skip
Debug: interpreting file option
"-Fu/home/michael/P2JS/main/packages/*/namespaced" Debug: interpreting file option "-Fi/home/michael/P2JS/main/packages/*/src" Debug: interpreting file option "#else"
.pas2js.cfg(4,1) Debug: cfg directive "#else": execute Debug: interpreting file option "-Fu/home/michael/P2JS/main/packages/*/src" ...
Info: Using unit path: "/home/michael/P2JS/main/packages/nodejs/src" Info: Using unit path: "/home/michael/P2JS/main/packages/opentok/src" Info: Using unit path: "/home/michael/P2JS/main/packages/pdfjs/src" Info: Using unit path: "/home/michael/P2JS/main/packages/pushjs/src" Info: Using unit path: "/home/michael/P2JS/main/packages/tinyeditor/src" Info: Using unit path: "/home/michael/P2JS/main/packages/vscode/src" Info: Using unit path: "/home/michael/P2JS/main/packages/wasi/src" Info: Using unit path: "/home/michael/P2JS/main/packages/webwidget/src" Info: Using unit path: "/home/michael/P2JS/main/packages/xterm/src"

So the path is definitely expanded.

Michael.

Reply by email

Maxim Ganetsky
to Michael Van Canneyt

26.12.2023 11:49, Michael Van Canneyt via fpc-devel пишет:

Show quoted text 21 lines
On Mon, 25 Dec 2023, Maxim Ganetsky wrote: > 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: They are expanded. I've been using it for quite some time now. I don't think I've been hallucinating. See below :-) > || > 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" Is the path correct to begin with ?

Sigh, no it is not:

$ ls -l /usr/local/lib/fpc/3.3.1/pas2js
|
total 4
||
drwxr-xr-x 2 root root 4096 Dec 25 17:37 rtl
||
$ ls -l /usr/local/lib/fpc/3.3.1/pas2js/rtl
||
total 48
||-rw-rw-r-- 1 root root 45451 Dec 25 15:49 rtl.js|

So `make install` does not work as expected?

i.e. do the directories /usr/local/lib/fpc/3.3.1/pas2js/*/src actually exist ?
Best regards, Maxim

Reply by email

Michael Van Canneyt
to Maxim Ganetsky
Maxim Ganetsky wrote 37 lines
26.12.2023 11:49, Michael Van Canneyt via fpc-devel пишет: > On Mon, 25 Dec 2023, Maxim Ganetsky wrote: >> 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: > > They are expanded. I've been using it for quite some time now. > I don't think I've been hallucinating. See below :-) > >> || >> 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" > > Is the path correct to begin with ? Sigh, no it is not: $ ls -l /usr/local/lib/fpc/3.3.1/pas2js | total 4 || drwxr-xr-x 2 root root 4096 Dec 25 17:37 rtl || $ ls -l /usr/local/lib/fpc/3.3.1/pas2js/rtl || total 48 ||-rw-rw-r-- 1 root root 45451 Dec 25 15:49 rtl.js| So `make install` does not work as expected?

It does, but 'make install' only does half the job for making a release: pas2js works with sources only, which are not installed by 'make install'.

Normally, Mattias makes a pas2js release, but how he does this is still a secret, even for me :-) (not that this 'secret' is intended)

Michael.

Reply by email

Maxim Ganetsky
to Michael Van Canneyt

26.12.2023 16:21, Michael Van Canneyt via fpc-devel пишет:

Show quoted text 45 lines
On Tue, 26 Dec 2023, Maxim Ganetsky via fpc-devel wrote: > 26.12.2023 11:49, Michael Van Canneyt via fpc-devel пишет: >> On Mon, 25 Dec 2023, Maxim Ganetsky wrote: >>> 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: >> >> They are expanded. I've been using it for quite some time now. >> I don't think I've been hallucinating. See below :-) >> >>> || >>> 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" >> >> Is the path correct to begin with ? > > Sigh, no it is not: > > $ ls -l /usr/local/lib/fpc/3.3.1/pas2js > | > total 4 > || > drwxr-xr-x 2 root root 4096 Dec 25 17:37 rtl > || > $ ls -l /usr/local/lib/fpc/3.3.1/pas2js/rtl > || > total 48 > ||-rw-rw-r-- 1 root root 45451 Dec 25 15:49 rtl.js| > > So `make install` does not work as expected? It does, but 'make install' only does half the job for making a release: pas2js works with sources only, which are not installed by 'make install'.

They were before. I rolled back to Pas2Js commit
bdf63857de5cc53bde6d72f1261ecff5d08c8d7b, and with this commit hello.pas builds successfully and I see the following files installed by `make install`:

$ ls /usr/local/lib/fpc/$FPC_MAIN_VER/pas2js
|
chartjs
||
dataabstract
||
fcl-base
||
fcl-db
||
fpcunit
||
jspdf
||
nodejs
||
rtl
||
$ ls /usr/local/lib/fpc/$FPC_MAIN_VER/pas2js/rtl
||
Rtl.BrowserLoadHelper.pas
||
Rtl.HTMLActions.pas
||
Rtl.HTMLEventNames.pas
||
Rtl.HTMLTranslate.pas
||
Rtl.HTMLUtils.pas
||
Rtl.ScriptLoader.pas
||
Rtl.TemplateLoader.pas
||
Rtl.UnitLoader.pas
||
arrayutils.pas
||
browserconsole.pas
||
class2pas.pas
||
classes.pas
||
contnrs.pas
||
dateutils.pas
||
generics.collections.pas
||
generics.defaults.pas
||
generics.strings.pas
||
hotreloadclient.pas
||
js.pas
||
libjquery.pas
||
math.pas
||
node.events.pas
||
nodejs.pas
||
objpas.pas
||
p2jsres.pp
||
pas2js_rtl.lpk
||
pas2js_rtl.pas
||
rstranslate.pp
||
rtl.js
||
rtl.webthreads.pas
||
rtlconsts.pas
||
rtti.pas
||
simplelinkedlist.pas
||
strutils.pas
||
system.pas
||
sysutils.pas
||
timer.pas
||
types.pas
||
typinfo.pas
||
web.pas
||
webassembly.pas
||
webaudio.pas
||
webbluetooth.pas
||
webgl.pas
||
weborworker.pas
||
webrouter.pp
||
webrtc.pas
||
websvg.pas
||
webutils.pas
||webworker.pas|

Best regards, Maxim

Reply by email

Michael Van Canneyt
to Maxim Ganetsky
Maxim Ganetsky wrote 10 lines
>> >> So `make install` does not work as expected? > > It does, but 'make install' only does half the job for making a release: > pas2js works with sources only, which are not installed by 'make install'. They were before. I rolled back to Pas2Js commit bdf63857de5cc53bde6d72f1261ecff5d08c8d7b, and with this commit hello.pas builds successfully and I see the following files installed by `make install`:

Aha, the plot thickens...

OK. I see that code was added to fpmake to install the sources. I adapted and enhanced that code, now all sources are again installed. (I checked that)

So I hope that now the 'hello world' will compile.

Michael.

Reply by email

Maxim Ganetsky
to Michael Van Canneyt

26.12.2023 19:40, Michael Van Canneyt via fpc-devel пишет:

Show quoted text 24 lines
On Tue, 26 Dec 2023, Maxim Ganetsky via fpc-devel wrote: >>> >>> So `make install` does not work as expected? >> >> It does, but 'make install' only does half the job for making a >> release: >> pas2js works with sources only, which are not installed by 'make >> install'. > > They were before. I rolled back to Pas2Js commit > bdf63857de5cc53bde6d72f1261ecff5d08c8d7b, and with this commit > hello.pas builds successfully and I see the following files installed > by `make install`: Aha, the plot thickens... OK. I see that code was added to fpmake to install the sources. I adapted and enhanced that code, now all sources are again installed. (I checked that) So I hope that now the 'hello world' will compile.

Phew, now it works correctly again (both "Hello, World" and Codetools tests), thanks.

Best regards, Maxim Ganetsky

Reply by email