File tree Expand file tree Collapse file tree 2 files changed +47
-3
lines changed
Expand file tree Collapse file tree 2 files changed +47
-3
lines changed Original file line number Diff line number Diff line change 44source common.sh
55
66VERSION=$1
7+ VARIANT=standard
78
89URL=https://github.com/micropython/micropython.git
9- REPO=micropython
10+ REPO=/tmp/ micropython
1011
1112LAST_REVISION=" ${3:- } "
1213
1819
1920FULLNAME=" ${REVISION} .tar.xz"
2021OUTPUT=" $2 /${FULLNAME} "
22+ SCRIPT_DIR=" $( cd -- " $( dirname -- " ${BASH_SOURCE[0]} " ) " & > /dev/null && pwd ) "
2123
2224DEST=" /opt/compiler-explorer/${REVISION} "
2325
2931 git clone --depth 1 " ${URL} " -b " v${VERSION} " " ${REPO} "
3032fi ;
3133
34+ make -C " ${REPO} /ports/unix" submodules
35+ make -C " ${REPO} /ports/unix" deplibs
36+
37+ for patch in " ${SCRIPT_DIR} " /patches/* .patch; do
38+ patch --unified --strip=1 --dir=" ${REPO} " --input=" ${patch} " || true
39+ done
40+
3241(
3342 cd " ${REPO} "
3443 set +u
3544 source tools/ci.sh
36- ci_unix_standard_build
45+
46+ make ${MAKEOPTS} -C mpy-cross
47+ make ${MAKEOPTS} -C ports/unix VARIANT=${VARIANT}
48+
49+ ci_unix_build_ffi_lib_helper gcc
50+ )
51+
52+ (
53+ cd " ${REPO} /lib/micropython-lib/"
54+ set +u
55+ source tools/ci.sh
56+
57+ PACKAGE_INDEX_PATH=" ${DEST} /mip" ci_build_packages_compile_index
3758)
3859
3960mkdir -p " ${DEST} " " ${DEST} /bin" " ${DEST} /tools" " ${DEST} /py" " ${DEST} /lib"
4061cp " ${REPO} /mpy-cross/build/mpy-cross" " ${DEST} /bin/mpy-cross"
41- cp " ${REPO} /ports/unix/build-standard /micropython" " ${DEST} /bin/micropython"
62+ cp " ${REPO} /ports/unix/build-${VARIANT} /micropython" " ${DEST} /bin/micropython"
4263cp " ${REPO} /tools/mpy-tool.py" " ${DEST} /tools/mpy-tool.py"
4364cp " ${REPO} /py/makeqstrdata.py" " ${DEST} /py/makeqstrdata.py"
4465
Original file line number Diff line number Diff line change 1+ --- a/lib/micropython-lib/micropython/mip/mip/__init__.py
2+ +++ b/lib/micropython-lib/micropython/mip/mip/__init__.py
3+ @@ -6 +6,19 @@
4+ - import requests
5+ + class _offline:
6+ + @classmethod
7+ + def get(cls, url):
8+ + return cls(url)
9+ + def __init__(self, url):
10+ + import sys
11+ + path = url.replace(_PACKAGE_INDEX, sys.executable.replace("bin/micropython", "mip"))
12+ + try:
13+ + self.raw = open(path, "rb")
14+ + self.status_code = 200
15+ + except OSError:
16+ + self.raw = None
17+ + self.status_code = 404
18+ + def json(self):
19+ + import json
20+ + return json.load(self.raw)
21+ + def close(self):
22+ + return self.raw and self.raw.close()
23+ + requests = _offline
You can’t perform that action at this time.
0 commit comments