Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pyodide
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
pyodide
Commits
b8c3e600
Commit
b8c3e600
authored
Mar 30, 2018
by
Michael Droettboom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add end-to-end build. Travis tests.
parent
2ad135ef
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
96 additions
and
9 deletions
+96
-9
.gitignore
.gitignore
+2
-0
.travis.yml
.travis.yml
+21
-0
Makefile
Makefile
+14
-3
Makefile.envs
Makefile.envs
+6
-0
README.md
README.md
+5
-5
cpython/Makefile
cpython/Makefile
+3
-0
emsdk/Makefile
emsdk/Makefile
+16
-0
emsdk/patches/num_params.patch
emsdk/patches/num_params.patch
+13
-0
numpy/Makefile
numpy/Makefile
+3
-0
src/test.html
src/test.html
+12
-0
test/conftest.py
test/conftest.py
+1
-1
No files found.
.gitignore
View file @
b8c3e600
...
...
@@ -6,6 +6,8 @@ __pycache__
/root/
/build/
/emsdk/emsdk
/cpython/build
/cpython/downloads
/cpython/installs
...
...
.travis.yml
0 → 100644
View file @
b8c3e600
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
Makefile
View file @
b8c3e600
PYODIDE_ROOT
=
$(
abspath
.
)
include
Makefile.envs
PYVERSION
=
3.6.4
PYMINOR
=
$(
basename
$(PYVERSION)
)
CPYTHONROOT
=
cpython
...
...
@@ -29,7 +32,7 @@ NUMPY_LIBS=\
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
\
...
...
@@ -44,7 +47,11 @@ build/pyodide.js: src/pyodide.js
cp
$<
$@
test
:
all
build/test.html
:
src/test.html
cp
$<
$@
test
:
all build/test.html
py.test
test
...
...
@@ -84,9 +91,13 @@ root/.built: \
touch
root/.built
$(CPYTHONLIB)
:
$(CPYTHONLIB)
:
emsdk/emsdk
make
-C
$(CPYTHONROOT)
$(NUMPY_LIBS)
:
$(CPYTHONLIB)
make
-C
numpy
emsdk/emsdk
:
make
-C
emsdk
Makefile.envs
0 → 100644
View file @
b8c3e600
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
README.md
View file @
b8c3e600
...
...
@@ -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.
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.
Type
`make`
.
(The build downloads and builds a local, patched version of emsdk, then
downloads and builds Python and Numpy, and finally builds the pyodide-specific
code.)
# Testing
...
...
cpython/Makefile
View file @
b8c3e600
PYODIDE_ROOT
=
$(
abspath
..
)
include
../Makefile.envs
PYVERSION
=
3.6.4
PYMINOR
=
$(
basename
$(PYVERSION)
)
...
...
emsdk/Makefile
0 → 100644
View file @
b8c3e600
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
emsdk/patches/num_params.patch
0 → 100644
View file @
b8c3e600
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
numpy/Makefile
View file @
b8c3e600
PYODIDE_ROOT
=
$(
abspath
..
)
include
../Makefile.envs
PYVERSION
=
3.6.4
PYMINOR
=
$(
basename
$(PYVERSION)
)
...
...
src/test.html
0 → 100644
View file @
b8c3e600
<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>
test/conftest.py
View file @
b8c3e600
...
...
@@ -13,7 +13,7 @@ BUILD_PATH = TEST_PATH / '..' / 'build'
class
PyodideInited
:
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment