Fork of avatar-js
Go to file
akhil af711a904b exclude test-exec-max-buffer.js on windows, fails on hudson build server 2014-02-10 16:35:02 -08:00
crypto move source here from internal repo 2013-09-27 16:05:37 -07:00
patches increase timeout for slow hosts and print actual requests for future adjustment 2014-02-10 14:27:23 -08:00
src the shared executor param should be true if using the singleton thread pool 2014-02-07 11:35:09 -08:00
.gitignore Add repl.js to .gitignore 2013-12-09 14:09:12 -08:00
CONTRIBUTORS move source here from internal repo 2013-09-27 16:05:37 -07:00
LICENSE move source here from internal repo 2013-09-27 16:05:37 -07:00 update version in readme 2014-01-28 08:38:06 -08:00
THIRD_PARTY_README move source here from internal repo 2013-09-27 16:05:37 -07:00
avatar-js.gyp 111: The object files for the windows builds should output to out/ 2013-12-10 15:27:35 -08:00
build.xml combine arg with cmd in git macro to avoid calling pull with empty string arg 2014-01-28 10:20:12 -08:00
common.xml Add delete test/tmp to the clean target. 2014-01-07 11:08:52 -08:00 upgrade to v0.10.25 (latest stable) 2014-01-27 15:39:56 -08:00
win32-test-exclusions.txt exclude test-exec-max-buffer.js on windows, fails on hudson build server 2014-02-10 16:35:02 -08:00

Build Instructions

  1. Setup build environment. Install a git client, jdk8, ant, python, C++ compiler and linker

    1. Install the latest jdk8
    2. Ensure ant is installed and ant -version is 1.8+
    3. Ensure python is installed and python --version is 2.7.5+
      tip: python3 does not work
    4. Ensure ant, jdk8, python and appropriate platform-specific C++ compiler and linker are in the PATH
    5. If needed, install a git client for your OS. Windows users see below
    6. Extra steps for Windows users
      1. Install a unix emulation like cygwin or mingw/msys. If using Git for Windows, a version of msys is already included. This unix emulation provides the gnu diff and patch utilities.
      2. Install Microsoft Visual Studio. Any recent version should be OK (2010, 2012, 2013 have been known to work). Express versions will do.
      3. Ensure that link.exe is the one from Visual Studio and not from cygwin or mingw/msys.
      4. If a unix user, start bash --login from within a Visual Studio Command Prompt to ensure that the Visual Studio environment is inherited.
  2. Download node.js source

    1. git clone source
    2. cd source
    3. git checkout v0.10.25
      tip: run git pull to refresh the repo if you get an error saying that this version is unknown
    4. cd ..
  3. Clone dependencies. Substitute <id> with your id in the URLs below. Use the read-only URLs below if you do not have a id. It is strongly recommended that all dependencies be cloned at the same level as node.js as in step 2.1 above

    1. git clone git:// libuv-java (read-only)
      git clone ssh://<id> libuv-java

    2. git clone git:// http-parser-java (read-only)
      git clone ssh://<id> http-parser-java

    3. git clone git:// avatar-js (read-only)
      git clone ssh://<id> avatar-js

    4. Download test-ng. Unzip the downloaded bundle and place testng jar somewhere in your workspace

  4. Edit ~/ to set various locations. Ensure that there are no double slashes and no trailing slash, for example

    source.home = /ws/source (from 2.1)
    libuv.home = /ws/libuv-java (from 3.1)
    http-parser.home = /ws/http-parser-java (from 3.2)
    avatar-js.home = /ws/avatar-js (from 3.3)
    testng.jar = /ws/lib/testng.jar (from 3.4)

  5. Setup your environment so that native libraries can be found

    export LD_LIBRARY_PATH=$PWD/dist:$LD_LIBRARY_PATH (linux)
    export PATH=%CWD%/dist;%PATH% (windows)

  6. Configure

    cd avatar-js
    ant setup

  7. Build

    ant clean-all
    ant jar-all
    tip: ant -Dbuild.type=Release jar-all builds the Release configuration

  8. Test

    java -jar dist/avatar-js.jar src/test/js/test-runner.js test/simple (runs the unit tests)
    java -jar dist/avatar-js.jar src/test/js/test-runner.js test/crypto (runs the crypto tests)
    java -jar dist/avatar-js.jar src/test/js/test-runner.js -timeout 180 test/pummel (runs the pummel tests)

    tip: Some crypto tests require Java Cryptography Extension Unlimited Jurisdiction Policy Files. Follow the instructions in the download. Files for Java7 work in Java8.

    tip: Might need to set LANG=en_US.UTF-8

    tip: test-runner.js supports many options, run it with -help or look at its source for more information

  9. Running applications. For example

    java -jar dist/avatar-js.jar app.js
    java -Djava.library.path=dist -jar dist/avatar-js.jar app.js
    java -Xmx4g -Djava.library.path=dist -jar dist/avatar-js.jar app.js

Release Notes

  • Compatible with Node.js v0.10.25

  • Platforms tested. 32-bit variants have not been tested at all

    • Ubuntu Linux x64
    • Oracle Enterprise Linux x64
    • Mac OS X Mountain Lion
    • Windows 7 & 8 x64
  • Missing Features

    • the debugger module is not supported
  • Known failures

    • some tests fail on windows. These are listed in win32-test-exclusions.txt with associated issue
  • Globals. Some additional globals are exposed

  • Limitations of the vm module. Objects loaded in a new context and accessed from the current context have some strong limitations -

    • Only a subset of JavaScript API is available on these objects
    • equality (==, ===) will not work as expected
  • Limitations on __proto__

    • __proto__ cannot be set to undefined. Affects the ejs module used by express
  • No const keyword

    • the const keyword is not supported, replace with var. Affects the mongodb and grunt modules
  • No signal handlers installed by default

    • the JVM installs some of its own and we do not want to cause conflicts
    • an app can install signal handlers as needed using process.signals.start('SIGUSR1'); or process.signals.start(43);