Skip to content
Mohaned Qunaibit edited this page Jun 1, 2017 · 15 revisions

Introduction

ZipPy is a work in progress Python 3 implementation as one of the Truffle languages. It currently borrows the same project setup as FastR, in which the guest language code is managed in its own repository splitting ZipPy and Graal in two different repositories. This arrangement is made possible by mx.

System Requirements

ZipPy is developed and tested on Mac OS X (10.11/10.10) and Linux Ubuntu 14.04.

Building on Windows is currently not supported.

Prerequisites:

  • Install the most recent JDK 8 and store its path on $JAVA_HOME.
$ export JAVA_HOME=/path/to/jdk

Getting ZipPy

  1. Create a new directory. We will refer to this as $ZIPPY_HOME in what follows.

ZipPy requires Truffle and both projects are hosted in different repositories. $ZIPPY_HOME will serve as a root directory for both projcets.

  ```sh
  $ mkdir zippy_project
  $ cd zippy_project
  $ export ZIPPY_HOME=$PWD
  ```
  1. Install mx build tool and append it to your PATH:

mx build tool, which is used in all projects built around Graal. mx requires Python 2.7 (not exactly ZipPy at this point...).

  ```sh
  $ git clone https://github.com/graalvm/mx.git
  $ export PATH=$ZIPPY_HOME/mx:$PATH
  ```

Its strongly recommended to add mx to your shell config file e.g. .bashrc for bash.

$ echo "export PATH=$ZIPPY_HOME/mx:$PATH" >> ~/.bashrc

For more information about mx please refer to the mx.

  1. Clone ZipPy:

    $ git clone https://github.com/securesystemslab/zippy.git
  2. Add environment variables to zippy/mx.zippy/env:

    $ echo "JAVA_HOME=$JAVA_HOME" > $ZIPPY_HOME/zippy/mx.zippy/env
    $ echo "DEFAULT_VM=server" >> $ZIPPY_HOME/zippy/mx.zippy/env
  3. Pull the required projects:

    $ cd $ZIPPY_HOME/zippy
    $ mx spull

Now you should have zippy and truffle under the project root $ZIPPY_HOME. If everything looks good at this point, you should be able to move on to the building step.

Building ZipPy

To build a suite and the suites it depends on, the mx build command is used:

    $ cd $ZIPPY_HOME/zippy
    $ mx spull
    $ mx build

The first build will also download various required libraries, so there must be a network connection.

With an existing ZipPy checkout:

If your starting point is an existing checkout of ZipPy, please refer to the following steps.

  1. Make sure that you have mx installed (refer to the section above to installed it) and updated cd $MX_HOME; git pull.

This is necessary because mx's default suite model is sibling model, which means that imported suites are placed with the primary suite under the same directory ($ZIPPY_HOME). It is better to keep the entire project in its own directory ($ZIPPY_HOME).

  1. Update imported suites:
    $ cd $ZIPPY_HOME/zippy
    $ mx spull

Running ZipPy

After building, running ZipPy can be done with mx python.

$ mx python <file.py>

Sadly, interactive shell and many of the CPython command line options are not yet implemented...

Unittest

The subproject edu.uci.python.test includes a set of tests that we currently use. The mx junit command runs all JUnit test it can find in the current suite.

$ mx junit

Alternatively, you can run

$ mx gate --tags pythontest

Benchmarking

Benchmarks are located in zippy/benchmark. One can use the mx python command to run each benchmark separately.

Build Status


ZipPy Build Status

Standard JVM Graal JVM
Linux Ubuntu 14.04.4 Build Status Build Status
Mac OSX 10.11 Build Status Build Status

Contribution

Yes we need help to push the completeness of ZipPy!

No lawyer BS. Simply raise an issue or submit a pull request when you feel like to.

Author

Wei Zhang, Facebook, Inc.

Mohaned Qunaibit, University of California Irvine