Sign in Join

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

Mailing lists / pas2js / 2020-09

Building problem

14 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

Ryan Joseph

It's been a couple years since I tried build pas2js and I'm having some problems. Does this error make sense or did I get the command wrong? I didn't even keep build instructions for my older projects and I can't remember! Thanks.

macro_test$ pas2js -h
Pas2JS Compiler version 1.5.1 [2020/09/19] for Darwin x86_64 Copyright (c) 2019 Free Pascal team.

pas2js -Jc -Jirtl.js -Tbrowser /Users/ryanjoseph/Developer/Projects/pas2js/WebGL/Pas2JS_WebGL.pas /Users/ryanjoseph/Developer/Projects/pas2js/WebGL/Pas2JS_WebGL.pas(2,5) Error: can't find unit "System" Fatal: Compilation aborted

Regards,
Ryan Joseph

Reply by email

Michael Van Canneyt
to Ryan Joseph
Ryan Joseph wrote 9 lines
It's been a couple years since I tried build pas2js and I'm having some problems. Does this error make sense or did I get the command wrong? I didn't even keep build instructions for my older projects and I can't remember! Thanks. macro_test$ pas2js -h Pas2JS Compiler version 1.5.1 [2020/09/19] for Darwin x86_64 Copyright (c) 2019 Free Pascal team. pas2js -Jc -Jirtl.js -Tbrowser /Users/ryanjoseph/Developer/Projects/pas2js/WebGL/Pas2JS_WebGL.pas /Users/ryanjoseph/Developer/Projects/pas2js/WebGL/Pas2JS_WebGL.pas(2,5) Error: can't find unit "System" Fatal: Compilation aborted

Your configuration file /etc/pas2js.cfg or ~/.pas2js.cfg is either missing or wrong. pas2js works always with sources, it needs the paths to the sources of all units. My config file contains:

-Fu/Users/michael/pas2js/packages/rtl
-Fu/Users/michael/pas2js/packages/*

Michael.

Reply by email

Ryan Joseph
to Michael Van Canneyt
Show quoted text 8 lines
On Sep 29, 2020, at 12:02 AM, Michael Van Canneyt wrote: Your configuration file /etc/pas2js.cfg or ~/.pas2js.cfg is either missing or wrong. pas2js works always with sources, it needs the paths to the sources of all units. My config file contains: -Fu/Users/michael/pas2js/packages/rtl -Fu/Users/michael/pas2js/packages/*

Ok, I added the config file and it finds system now. Still the command I'm using must be wrong.

macro_test$ pas2js -Jc -Jirtl.js -Tbrowser /Users/ryanjoseph/Developer/Projects/pas2js/WebGL/Pas2JS_WebGL.pas
/Users/ryanjoseph/Developer/pas2js/packages/rtl/system.pas(369,1) Error: Expected "asm"

In my config file:

-Sc
-Fu~/Developer/pas2js/packages/rtl
-Fu~/Developer/pas2js/packages/*

Regards,
Ryan Joseph

Reply by email

Michael Van Canneyt
to Ryan Joseph: Ok, I added the config file and it finds system now. Still the command I'm using must be…
Ryan Joseph wrote 21 lines
> On Sep 29, 2020, at 12:02 AM, Michael Van Canneyt wrote: > > Your configuration file /etc/pas2js.cfg or ~/.pas2js.cfg is either missing or wrong. > pas2js works always with sources, it needs the paths to the sources of all > units. My config file contains: > > -Fu/Users/michael/pas2js/packages/rtl > -Fu/Users/michael/pas2js/packages/* Ok, I added the config file and it finds system now. Still the command I'm using must be wrong. macro_test$ pas2js -Jc -Jirtl.js -Tbrowser /Users/ryanjoseph/Developer/Projects/pas2js/WebGL/Pas2JS_WebGL.pas /Users/ryanjoseph/Developer/pas2js/packages/rtl/system.pas(369,1) Error: Expected "asm" In my config file: -Sc -Fu~/Developer/pas2js/packages/rtl -Fu~/Developer/pas2js/packages/*

That should be correct. Didn't know for sure the ~ is supported.

Not sure what version you are using, though:

Line 369 contains (in my copy):

function ParamStr(Index: Longint): String;

The 1.4.x (released) version contains a comment on line 369.

Michael.

Reply by email

Ryan Joseph
to Michael Van Canneyt
Show quoted text 12 lines
On Sep 29, 2020, at 10:03 AM, Michael Van Canneyt wrote: That should be correct. Didn't know for sure the ~ is supported. Not sure what version you are using, though: Line 369 contains (in my copy): function ParamStr(Index: Longint): String; The 1.4.x (released) version contains a comment on line 369.

I'm on 1.5.1.

Here's the problem. A bug then? Looks like assembler shouldn't be in the interface part.

procedure Delete(var S: String; Index, Size: Integer); assembler; overload;
procedure Delete(var S: String; Index, Size: Integer);
var
  h: String;
begin // <<<<<<< 369
  if (Index<1) or (Index>length(S)) or (Size<=0) then exit;
  h:=S;
  S:=copy(h,1,Index-1)+copy(h,Index+Size);
end;

Regards,
Ryan Joseph

Reply by email

Michael Van Canneyt
to Ryan Joseph
Ryan Joseph wrote 29 lines
> On Sep 29, 2020, at 10:03 AM, Michael Van Canneyt wrote: > > That should be correct. Didn't know for sure the ~ is supported. > > Not sure what version you are using, though: > > Line 369 contains (in my copy): > > function ParamStr(Index: Longint): String; > > The 1.4.x (released) version contains a comment on line 369. > I'm on 1.5.1. Here's the problem. A bug then? Looks like assembler shouldn't be in the interface part. procedure Delete(var S: String; Index, Size: Integer); assembler; overload; procedure Delete(var S: String; Index, Size: Integer); var h: String; begin // <<<<<<< 369 if (Index<1) or (Index>length(S)) or (Size<=0) then exit; h:=S; S:=copy(h,1,Index-1)+copy(h,Index+Size); end;

You have a completely wrong system unit ?

Line 369 is in the interface part, revision 887 contains this on line 369

function ParamCount: Longint;
function ParamStr(Index: Longint): String;

The delete() declaration does not contain assembler.

Michael.

Reply by email

Ryan Joseph
to Michael Van Canneyt
Show quoted text 10 lines
On Sep 30, 2020, at 12:18 AM, Michael Van Canneyt wrote: You have a completely wrong system unit ? Line 369 is in the interface part, revision 887 contains this on line 369 function ParamCount: Longint; function ParamStr(Index: Longint): String; The delete() declaration does not contain assembler.

OK I was confused. I guess one of the fpc installs included pas2js also and it was getting mixed up. I just built fresh from SVN and it's working now.

I see TJSArrayBufferView seems to be missing. Where did this go?

webgl2.pas(299,71) Error: identifier not found "TJSArrayBufferView"

Why are you not including GCC error messages? They're more standard and supported in various editors. Also the path name is relative which presents problems in editors with jumping to errors.

Regards,
Ryan Joseph

Reply by email

Michael Van Canneyt
to Ryan Joseph
Ryan Joseph wrote 18 lines
> On Sep 30, 2020, at 12:18 AM, Michael Van Canneyt wrote: > > You have a completely wrong system unit ? > > Line 369 is in the interface part, revision 887 contains this on line 369 > > function ParamCount: Longint; > function ParamStr(Index: Longint): String; > > The delete() declaration does not contain assembler. OK I was confused. I guess one of the fpc installs included pas2js also and it was getting mixed up. I just built fresh from SVN and it's working now. I see TJSArrayBufferView seems to be missing. Where did this go? webgl2.pas(299,71) Error: identifier not found "TJSArrayBufferView"

That should be TJSArrayBuffer or TJSDataView, because ArrayBufferView does not actually exist.

See:
https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView

Why are you not including GCC error messages?

You're the first to ask, so: simply because we don't see the need.

The current error messages are used in Lazarus/Delphi and VS Code studio. None seem to have problems with this.

But that's not to say we won't accept patches that implement this, of course. Should be fairly trivial to add, I suppose.

Michael.

Reply by email

Ryan Joseph
to Michael Van Canneyt
Show quoted text 7 lines
On Sep 30, 2020, at 9:32 AM, Michael Van Canneyt wrote: That should be TJSArrayBuffer or TJSDataView, because ArrayBufferView does not actually exist. See: https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView

It used to exist 2 years ago. :) Other types are missing also like TJSFloat32List. Why did that go away? Btw, I'm trying to build my WebGL2 examples and that's where these errors are coming from.

Show quoted text 10 lines
> > Why are you not including GCC error messages? You're the first to ask, so: simply because we don't see the need. The current error messages are used in Lazarus/Delphi and VS Code studio. None seem to have problems with this. But that's not to say we won't accept patches that implement this, of course. Should be fairly trivial to add, I suppose.

I tried building with a Makefile and in my editor (Sublime Text) the build system for makefiles looks for GCC style errors so it's helpful to enable these, otherwise I need to make a custom build system for pas2js. I think that's why it exists in the main compiler, for makefile support.

Regards,
Ryan Joseph

Reply by email

Michael Van Canneyt
to Ryan Joseph
Ryan Joseph wrote 11 lines
> On Sep 30, 2020, at 9:32 AM, Michael Van Canneyt wrote: > > That should be TJSArrayBuffer or TJSDataView, because ArrayBufferView does > not actually exist. > > See: > https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView It used to exist 2 years ago. :) Other types are missing also like TJSFloat32List. Why did that go away? Btw, I'm trying to build my WebGL2 examples and that's where these errors are coming from.

Are you sure these were not private additions ? Or maybe you forgot to submit them ? I honestly can't remember deleting things..

Show quoted text 15 lines
> >> >> Why are you not including GCC error messages? > > You're the first to ask, so: simply because we don't see the need. > > The current error messages are used in Lazarus/Delphi > and VS Code studio. None seem to have problems with this. > > But that's not to say we won't accept patches that implement this, of course. Should be fairly trivial to add, I suppose. I tried building with a Makefile and in my editor (Sublime Text) the build system for makefiles looks for GCC style errors so it's helpful to enable these, otherwise I need to make a custom build system for pas2js. I think that's why it exists in the main compiler, for makefile support.

Well, as I said, it should be fairly trivial to add. Please file a an issue in the bugtracker, lest we forget... If you create a patch, then it will be applied very quickly.

Michael.

Reply by email

Ryan Joseph
to Michael Van Canneyt
On Sep 30, 2020, at 11:54 AM, Michael Van Canneyt wrote: Are you sure these were not private additions ? Or maybe you forgot to submit them ? I honestly can't remember deleting things..

Who knows it's been so long since I tried to build those projects. Can you suggest a possible replacement? It seems to be just Float32Array but it may have been like a TList generic also. Maybe Float32Array is like that also though.

Show quoted text 14 lines
>>> Why are you not including GCC error messages? >> You're the first to ask, so: simply because we don't see the need. >> The current error messages are used in Lazarus/Delphi >> and VS Code studio. None seem to have problems with this. >> But that's not to say we won't accept patches that implement this, of course. Should be fairly trivial to add, I suppose. > > I tried building with a Makefile and in my editor (Sublime Text) the build > system for makefiles looks for GCC style errors so it's helpful to enable > these, otherwise I need to make a custom build system for pas2js. I think > that's why it exists in the main compiler, for makefile support. Well, as I said, it should be fairly trivial to add. Please file a an issue in the bugtracker, lest we forget... If you create a patch, then it will be applied very quickly.

Thanks.

https://bugs.freepascal.org/view.php?id=37846

Regards,
Ryan Joseph

Reply by email

Michael Van Canneyt
to Ryan Joseph
Ryan Joseph wrote 11 lines
> On Sep 30, 2020, at 11:54 AM, Michael Van Canneyt wrote: > > Are you sure these were not private additions ? Or maybe you forgot to > submit them ? I honestly can't remember deleting things.. Who knows it's been so long since I tried to build those projects. Can you suggest a possible replacement? It seems to be just Float32Array but it may have been like a TList generic also. Maybe Float32Array is like that also though.

I think TJSFloat32Array is what you need, Generics didn't exist that far back.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array

Show quoted text 19 lines
> >>>> Why are you not including GCC error messages? >>> You're the first to ask, so: simply because we don't see the need. >>> The current error messages are used in Lazarus/Delphi >>> and VS Code studio. None seem to have problems with this. >>> But that's not to say we won't accept patches that implement this, of course. Should be fairly trivial to add, I suppose. >> >> I tried building with a Makefile and in my editor (Sublime Text) the build >> system for makefiles looks for GCC style errors so it's helpful to enable >> these, otherwise I need to make a custom build system for pas2js. I think >> that's why it exists in the main compiler, for makefile support. > > Well, as I said, it should be fairly trivial to add. Please file a an issue in the bugtracker, lest we forget... > If you create a patch, then it will be applied very quickly. Thanks. https://bugs.freepascal.org/view.php?id=37846

Thank you.

Michael.

Reply by email