Creating js file on Windows under Cygwin

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Creating js file on Windows under Cygwin

laci
I have installed Cygwin on windows to compile st file into js.
By the way is this the right way to proceed on Window OS?

Anyway I have a simple st file - HelloApp.st:
Smalltalk current createPackage: 'HelloApp' properties: #{}!
Object subclass: #Hello
        instanceVariableNames: ''
        package: 'HelloApp'!

And batch file invoking amberc - makeit.cmd:
rem http://blog.dotsmart.net/2011/01/27/executing-cygwin-bash-scripts-on-windows/
cls
@echo off

set _AMBERC=C:\Laci\OopServer\amber\NicolasPetton-amber-5c9c9d8\bin\amberc
if not exist "%_AMBERC%" echo Couldn't find amber compiler "%_AMBERC%" - operation aborted & pause & exit 3

set _CYGBIN=C:\cygwin\bin
if not exist "%_CYGBIN%" echo Couldn't find Cygwin at "%_CYGBIN%" - operation aborted & pause & exit 3
if not exist "%_CYGBIN%\cygpath.exe" echo Couldn't find file cygpath.exe at "%_CYGBIN%" - operation aborted & pause & exit 3

:: Resolve ___.sh to /cygdrive based *nix path and store in %_CYGSCRIPT%
for /f "delims=" %%A in ('%_CYGBIN%\cygpath.exe "%_AMBERC%"') do set _CYGSCRIPT=%%A

:: Throw away temporary env vars and invoke script, passing any args that were passed to us
endlocal & %_CYGBIN%\bash --login "%_CYGSCRIPT%" %*

The command
 > makeit HelloApp.st
gives the following error message:

Loading libraries /cygdrive/c/Laci/OopServer/amber/NicolasPetton-amber-5c9c9d8/j
s/boot.js /cygdrive/c/Laci/OopServer/amber/NicolasPetton-amber-5c9c9d8/js/Kernel
-Objects.js /cygdrive/c/Laci/OopServer/amber/NicolasPetton-amber-5c9c9d8/js/Kern
el-Classes.js /cygdrive/c/Laci/OopServer/amber/NicolasPetton-amber-5c9c9d8/js/Ke
rnel-Methods.js /cygdrive/c/Laci/OopServer/amber/NicolasPetton-amber-5c9c9d8/js/
Kernel-Collections.js /cygdrive/c/Laci/OopServer/amber/NicolasPetton-amber-5c9c9
d8/js/Kernel-Exceptions.js /cygdrive/c/Laci/OopServer/amber/NicolasPetton-amber-
5c9c9d8/js/Kernel-Transcript.js /cygdrive/c/Laci/OopServer/amber/NicolasPetton-a
mber-5c9c9d8/js/parser.js /cygdrive/c/Laci/OopServer/amber/NicolasPetton-amber-5
c9c9d8/js/Compiler.js /cygdrive/c/Laci/OopServer/amber/NicolasPetton-amber-5c9c9
d8/js/init.js /cygdrive/c/Laci/OopServer/amber/NicolasPetton-amber-5c9c9d8/bin/n
odecompile.js and compiling ...
Reading file /cygdrive/c/Laci/OopServer/amber/NicolasPetton-amber-5c9c9d8/st/Hel
loApp.st

fs.js:338
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^
Error: ENOENT, no such file or directory 'C:\cygdrive\c\Laci\OopServer\amber\Nic
olasPetton-amber-5c9c9d8\st\HelloApp.st'
    at Object.fs.openSync (fs.js:338:18)
    at Object.fs.readFileSync (fs.js:182:15)
    at C:\cygwin\home\Anna\amberc.eSNceb\compiler.js:17619:15
    at Array.forEach (native)
    at Object.<anonymous> (C:\cygwin\home\Anna\amberc.eSNceb\compiler.js:17616:1
1)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.runMain (module.js:492:10)
Failed compilation of HelloApp.js, exiting.

What am I doing wrong? Any help appreciated.
Thanks,
 laszlo
Reply | Threaded
Open this post in threaded view
|

Re: Creating js file on Windows under Cygwin

Nicolas Petton

Hi!

Which version of Amber are you using?

Nico

laci <[hidden email]> writes:

> I have installed Cygwin on windows to compile st file into js.
> By the way is this the right way to proceed on Window OS?
>
> Anyway I have a simple st file - HelloApp.st:
> Smalltalk current createPackage: 'HelloApp' properties: #{}!
> Object subclass: #Hello
> instanceVariableNames: ''
> package: 'HelloApp'!
>
> And batch file invoking amberc - makeit.cmd:
> rem
> http://blog.dotsmart.net/2011/01/27/executing-cygwin-bash-scripts-on-windows/
> cls
> @echo off
>
> set _AMBERC=C:\Laci\OopServer\amber\NicolasPetton-amber-5c9c9d8\bin\amberc
> if not exist "%_AMBERC%" echo Couldn't find amber compiler "%_AMBERC%" -
> operation aborted & pause & exit 3
>
> set _CYGBIN=C:\cygwin\bin
> if not exist "%_CYGBIN%" echo Couldn't find Cygwin at "%_CYGBIN%" -
> operation aborted & pause & exit 3
> if not exist "%_CYGBIN%\cygpath.exe" echo Couldn't find file cygpath.exe at
> "%_CYGBIN%" - operation aborted & pause & exit 3
>
> :: Resolve ___.sh to /cygdrive based *nix path and store in %_CYGSCRIPT%
> for /f "delims=" %%A in ('%_CYGBIN%\cygpath.exe "%_AMBERC%"') do set
> _CYGSCRIPT=%%A
>
> :: Throw away temporary env vars and invoke script, passing any args that
> were passed to us
> endlocal & %_CYGBIN%\bash --login "%_CYGSCRIPT%" %*
>
> The command
>  > makeit HelloApp.st
> gives the following error message:
>
> Loading libraries
> /cygdrive/c/Laci/OopServer/amber/NicolasPetton-amber-5c9c9d8/j
> s/boot.js
> /cygdrive/c/Laci/OopServer/amber/NicolasPetton-amber-5c9c9d8/js/Kernel
> -Objects.js
> /cygdrive/c/Laci/OopServer/amber/NicolasPetton-amber-5c9c9d8/js/Kern
> el-Classes.js
> /cygdrive/c/Laci/OopServer/amber/NicolasPetton-amber-5c9c9d8/js/Ke
> rnel-Methods.js
> /cygdrive/c/Laci/OopServer/amber/NicolasPetton-amber-5c9c9d8/js/
> Kernel-Collections.js
> /cygdrive/c/Laci/OopServer/amber/NicolasPetton-amber-5c9c9
> d8/js/Kernel-Exceptions.js
> /cygdrive/c/Laci/OopServer/amber/NicolasPetton-amber-
> 5c9c9d8/js/Kernel-Transcript.js
> /cygdrive/c/Laci/OopServer/amber/NicolasPetton-a
> mber-5c9c9d8/js/parser.js
> /cygdrive/c/Laci/OopServer/amber/NicolasPetton-amber-5
> c9c9d8/js/Compiler.js
> /cygdrive/c/Laci/OopServer/amber/NicolasPetton-amber-5c9c9
> d8/js/init.js
> /cygdrive/c/Laci/OopServer/amber/NicolasPetton-amber-5c9c9d8/bin/n
> odecompile.js and compiling ...
> Reading file
> /cygdrive/c/Laci/OopServer/amber/NicolasPetton-amber-5c9c9d8/st/Hel
> loApp.st
>
> fs.js:338
>   return binding.open(pathModule._makeLong(path), stringToFlags(flags),
> mode);
>                  ^
> Error: ENOENT, no such file or directory
> 'C:\cygdrive\c\Laci\OopServer\amber\Nic
> olasPetton-amber-5c9c9d8\st\HelloApp.st'
>     at Object.fs.openSync (fs.js:338:18)
>     at Object.fs.readFileSync (fs.js:182:15)
>     at C:\cygwin\home\Anna\amberc.eSNceb\compiler.js:17619:15
>     at Array.forEach (native)
>     at Object.<anonymous>
> (C:\cygwin\home\Anna\amberc.eSNceb\compiler.js:17616:1
> 1)
>     at Module._compile (module.js:449:26)
>     at Object.Module._extensions..js (module.js:467:10)
>     at Module.load (module.js:356:32)
>     at Function.Module._load (module.js:312:12)
>     at Module.runMain (module.js:492:10)
> Failed compilation of HelloApp.js, exiting.
>
> What am I doing wrong? Any help appreciated.
> Thanks,
>  laszlo
>
>
>
>
> --
> View this message in context: http://forum.world.st/Creating-js-file-on-Windows-under-Cygwin-tp4656292.html
> Sent from the Amber Smalltalk mailing list archive at Nabble.com.

--
Nicolas Petton
http://nicolas-petton.fr
Reply | Threaded
Open this post in threaded view
|

Re: Creating js file on Windows under Cygwin

laci
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Creating js file on Windows under Cygwin

Nicolas Petton

Could you try with the stable version?

Nico

laci <[hidden email]> writes:

> The make refers to an earlier version but the same error occurs using the
> amber version which was downloaded a week ago.
>
> Here is the error report:
>
> Loading libraries
> /cygdrive/c/Laci/OopServer/amber/amber-master-201211/js/boot.j
> s /cygdrive/c/Laci/OopServer/amber/amber-master-201211/js/Kernel-Objects.js
> /cyg
> drive/c/Laci/OopServer/amber/amber-master-201211/js/Kernel-Classes.js
> /cygdrive/
> c/Laci/OopServer/amber/amber-master-201211/js/Kernel-Methods.js
> /cygdrive/c/Laci
> /OopServer/amber/amber-master-201211/js/Kernel-Collections.js
> /cygdrive/c/Laci/O
> opServer/amber/amber-master-201211/js/Kernel-Exceptions.js
> /cygdrive/c/Laci/OopS
> erver/amber/amber-master-201211/js/Kernel-Transcript.js
> /cygdrive/c/Laci/OopServ
> er/amber/amber-master-201211/js/parser.js
> /cygdrive/c/Laci/OopServer/amber/amber
> -master-201211/js/Compiler.js
> /cygdrive/c/Laci/OopServer/amber/amber-master-2012
> 11/js/init.js
> /cygdrive/c/Laci/OopServer/amber/amber-master-201211/bin/nodecompi
> le.js and compiling ...
> Reading file
> /cygdrive/c/Laci/OopServer/amber/amber-master-201211/st/HelloApp.st
>
>
> fs.js:338
>   return binding.open(pathModule._makeLong(path), stringToFlags(flags),
> mode);
>                  ^
> Error: ENOENT, no such file or directory
> 'C:\cygdrive\c\Laci\OopServer\amber\amb
> er-master-201211\st\HelloApp.st'
>     at Object.fs.openSync (fs.js:338:18)
>     at Object.fs.readFileSync (fs.js:182:15)
>     at C:\cygwin\home\Anna\amberc.N7Z5Tn\compiler.js:20965:15
>     at Array.forEach (native)
>     at Object.<anonymous>
> (C:\cygwin\home\Anna\amberc.N7Z5Tn\compiler.js:20962:1
> 1)
>     at Module._compile (module.js:449:26)
>     at Object.Module._extensions..js (module.js:467:10)
>     at Module.load (module.js:356:32)
>     at Function.Module._load (module.js:312:12)
>     at Module.runMain (module.js:492:10)
> Failed compilation of HelloApp.js, exiting.
>
>
>
> --
> View this message in context: http://forum.world.st/Creating-js-file-on-Windows-under-Cygwin-tp4656292p4656349.html
> Sent from the Amber Smalltalk mailing list archive at Nabble.com.

--
Nicolas Petton
http://nicolas-petton.fr
Reply | Threaded
Open this post in threaded view
|

Re: Creating js file on Windows under Cygwin

laci
Where is the latest stable version?

I've downloaded the zip file from http://amber-lang.net/
Got the same error.

Should I go to the github repository?
This version I used with my second attempt.
Reply | Threaded
Open this post in threaded view
|

Re: Creating js file on Windows under Cygwin

Nicolas Petton

I'm asking you to use the stable version because with the master on
github the make files are not up-to-date and probably won't work.

