Commit b8c3e600 authored by Michael Droettboom's avatar Michael Droettboom

Add end-to-end build. Travis tests.

parent 2ad135ef
...@@ -6,6 +6,8 @@ __pycache__ ...@@ -6,6 +6,8 @@ __pycache__
/root/ /root/
/build/ /build/
/emsdk/emsdk
/cpython/build /cpython/build
/cpython/downloads /cpython/downloads
/cpython/installs /cpython/installs
......
language: python
sudo: false
cache:
pip: true
ccache: true
directories:
- emsdk/emsdk
addons:
firefox: latest
python:
- '3.6'
before_install:
- wget https://github.com/mozilla/geckodriver/releases/download/v0.20.0/geckodriver-v0.20.0-linux64.tar.gz
- mkdir geckodriver
- tar -xvf geckodriver-v0.20.0-linux64.tar.gz -C geckodriver
- export PATH=$PATH:$PWD/geckodriver
install:
- pip install pytest selenium
script:
- make
- make test
PYODIDE_ROOT=$(abspath .)
include Makefile.envs
PYVERSION=3.6.4 PYVERSION=3.6.4
PYMINOR=$(basename $(PYVERSION)) PYMINOR=$(basename $(PYVERSION))
CPYTHONROOT=cpython CPYTHONROOT=cpython
...@@ -29,7 +32,7 @@ NUMPY_LIBS=\ ...@@ -29,7 +32,7 @@ NUMPY_LIBS=\
SITEPACKAGES=root/lib/python$(PYMINOR)/site-packages SITEPACKAGES=root/lib/python$(PYMINOR)/site-packages
all: build/pyodide.asm.html build/pyodide.js all: emsdk/emsdk build/pyodide.asm.html build/pyodide.js
build/pyodide.asm.html: src/main.bc src/jsimport.bc src/jsproxy.bc src/js2python.bc \ build/pyodide.asm.html: src/main.bc src/jsimport.bc src/jsproxy.bc src/js2python.bc \
...@@ -44,7 +47,11 @@ build/pyodide.js: src/pyodide.js ...@@ -44,7 +47,11 @@ build/pyodide.js: src/pyodide.js
cp $< $@ cp $< $@
test: all build/test.html: src/test.html
cp $< $@
test: all build/test.html
py.test test py.test test
...@@ -84,9 +91,13 @@ root/.built: \ ...@@ -84,9 +91,13 @@ root/.built: \
touch root/.built touch root/.built
$(CPYTHONLIB): $(CPYTHONLIB): emsdk/emsdk
make -C $(CPYTHONROOT) make -C $(CPYTHONROOT)
$(NUMPY_LIBS): $(CPYTHONLIB) $(NUMPY_LIBS): $(CPYTHONLIB)
make -C numpy make -C numpy
emsdk/emsdk:
make -C emsdk
export PATH += $(PYODIDE_ROOT)/emsdk/emsdk:$(PYODIDE_ROOT)/emsdk/emsdk/clang/fastcomp/build_incoming_64/bin:$(PYODIDE_ROOT)/emsdk/emsdk/node/8.9.1_64bit/bin:$(PYODIDE_ROOT)/emsdk/emsdk/emscripten/incoming:$(PYODIDE_ROOT)/emsdk/emsdk/binaryen/master_64bit_binaryen/bin:$PATH
EMSDK = $(PYODIDE_ROOT)/emsdk/emsdk
EM_CONFIG = $(PYODIDE_ROOT)/emsdk/emsdk/.emscripten
EMSCRIPTEN = $(PYODIDE_ROOT)/emsdk/emsdk/emscripten/incoming
BINARYEN_ROOT = $(PYODIDE_ROOT)/emsdk/emsdk/binaryen/master_64bit_binaryen
...@@ -9,13 +9,13 @@ this means Python has full access to the Web APIs. ...@@ -9,13 +9,13 @@ this means Python has full access to the Web APIs.
These instructions were tested on Linux. OSX should be substantively the same. These instructions were tested on Linux. OSX should be substantively the same.
1. Build/install emscripten according to its instructions. Make sure the prerequisites for emsdk are installed.
2. Enable the emscripten environment (`source emsdk_env.sh`) Type `make`.
3. Build this project. (The build downloads and builds a local, patched version of emsdk, then
downloads and builds Python and Numpy, and finally builds the pyodide-specific
Type `make`. code.)
# Testing # Testing
......
PYODIDE_ROOT=$(abspath ..)
include ../Makefile.envs
PYVERSION=3.6.4 PYVERSION=3.6.4
PYMINOR=$(basename $(PYVERSION)) PYMINOR=$(basename $(PYVERSION))
......
all: emsdk/emsdk_env.sh
emsdk/emsdk_env.sh:
git clone https://github.com/juj/emsdk.git
( \
cd emsdk ; \
./emsdk install --build=Release sdk-incoming-64bit binaryen-master-64bit ; \
cd .. ; \
(cat patches/*.patch | patch -p1) ; \
cd emsdk ; \
./emsdk install --build=Release sdk-incoming-64bit binaryen-master-64bit ; \
./emsdk activate --embedded --build=Release sdk-incoming-64bit binaryen-master-64bit \
)
clean:
rm -rf emsdk
diff --git a/emsdk/binaryen/master/src/passes/FuncCastEmulation.cpp b/emsdk/binaryen/master/src/passes/FuncCastEmulation.cpp
index 013e9403..d95fc282 100644
--- a/emsdk/binaryen/master/src/passes/FuncCastEmulation.cpp
+++ b/emsdk/binaryen/master/src/passes/FuncCastEmulation.cpp
@@ -39,7 +39,7 @@ namespace wasm {
// This should be enough for everybody. (As described above, we need this
// to match when dynamically linking, and also dynamic linking is why we
// can't just detect this automatically in the module we see.)
-static const int NUM_PARAMS = 15;
+static const int NUM_PARAMS = 32;
// Converts a value to the ABI type of i64.
static Expression* toABI(Expression* value, Module* module) {
\ No newline at end of file
PYODIDE_ROOT=$(abspath ..)
include ../Makefile.envs
PYVERSION=3.6.4 PYVERSION=3.6.4
PYMINOR=$(basename $(PYVERSION)) PYMINOR=$(basename $(PYVERSION))
......
<html>
<head>
<meta charset="utf-8"/>
<script>
window.logs = [];
console.log = function(message) {
window.logs.push(message);
}
</script>
<script src="pyodide.js"></script>
</head>
</html>
...@@ -13,7 +13,7 @@ BUILD_PATH = TEST_PATH / '..' / 'build' ...@@ -13,7 +13,7 @@ BUILD_PATH = TEST_PATH / '..' / 'build'
class PyodideInited: class PyodideInited:
def __call__(self, driver): def __call__(self, driver):
inited = driver.execute_script("return pyodide.runPython") inited = driver.execute_script("return window.pyodide && window.pyodide.runPython")
return inited is not None return inited is not None
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment