mirror of https://github.com/pyodide/pyodide.git
Merge pull request #88 from mdboom/ccache
Use ccache to speed up rebuilds
This commit is contained in:
commit
757725bfba
|
@ -17,7 +17,7 @@ jobs:
|
||||||
# Set up the Debian testing repo, and then install g++ from there...
|
# Set up the Debian testing repo, and then install g++ from there...
|
||||||
sudo bash -c "echo \"deb http://ftp.us.debian.org/debian testing main contrib non-free\" >> /etc/apt/sources.list"
|
sudo bash -c "echo \"deb http://ftp.us.debian.org/debian testing main contrib non-free\" >> /etc/apt/sources.list"
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install node-less cmake build-essential clang-format-6.0 flake8 uglifyjs python3-yaml chromium
|
sudo apt-get install node-less cmake build-essential clang-format-6.0 flake8 uglifyjs python3-yaml chromium ccache
|
||||||
sudo apt-get install -t testing g++-8
|
sudo apt-get install -t testing g++-8
|
||||||
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-6
|
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-6
|
||||||
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 80 --slave /usr/bin/g++ g++ /usr/bin/g++-8
|
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 80 --slave /usr/bin/g++ g++ /usr/bin/g++-8
|
||||||
|
@ -47,18 +47,20 @@ jobs:
|
||||||
|
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
keys:
|
keys:
|
||||||
- v1-emsdk-{{ checksum "emsdk/Makefile" }}-v4
|
- v1-emsdk-{{ checksum "emsdk/Makefile" }}-v6
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: build
|
name: build
|
||||||
no_output_timeout: 1200
|
no_output_timeout: 1200
|
||||||
command: |
|
command: |
|
||||||
make
|
make
|
||||||
|
ccache -s
|
||||||
|
|
||||||
- save_cache:
|
- save_cache:
|
||||||
paths:
|
paths:
|
||||||
- ./emsdk/emsdk
|
- ./emsdk/emsdk
|
||||||
key: v1-emsdk-{{ checksum "emsdk/Makefile" }}-v4
|
- ~/.ccache
|
||||||
|
key: v1-emsdk-{{ checksum "emsdk/Makefile" }}-v6
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: test
|
name: test
|
||||||
|
|
|
@ -13,6 +13,7 @@ build
|
||||||
downloads
|
downloads
|
||||||
host
|
host
|
||||||
installs
|
installs
|
||||||
|
ccache
|
||||||
|
|
||||||
/root/
|
/root/
|
||||||
/build/
|
/build/
|
||||||
|
|
23
Makefile
23
Makefile
|
@ -29,6 +29,7 @@ LDFLAGS=\
|
||||||
-s WASM=1 \
|
-s WASM=1 \
|
||||||
-s SWAPPABLE_ASM_MODULE=1 \
|
-s SWAPPABLE_ASM_MODULE=1 \
|
||||||
-s USE_FREETYPE=1 \
|
-s USE_FREETYPE=1 \
|
||||||
|
-s USE_LIBPNG=1 \
|
||||||
-std=c++14 \
|
-std=c++14 \
|
||||||
-lstdc++ \
|
-lstdc++ \
|
||||||
--memory-init-file 0
|
--memory-init-file 0
|
||||||
|
@ -126,7 +127,7 @@ clean:
|
||||||
|
|
||||||
|
|
||||||
%.bc: %.c $(CPYTHONLIB)
|
%.bc: %.c $(CPYTHONLIB)
|
||||||
$(CC) -o $@ $< $(CFLAGS)
|
$(CC) -o $@ -c $< $(CFLAGS)
|
||||||
|
|
||||||
|
|
||||||
build/test.data: $(CPYTHONLIB)
|
build/test.data: $(CPYTHONLIB)
|
||||||
|
@ -161,7 +162,25 @@ root/.built: \
|
||||||
touch root/.built
|
touch root/.built
|
||||||
|
|
||||||
|
|
||||||
$(CPYTHONLIB): emsdk/emsdk/.complete
|
ccache/emcc:
|
||||||
|
if hash ccache &>/dev/null; then \
|
||||||
|
mkdir -p $(PYODIDE_ROOT)/ccache ; \
|
||||||
|
ln -s `which ccache` $(PYODIDE_ROOT)/ccache/emcc ; \
|
||||||
|
else \
|
||||||
|
ln -s emsdk/emsdk/emscripten/tag-1.38.4/emcc $(PYODIDE_ROOT)/ccache/emcc; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
ccache/em++:
|
||||||
|
if hash ccache &>/dev/null; then \
|
||||||
|
mkdir -p $(PYODIDE_ROOT)/ccache ; \
|
||||||
|
ln -s `which ccache` $(PYODIDE_ROOT)/ccache/em++ ; \
|
||||||
|
else \
|
||||||
|
ln -s emsdk/emsdk/emscripten/tag-1.38.4/em++ $(PYODIDE_ROOT)/ccache/em++; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
$(CPYTHONLIB): emsdk/emsdk/.complete ccache/emcc ccache/em++
|
||||||
make -C $(CPYTHONROOT)
|
make -C $(CPYTHONROOT)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export PATH := $(PYODIDE_ROOT)/emsdk/emsdk:$(PYODIDE_ROOT)/emsdk/emsdk/clang/tag-e-1.38.4/build_tag-e1.38.4_64/bin:$(PYODIDE_ROOT)/emsdk/emsdk/node/8.9.1_64bit/bin:$(PYODIDE_ROOT)/emsdk/emsdk/emscripten/tag-1.38.4:$(PYODIDE_ROOT)/emsdk/emsdk/binaryen/tag-1.38.4_64bit_binaryen/bin:$(PATH)
|
export PATH := $(PYODIDE_ROOT)/ccache:$(PYODIDE_ROOT)/emsdk/emsdk:$(PYODIDE_ROOT)/emsdk/emsdk/clang/tag-e-1.38.4/build_tag-e1.38.4_64/bin:$(PYODIDE_ROOT)/emsdk/emsdk/node/8.9.1_64bit/bin:$(PYODIDE_ROOT)/emsdk/emsdk/emscripten/tag-1.38.4:$(PYODIDE_ROOT)/emsdk/emsdk/binaryen/tag-1.38.4_64bit_binaryen/bin:$(PATH)
|
||||||
|
|
||||||
export EMSDK = $(PYODIDE_ROOT)/emsdk/emsdk
|
export EMSDK = $(PYODIDE_ROOT)/emsdk/emsdk
|
||||||
export EM_CONFIG = $(PYODIDE_ROOT)/emsdk/emsdk/.emscripten
|
export EM_CONFIG = $(PYODIDE_ROOT)/emsdk/emsdk/.emscripten
|
||||||
|
|
|
@ -28,6 +28,8 @@ Additional build prerequisites are:
|
||||||
- PyYAML
|
- PyYAML
|
||||||
- [lessc](https://lesscss.org/) to compile less to css.
|
- [lessc](https://lesscss.org/) to compile less to css.
|
||||||
- [uglifyjs](https://github.com/mishoo/UglifyJS) to minify Javascript builds.
|
- [uglifyjs](https://github.com/mishoo/UglifyJS) to minify Javascript builds.
|
||||||
|
- [ccache](https://ccache.samba.org) (optional) recommended for much faster rebuilds.
|
||||||
|
|
||||||
|
|
||||||
`make`
|
`make`
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ _posixsubprocess _posixsubprocess.c
|
||||||
|
|
||||||
binascii binascii.c
|
binascii binascii.c
|
||||||
|
|
||||||
zlib zlibmodule.c -IModules/zlib zlib/adler32.c zlib/crc32.c zlib/deflate.c zlib/infback.c zlib/inffast.c zlib/inflate.c zlib/inftrees.c zlib/trees.c zlib/zutil.c zlib/compress.c zlib/uncompr.c zlib/gzclose.c zlib/gzlib.c zlib/gzread.c zlib/gzwrite.c
|
zlib zlibmodule.c -IModules/zlib
|
||||||
|
|
||||||
pyexpat expat/xmlparse.c expat/xmlrole.c expat/xmltok.c pyexpat.c -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI -DXML_POOR_ENTROPY
|
pyexpat expat/xmlparse.c expat/xmlrole.c expat/xmltok.c pyexpat.c -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI -DXML_POOR_ENTROPY
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import os
|
||||||
import pathlib
|
import pathlib
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
@ -286,7 +287,7 @@ def test_run_core_python_test(python_test, selenium):
|
||||||
def pytest_generate_tests(metafunc):
|
def pytest_generate_tests(metafunc):
|
||||||
if 'python_test' in metafunc.fixturenames:
|
if 'python_test' in metafunc.fixturenames:
|
||||||
test_modules = []
|
test_modules = []
|
||||||
if True:
|
if 'CIRCLECI' not in os.environ:
|
||||||
with open(
|
with open(
|
||||||
str(pathlib.Path(__file__).parents[0] /
|
str(pathlib.Path(__file__).parents[0] /
|
||||||
"python_tests.txt")) as fp:
|
"python_tests.txt")) as fp:
|
||||||
|
|
Loading…
Reference in New Issue