You can download a zip here:
https://github.com/NicolasPetton/amber/archive/0.9.1.zip

Cheers!
Nico

laci <[hidden email]> writes:

> Where is the latest stable version?
>
> I've downloaded the zip file from http://amber-lang.net/
> Got the same error.
>
> Should I go to the github repository?
> This version I used with my second attempt.
>
>
>
> --
> View this message in context: http://forum.world.st/Creating-js-file-on-Windows-under-Cygwin-tp4656292p4656358.html
> Sent from the Amber Smalltalk mailing list archive at Nabble.com.

--
Nicolas Petton
http://nicolas-petton.fr
Reply | Threaded
Open this post in threaded view
|

Re: Creating js file on Windows under Cygwin

laci
I have reviewed my cygwin installation and all my problems have been resolved. Sorry to bug you with a none-existing problem.
Reply | Threaded
Open this post in threaded view
|

Re: Creating js file on Windows under Cygwin

Dave Mason-2
In reply to this post by Nicolas Petton

On 2012-Nov-24, at 7:47 , Nicolas Petton wrote:

> I'm asking you to use the stable version because with the master on
> github the make files are not up-to-date and probably won't work.
>
> You can download a zip here:
> https://github.com/NicolasPetton/amber/archive/0.9.1.zip

I had been intending on sending an email about this.  I want to use amberc to compile my code.  Using the code in that zip file, I got:

: ~/hg/ProgrammingForTheRestOfUs/kit ; ~/Downloads/amber-0.9.1/bin/amberc st/Kit.st
Loading libraries /Users/dmason/Downloads/amber-0.9.1/js/boot.js /Users/dmason/Downloads/amber-0.9.1/js/Kernel-Objects.js /Users/dmason/Downloads/amber-0.9.1/js/Kernel-Classes.js /Users/dmason/Downloads/amber-0.9.1/js/Kernel-Methods.js /Users/dmason/Downloads/amber-0.9.1/js/Kernel-Collections.js /Users/dmason/Downloads/amber-0.9.1/js/Kernel-Exceptions.js /Users/dmason/Downloads/amber-0.9.1/js/Kernel-Transcript.js /Users/dmason/Downloads/amber-0.9.1/js/parser.js /Users/dmason/Downloads/amber-0.9.1/js/Compiler.js /Users/dmason/Downloads/amber-0.9.1/js/init.js /Users/dmason/Downloads/amber-0.9.1/bin/nodecompile.js and compiling ...
The "sys" module is now called "util". It should have a similar interface.
Reading file st/Kit.st

/Users/dmason/hg/ProgrammingForTheRestOfUs/kit/amberc.OYqBMW/compiler.js:335
                                        throw(error);
           ^
SyntaxError: Unexpected reserved word
    at [object Object]._eval_ (/Users/dmason/hg/ProgrammingForTheRestOfUs/kit/amberc.OYqBMW/compiler.js:17124:13)
    at /Users/dmason/hg/ProgrammingForTheRestOfUs/kit/amberc.OYqBMW/compiler.js:350:30
    at Smalltalk.send (/Users/dmason/hg/ProgrammingForTheRestOfUs/kit/amberc.OYqBMW/compiler.js:326:11)
    at [object Object]._load_forClass_ (/Users/dmason/hg/ProgrammingForTheRestOfUs/kit/amberc.OYqBMW/compiler.js:17070:21)
    at /Users/dmason/hg/ProgrammingForTheRestOfUs/kit/amberc.OYqBMW/compiler.js:350:30
    at Smalltalk.send (/Users/dmason/hg/ProgrammingForTheRestOfUs/kit/amberc.OYqBMW/compiler.js:326:11)
    at [object Object]._compileMethod_ (/Users/dmason/hg/ProgrammingForTheRestOfUs/kit/amberc.OYqBMW/compiler.js:5318:19)
    at /Users/dmason/hg/ProgrammingForTheRestOfUs/kit/amberc.OYqBMW/compiler.js:350:30
    at Smalltalk.send (/Users/dmason/hg/ProgrammingForTheRestOfUs/kit/amberc.OYqBMW/compiler.js:326:11)
    at /Users/dmason/hg/ProgrammingForTheRestOfUs/kit/amberc.OYqBMW/compiler.js:5301:168
Failed compilation of Kit.js, exiting.

whereas with the current github version, I get:

: ~/hg/ProgrammingForTheRestOfUs/kit ; ../amber/bin/amberc st/Kit.st
Loading libraries /Users/dmason/hg/ProgrammingForTheRestOfUs/amber/js/boot.js /Users/dmason/hg/ProgrammingForTheRestOfUs/amber/js/Kernel-Objects.js /Users/dmason/hg/ProgrammingForTheRestOfUs/amber/js/Kernel-Classes.js /Users/dmason/hg/ProgrammingForTheRestOfUs/amber/js/Kernel-Methods.js /Users/dmason/hg/ProgrammingForTheRestOfUs/amber/js/Kernel-Collections.js /Users/dmason/hg/ProgrammingForTheRestOfUs/amber/js/Kernel-Exceptions.js /Users/dmason/hg/ProgrammingForTheRestOfUs/amber/js/Kernel-Transcript.js /Users/dmason/hg/ProgrammingForTheRestOfUs/amber/js/parser.js /Users/dmason/hg/ProgrammingForTheRestOfUs/amber/js/Compiler.js /Users/dmason/hg/ProgrammingForTheRestOfUs/amber/js/init.js /Users/dmason/hg/ProgrammingForTheRestOfUs/amber/bin/nodecompile.js and compiling ...
Reading file st/Kit.st

/Users/dmason/hg/ProgrammingForTheRestOfUs/kit/amberc.olZ7UZ/compiler.js:401
                                        throw(error);
           ^
ReferenceError: MethodAdded is not defined
    at [object Object].<anonymous> (/Users/dmason/hg/ProgrammingForTheRestOfUs/kit/amberc.olZ7UZ/compiler.js:5239:45)
    at withContextSend (/Users/dmason/hg/ProgrammingForTheRestOfUs/kit/amberc.olZ7UZ/compiler.js:415:18)
    at Smalltalk.send (/Users/dmason/hg/ProgrammingForTheRestOfUs/kit/amberc.olZ7UZ/compiler.js:392:11)
    at [object Object].<anonymous> (/Users/dmason/hg/ProgrammingForTheRestOfUs/kit/amberc.olZ7UZ/compiler.js:17144:11)
    at withContextSend (/Users/dmason/hg/ProgrammingForTheRestOfUs/kit/amberc.olZ7UZ/compiler.js:415:18)
    at Smalltalk.send (/Users/dmason/hg/ProgrammingForTheRestOfUs/kit/amberc.olZ7UZ/compiler.js:394:16)
    at /Users/dmason/hg/ProgrammingForTheRestOfUs/kit/amberc.olZ7UZ/compiler.js:17745:321
    at /Users/dmason/hg/ProgrammingForTheRestOfUs/kit/amberc.olZ7UZ/compiler.js:17745:727
    at /Users/dmason/hg/ProgrammingForTheRestOfUs/kit/amberc.olZ7UZ/compiler.js:17745:1263
    at [object Object].<anonymous> (/Users/dmason/hg/ProgrammingForTheRestOfUs/kit/amberc.olZ7UZ/compiler.js:17745:1268)
Failed compilation of Kit.js, exiting.

This is on MacOSX, node version v0.6.18

Any ideas?  I'd really like to get this working so I can take the js out of the SCM system because multiple people are working on it and merging js compiled code is a lot more challenging than merging the st code.

../Dave
Reply | Threaded
Open this post in threaded view
|

Re: Creating js file on Windows under Cygwin

Nicolas Petton
In reply to this post by laci

No problem, glad that you solved it!

Cheers,
Nico

laci <[hidden email]> writes:

> I have reviewed my cygwin installation and all my problems have been
> resolved. Sorry to bug you with a none-existing problem.
>
>
>
> --
> View this message in context: http://forum.world.st/Creating-js-file-on-Windows-under-Cygwin-tp4656292p4658653.html
> Sent from the Amber Smalltalk mailing list archive at Nabble.com.

--
Nicolas Petton
http://nicolas-petton.fr