Skip to content
Snippets Groups Projects
Commit 3098db22 authored by Mark Doerr's avatar Mark Doerr
Browse files

updated documentation for sandbox-2; README renamed to README.rst for better display in gitLab

parent 340d8d63
No related tags found
1 merge request!16updated documentation for sandbox-2; README renamed to README.rst for better display in gitLab
......@@ -300,8 +300,15 @@
pypy ../../rpython/bin/rpython -Ojit targetpypystandalone
# get the no-jit version
pypy ../../rpython/bin/rpython -O2 targetpypystandalone
# get the sandbox version
pypy ../../rpython/bin/rpython -O2 --sandbox targetpypystandalone
# to build the pypy-sandbox, please compile the pypy JIT version first (s. first step)
# rename the now built pypy-c (and corrosponing libray libpypy-c.so) to pypy-c-jit and
# libpypy-c.so-jit respectively (it is needed later for packaging) and then call
pypy ../../rpython/bin/rpython -O2 --sandbox targetpypystandalone # to get the sandbox version
# rename the resulting, new pypy-c to pypy-c-sandbox (and corresponding library libpypy-c.so-sandbox)
# and reverse pypy-c-jit to pypy-c (do not forget corresponding library libpypy-c.so-jit -> libpypy-c.so)
5. Enjoy Mandelbrot ``:-)`` It takes on the order of half an hour to
finish the translation, and about 3GB of RAM on a 32-bit system
......@@ -381,6 +388,11 @@
python package.py --help #for information
python package.py --archive-name pypy-my-own-package-name
# to pack the pypy-c-sandbox, a full JIT-version of pypy-c (including the corresponding library) needs to be in the goal directory
python package.py --archive-name pypy_my-sandbox-os --builddir ../../goal --targetdir my/package/targetdir
# to use the sandbox, please rename the library back to libpypy-c.so-jit and
# libpypy-c.so-sandbox to libpypy-c.so
It is recommended to use package.py because custom scripts will
invariably become out-of-date. If you want to write custom scripts
anyway, note an easy-to-miss point: some modules are written with CFFI,
......
......@@ -126,5 +126,5 @@
languages.
To run the sandboxed process, you need to get the full sources and
build ``pypy-sandbox`` from it (see `Building from source`_). These
build ``pypy-c-sandbox`` from it (see `Building from source`_). These
instructions give you a ``pypy-c`` that you should rename to
......@@ -130,6 +130,14 @@
instructions give you a ``pypy-c`` that you should rename to
``pypy-sandbox`` to avoid future confusion. Then run:
``pypy-c-sandbox`` to avoid future confusion.
The next step ist to pack everything using the package tool like:
.. code-block:: bash
cd tool/release/
python package.py --archive-name my_pypy_sandbox_package --builddir ../../goal --targetdir my/package/target/dir
And finally start, e.g., an interactive (-i option ) pypy-sandox interpreter shell:
.. code-block:: bash
cd pypy/sandbox
......@@ -132,8 +140,8 @@
.. code-block:: bash
cd pypy/sandbox
pypy_interact.py path/to/pypy-sandbox
pypy_interact.py --lib-path=path/to/my_pypy_sandbox_package path/to/pypy-c-sandbox -i
# don't confuse it with pypy/goal/pyinteractive.py!
You get a fully sandboxed interpreter, in its own filesystem hierarchy
......@@ -137,10 +145,10 @@
# don't confuse it with pypy/goal/pyinteractive.py!
You get a fully sandboxed interpreter, in its own filesystem hierarchy
(try ``os.listdir('/')``). For example, you would run an untrusted
script as follows:
(try ``os.listdir('/')``).
To run, for example, an untrusted script, excecute it as follows:
.. code-block:: bash
mkdir virtualtmp
cp untrusted.py virtualtmp/
......@@ -142,9 +150,9 @@
.. code-block:: bash
mkdir virtualtmp
cp untrusted.py virtualtmp/
pypy_interact.py --tmp=virtualtmp pypy-sandbox /tmp/untrusted.py
pypy_interact.py --lib-path=path/to/my_pypy_sandbox_package --tmp=virtualtmp pypy-c-sandbox /tmp/untrusted.py
Note that the path ``/tmp/untrusted.py`` is a path inside the sandboxed
filesystem. You don't have to put ``untrusted.py`` in the real ``/tmp``
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment