Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
103
Merge Requests
103
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos
Commits
42a5a21b
Commit
42a5a21b
authored
Mar 15, 2019
by
Boxiang Sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Amend the pyodide buildout
parent
01436279
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
38 deletions
+49
-38
component/pyodide/buildout.cfg
component/pyodide/buildout.cfg
+49
-38
No files found.
component/pyodide/buildout.cfg
View file @
42a5a21b
...
...
@@ -33,6 +33,7 @@ extends =
parts =
pyodide
pyodide-script-test
nodejs
npm
python3.7.2-PyYAML
...
...
@@ -58,6 +59,21 @@ repository = https://lab.nexedi.com/Daetalus/pyodide.git
location = ${buildout:parts-directory}/${:_buildout_section_name_}
branch = master
[pytest]
recipe = zc.recipe.egg:custom
egg = pytest
eggs =
python-setuptools
py
six
attrs
funcsigs
pathlib2
pluggy
atomicwrites
more-itertools
pytest-instafail
[pyodide-script]
recipe = slapos.recipe.build
location = ${buildout:parts-directory}/${:_buildout_section_name_}
...
...
@@ -71,43 +87,49 @@ PATH=${git:location}/bin:${pkgconfig:location}/bin:${freetype:location}/bin:${no
CC=${gcc-8.2:location}/bin/gcc
CXX=${gcc-8.2:location}/bin/g++
CPPFLAGS=-I${f2c:location}/include -I${zlib:location}/include -I${xz-utils:location}/include -I${readline:location}/include -I${libexpat:location}/include -I${libffi:location}/include -I${ncurses:location}/include -I${ncurses:location}/include/ncursesw -I${bzip2:location}/include -I${gdbm:location}/include -I${openssl:location}/include -I${sqlite3:location}/include -I${gettext:location}/include
LD_LIBRARY_PATH_EMSDK=${gcc-8.2:location}/lib
:${gcc-8.2:location}/lib64
LD_LIBRARY_PATH_EMSDK=${gcc-8.2:location}/lib
64:${gcc-8.2:location}/lib
LD_LIBRARY_PATH=${libpng:location}/lib:${openssl:location}/lib:${readline:location}/lib:${libexpat:location}/lib:${xz-utils:location}/lib:${sqlite3:location}/lib:${gdbm:location}/lib:${bzip2:location}/lib:${ncurses:location}/lib:${libffi:location}/lib
LDFLAGS=-L${zlib:location}/lib -L${xz-utils:location}/lib -L${readline:location}/lib -L${libexpat:location}/lib -L${libffi:location}/lib -L${ncurses:location}/lib -L${bzip2:location}/lib -L${gdbm:location}/lib -L${openssl:location}/lib -L${sqlite3:location}/lib -Wl,-rpath=${zlib:location}/lib -Wl,-rpath=${xz-utils:location}/lib -Wl,-rpath=${readline:location}/lib -Wl,-rpath=${libexpat:location}/lib -Wl,-rpath=${libffi:location}/lib -Wl,-rpath=${ncurses:location}/lib -Wl,-rpath=${bzip2:location}/lib -Wl,-rpath=${gdbm:location}/lib -Wl,-rpath=${openssl:location}/lib -Wl,-rpath=${sqlite3:location}/lib -L${gettext:location}/lib -Wl,-rpath=${gettext:location}/lib -Wl,-rpath=${file:location}/lib
PYTHON_EXECUTABLE=${python3.7.2:location}/bin/
C_INCLUDE_PATH=
/srv/slapgrid/slappart19/srv/runner/software/100608c416350c3c5f1f11bde4d11d82/parts/gcc-8.2
/include:
C_INCLUDE_PATH=
${gcc-8.2:location}
/include:
openssl_location = ${openssl:location}
stop-on-error=true
script =
import subprocess, os, shutil
# shutil.rmtree(self.options['build_dir'], ignore_errors=True)
# os.mkdir(self.options['location'])
# call(['rm -rf', self.options['location']], cwd=self.options['part_dir'])
#call(['mkdir', self.options['location'])
shutil.rmtree(self.options['build_dir'], ignore_errors=True)
cpython_makefile_command = 'sed -ie "s@./configure --prefix@./configure --with-openssl=' + self.options['openssl_location'] + ' --prefix@" ' + self.options['build_dir'] + '/cpython/Makefile'
disable_package_command = 'rm -rf ' + self.options['build_dir'] + '/packages/'
get_pip = "curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py"
install_pip = "python3 get-pip.py"
install_pytest = "pip install pytest selenium pytest-instafail pytest-timeout"
change_python3_name = 'ln -s ' + self.options['PYTHON_EXECUTABLE'] + 'python3 ' + self.options['PYTHON_EXECUTABLE'] + 'python'
command_list = [
# {'cmd': self.options['git-executable'] + ' clone ' + self.options['repository'] + ' pyodide-script-test', 'cwd': self.options['part_dir']},
# {'cmd': change_python3_name, 'cwd': self.options['build_dir']},
{'cmd': 'python --version && make -C emsdk', 'cwd': self.options['build_dir']},
{'cmd': self.options['git-executable'] + ' clone ' + self.options['repository'] + ' pyodide-script-test', 'cwd': self.options['part_dir']},
{'cmd': change_python3_name, 'cwd': self.options['build_dir']},
{'cmd': cpython_makefile_command, 'cwd': self.options['build_dir']},
{'cmd': get_pip, 'cwd': self.options['build_dir']},
{'cmd': install_pip, 'cwd': self.options['build_dir']},
{'cmd': install_pytest, 'cwd': self.options['build_dir']},
{'cmd': disable_package_command + 'scipy', 'cwd': self.options['build_dir']},
{'cmd': disable_package_command + 'matplotlib', 'cwd': self.options['build_dir']},
{'cmd': disable_package_command + 'scikit-learn', 'cwd': self.options['build_dir']},
{'cmd': disable_package_command + 'pandas', 'cwd': self.options['build_dir']},
{'cmd': disable_package_command + 'networkx', 'cwd': self.options['build_dir']},
{'cmd': disable_package_command + 'kiwisolver', 'cwd': self.options['build_dir']},
{'cmd': 'python --version && make -C emsdk', 'cwd': self.options['build_dir']},
{'cmd': 'source ./emsdk/emsdk/emsdk_env.sh', 'cwd': self.options['build_dir']},
]
env = {
'PKG_CONFIG_PATH':self.options['PKG_CONFIG_PATH'],
'PATH':self.options['PATH'] + ':' + os.environ['PATH'],
# 'CPPFLAGS':self.options['CPPFLAGS'],
'LD_LIBRARY_PATH':self.options['LD_LIBRARY_PATH_EMSDK'],
'C_INCLUDE_PATH':self.options['C_INCLUDE_PATH'],
# 'LDFLAGS':self.options['LDFLAGS'],
'PYTHON_EXECUTABLE':self.options['PYTHON_EXECUTABLE'],
'CC':self.options['CC'],
'CXX':self.options['CXX'],
}
for command in command_list:
print(command['cmd'])
print('1')
pipe = subprocess.Popen(command['cmd'], cwd=command['cwd'], env=env, shell=True)
pipe.wait()
...
...
@@ -130,41 +152,30 @@ script =
env['LD_LIBRARY_PATH'] += ':' + self.options['LD_LIBRARY_PATH']
env['LDFLAGS'] = self.options['LDFLAGS']
print("Merged environment:")
print("Merged environment:")
print("Merged environment:")
print(env)
command_list_2 = [
{'cmd': 'make -C cpython', 'cwd': self.options['build_dir']},
# make -C CPLAPACK twice, because the first time will report can not find the file './a.out'
# call make again, the problem gone...
{'cmd': 'make build/pyodide.asm.js;,'cwd': self.options['build_dir']},
{'cmd': 'make -C CPLAPACK', 'cwd': self.options['build_dir']},
{'cmd': 'make -C CPLAPACK', 'cwd': self.options['build_dir']},
# black magic: Try to compile matplot and scipy, scikit-leanr, pandas lib manually
# error happened in here
{'cmd': 'make -C packages', 'cwd': self.options['build_dir']},
{'cmd': 'make build/pyodide.asm.js', 'cwd': self.options['build_dir']},
{'cmd': 'make -C CLAPACK', 'cwd': self.options['build_dir']},
{'cmd': 'sleep 5', 'cwd': self.options['build_dir']},
{'cmd': 'make -C CLAPACK', 'cwd': self.options['build_dir']},
{'cmd': 'make -C packages', 'cwd': self.options['build_dir']},
{'cmd': 'make build/pyodide.asm.data', 'cwd': self.options['build_dir']},
{'cmd': 'make build/pyodide.js', 'cwd': self.options['build_dir']},
{'cmd': 'make build/pyodide_dev.js', 'cwd': self.options['build_dir']},
{'cmd': 'make build/python.html', 'cwd': self.options['build_dir']},
{'cmd': 'make build/python_dev.html', 'cwd': self.options['build_dir']},
{'cmd': 'make build/test.data', 'cwd': self.options['build_dir']},
{'cmd': 'make build/packages.json', 'cwd': self.options['build_dir']},
{'cmd': 'make build/test.html', 'cwd': self.options['build_dir']},
{'cmd': 'cp -r ./* ../pyodide', 'cwd': self.options['build_dir']},
]
for command_2 in command_list_2:
pipe = subprocess.Popen(command_2['cmd'], cwd=command_2['cwd'], env=env, shell=True)
pipe.wait()
# clean the LDFLAGS and LD_LIBRARY_PATH, otherwise the matplotlib qhull will get trucated object file.
env['LDFLAGS'] = ''
env['LD_LIBRARY_PATH'] = ''
command_list_3 = [
{'cmd': 'make -C packages', 'cwd': self.options['build_dir']},
{'cmd': 'make -e', 'cwd': self.options['build_dir']},
]
for command_3 in command_list_3:
pipe = subprocess.Popen(command_3['cmd'], cwd=command_3['cwd'], env=env, shell=True)
pipe.wait()
for i in range(10):
print("Hello World")
[python3.7.2-PyYAML]
recipe = slapos.recipe.cmmi
python_bin = ${python3.7.2:location}/bin/python3.7
...
...
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