Sign in Join

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

Mailing lists / pas2js / 2019-07

missing rtl.js

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

warleyalex

oba, I've built today pas2js directly from the trunk!

a) One strange thing is the missing rtls.js from the trunk https://svn.freepascal.org/svn/projects/pas2js/trunk/packages/rtl/

I manually have copied this required file to the folder ..packages/rtl/ to compile some projects.

b) the required pas2js_rtl package does not compile out the box. When I compile a project from the demos/translate_basic.lpr for instance,

It shows this msg:
========================================
Project: Executing command before: Exit code 6, Errors: 1 Pas2JS Compiler version 1.5.1 [2019/07/24] for Win64 x86_64 Copyright (c) 2019 Free Pascal team.
translate_basic.lpr(5,5) Error: can't find unit "System" Fatal: Compilation aborted
Panic: tool stopped with exit code 6. Use context menu to get more information.
========================================

We can not compile a pas2js project because it requires this dependency 'pas2js_rtl'.
but if I include the package "pas2js_rtl" this error disappear.

----------------------------------
Lazarus version# 2.1.0
Date: 2019-07-24
FPC Version 3.3.1
SVN Revision 61596
x86_64-win64-win32/win64
----------------------------------

Reply by email

Michael Van Canneyt
to warleyalex
warleyalex wrote 7 lines
oba, I've built today pas2js directly from the trunk! a) One strange thing is the missing rtls.js from the trunk https://svn.freepascal.org/svn/projects/pas2js/trunk/packages/rtl/ I manually have copied this required file to the folder ..packages/rtl/ to compile some projects.

This is normal, the file is located under pas2js/compiler/utils/pas2js/dist, because it is tightly coupled to the compiler, not to the rtl.

I have a symlink in packages/rtl/ to this file.

Show quoted text 18 lines
b) the required pas2js_rtl package does not compile out the box. When I compile a project from the demos/translate_basic.lpr for instance, It shows this msg: ======================================== Project: Executing command before: Exit code 6, Errors: 1 Pas2JS Compiler version 1.5.1 [2019/07/24] for Win64 x86_64 Copyright (c) 2019 Free Pascal team. translate_basic.lpr(5,5) Error: can't find unit "System" Fatal: Compilation aborted Panic: tool stopped with exit code 6. Use context menu to get more information. ======================================== We can not compile a pas2js project because it requires this dependency 'pas2js_rtl'. but if I include the package "pas2js_rtl" this error disappear.

Normally, the dependency is not necessary when compiling. The packages serve only for the IDE to find sources.

That it does not find the system unit means your self-compiled pas2js does not have a pas2js.cfg set up correctly. You can copy the distributed version to the location of the binary and adapt the paths.

Michael.

Reply by email

warleyalex
to Michael Van Canneyt

Exactly. The pas2js.cfg config file was not set up correctly. I fixed packages\* path and I've moved the rtls.js from
\pas2js\compiler\utils\pas2js\dist\rtl.js to D:\FPC2JS\dist and modified the confile file.
Now, the dependency is not necessary when compiling.

D:\FPC2JS
+---projects
+---dist
+---pas2js-windows-1.5.1
| +---bin
| +---demo
| +---packages

The correct pas2js.cfg config is:
-----------------------------
#
# 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\..\packages\*
-Fu$CfgDir\..\..\dist\

#IFDEF nodejs
-Jirtl.js
#ENDIF

# Put all generated JavaScript into one file
-Jc

# Allow C-operators
-Sc

# end.
-----------------------------

Reply by email