Comments (5)
I changed the declaration in obj.h to try and fix point (c). Let me know if it worked.
from micropython.
replacing malloc.h with stdlib.h is the correct fix, it is the proper way to include it. Issue #27 is basically a duplicate of this.
from micropython.
Damien,
Thanks for the quick turn around. The obj.h fix solved the declaration problem. I still needed to manually patch main.c to import stdlib.h rather than malloc.h but with this change the py and cpy interpreters built cleanly.
I ran the test suite - the basic tests all passed however a number of the bytecode tests failed (though I am not sure if this is expected (output below).
One minor point - the 'run-tests.sh' expects /bin/bash to be present (and doesn't work with /bin/sh) - for portability this should be "#!/usr/bin/env bash"
So - to build on FreeBSD now just requires:
- The stdlib.h patch
- The bash change
- Note about needing bash & python3 packages
Paul.
--- Bytecode test output Testing directory mp-tests... assert1 : 17 lines, 100.0% correct assign1 : 38 lines, 100.0% correct assign2 : 33 lines, 100.0% correct augassign1 : 37 lines, 100.0% correct call1 : 13 lines, 100.0% correct class1 : 30 lines, 100.0% correct class2 : 36 lines, 100.0% correct class3 : 85 lines, 100.0% correct class4 : 69 lines, 100.0% correct class5 : 94 lines, 100.0% correct closure1 : 7 lines, 100.0% correct closure2 : 40 lines, 100.0% correct closure3 : 56 lines, 100.0% correct closure4 : 61 lines, 100.0% correct compare1 : 75 lines, 98.7% correct const1 : 17 lines, 94.1% correct continue1 : 151 lines, 94.7% correct decorate1 : 87 lines, 100.0% correct del1 : 54 lines, 100.0% correct del2 : 28 lines, 100.0% correct dict1 : 22 lines, 100.0% correct dictcomp1 : 53 lines, 100.0% correct docstring1 : 53 lines, 100.0% correct docstring2 : 9 lines, 100.0% correct fun1 : 22 lines, 100.0% correct fun2 : 134 lines, 100.0% correct fun3 : 43 lines, 100.0% correct if1 : 70 lines, 100.0% correct if2 : 60 lines, 100.0% correct if3 : 33 lines, 93.9% correct, 1 bad 3-field if4 : 40 lines, 97.5% correct ifexpr1 : 13 lines, 100.0% correct import1 : 32 lines, 100.0% correct import2 : 13 lines, 100.0% correct import3 : 47 lines, 100.0% correct import4 : 22 lines, 100.0% correct import5 : 33 lines, 100.0% correct lambda1 : 31 lines, 100.0% correct lambda2 : 18 lines, 100.0% correct list1 : 41 lines, 100.0% correct list2 : 39 lines, 100.0% correct listcomp1 : 79 lines, 100.0% correct listcomp2 : 29 lines, 100.0% correct listcomp3 : 60 lines, 100.0% correct listcomp4 : 44 lines, 100.0% correct listcomp5 : 186 lines, 100.0% correct locals1 : 91 lines, 100.0% correct ptex : 1085 lines, 97.9% correct, 1 bad 3-field raise1 : 70 lines, 98.6% correct scope0 : 30 lines, 100.0% correct scope1 : 43 lines, 100.0% correct scope2 : 52 lines, 100.0% correct scope3 : 58 lines, 100.0% correct scope4 : 45 lines, 100.0% correct scope5 : 56 lines, 100.0% correct scope6 : 48 lines, 100.0% correct scope7 : 78 lines, 100.0% correct set1 : 29 lines, 100.0% correct setcomp1 : 53 lines, 100.0% correct slice1 : 95 lines, 100.0% correct slice2 : 19 lines, 100.0% correct string1 : 23 lines, 100.0% correct string2 : 51 lines, 100.0% correct super1 : 141 lines, 100.0% correct try1 : 85 lines, 98.8% correct try2 : 28 lines, 96.4% correct try3 : 66 lines, 98.5% correct try4 : 118 lines, 99.2% correct try5 : 52 lines, 98.1% correct try6 : 50 lines, 98.0% correct tuple1 : 73 lines, 100.0% correct tuple2 : 73 lines, 100.0% correct tuple3 : 35 lines, 100.0% correct with1 : 61 lines, 98.4% correct yield1 : 69 lines, 100.0% correct yield2 : 37 lines, 100.0% correct Testing directory pylib-tests... _compat_pickle : 252 lines, 99.6% correct _threading_local : 449 lines, 99.1% correct, 1 bad 3-field _weakrefset : 1119 lines, 99.3% correct abc : 613 lines, 98.7% correct, 1 bad 3-field aifc : 3301 lines, 98.7% correct, 6 bad 3-field antigravity : 95 lines, 100.0% correct base64 : 1407 lines, 99.4% correct bdb : 2545 lines, 98.5% correct, 7 bad 3-field binhex : 2030 lines, 99.4% correct, 6 bad 3-field bisect : 270 lines, 98.1% correct bz2 : 1554 lines, 99.1% correct, 5 bad 3-field cProfile : 675 lines, 98.8% correct chunk : 501 lines, 98.4% correct code : 700 lines, 98.7% correct compileall : 874 lines, 96.0% correct, 7 bad 3-field contextlib : 744 lines, 97.6% correct, 11 bad 3-field crypt : 222 lines, 98.2% correct dummy_threading : 138 lines, 99.3% correct fnmatch : 361 lines, 97.0% correct, 1 bad 3-field genericpath : 319 lines, 98.4% correct getopt : 768 lines, 98.4% correct hashlib : 302 lines, 97.4% correct Traceback (most recent call last): File "unpyc.py", line 112, in show_file(fname) File "unpyc.py", line 14, in show_file show_code(c, to_show_code) File "unpyc.py", line 24, in show_code disassemble(code) File "unpyc.py", line 85, in disassemble print(repr(co.co_consts[oparg])) UnicodeEncodeError: 'ascii' codec can't encode character '\xe7' in position 36: ordinal not in range(128) Traceback (most recent call last): File "check.py", line 5, in lines_me = [l.strip('\n') for l in sys.stdin.readlines()] File "/usr/local/lib/python3.3/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1465: ordinal not in range(128) keyword : 232 lines, 97.4% correct, 1 bad 3-field macurl2path : 390 lines, 98.5% correct mimetypes : 1546 lines, 98.8% correct modulefinder : 3037 lines, 98.2% correct nturl2path : 267 lines, 97.8% correct opcode : 724 lines, 100.0% correct pipes : 907 lines, 99.3% correct poplib : 1028 lines, 99.7% correct, 1 bad 3-field pty : 666 lines, 98.2% correct reprlib : 861 lines, 98.3% correct, 10 bad 3-field rlcompleter : 440 lines, 96.6% correct runpy : 962 lines, 99.0% correct sched : 536 lines, 99.6% correct shelve : 787 lines, 99.5% correct socket : 1319 lines, 98.3% correct, 1 bad 3-field socketserver : 1729 lines, 98.6% correct, 8 bad 3-field sre_constants : 559 lines, 100.0% correct stat : 367 lines, 99.5% correct struct : 32 lines, 100.0% correct sunau : 1724 lines, 99.2% correct, 3 bad 3-field symbol : 249 lines, 99.2% correct tabnanny : 1181 lines, 97.9% correct, 3 bad 3-field tempfile : 2268 lines, 98.5% correct this : 76 lines, 100.0% correct timeit : 914 lines, 97.9% correct, 10 bad 3-field tty : 170 lines, 100.0% correct types : 327 lines, 99.7% correct uu : 697 lines, 97.8% correct, 2 bad 3-field wave : 1762 lines, 99.4% correct, 1 bad 3-field weakref : 1553 lines, 97.8% correct xdrlib : 1068 lines, 96.2% correct, 39 bad 3-field
from micropython.
I've push changes for everthing except the notes about needing packages for bash and python3. What exactly should I say for this?
from micropython.
Just list it as a build requirement; I'll update the page I've started on the wiki to keep track of those things to reflect that.
from micropython.
Related Issues (20)
- Viper: Unary minus changes rhs variable in place, even if assigned to new lhs variable. HOT 1
- [webassembly] element.onclick = async fn fails HOT 2
- Integrating flashloader into MicroPython (RP2)
- Pico W:when I try "wlan.connect()" and "wlan.scan()" ,I get an "OSError: [Errno 1] EPERM" HOT 1
- [webassembly] [pyscript] Unable to create a File from the virtual FileSystem HOT 10
- Micropython download page add link/anchor to variant section headers
- docs: Fix typos in README.md
- ESP32 without psram. Socket and [Errno 105] ENOBUFS HOT 11
- Incorrect static const data behavior in native module on esp32.
- mpy_ld.py: Unsupported relocation when using cos/sin functions HOT 2
- Unix port macOS user_c_module build failure HOT 9
- Using dynamically linked mbedtls
- Cannot build example usercmodule in nrf port HOT 2
- Make MPY ARCH supports for ESP32C3 RISCV HOT 2
- Pico-W OSError: [Errno 22] EINVAL bluetooth module HOT 1
- expanding the ESP32 NVS
- ESP32 NVS OverflowError
- changes from menuconfig are only applied after cleaning HOT 1
- Does not build for ESP32-S3 with IDF 5.2 despite claiming support HOT 3
- get_x_aligned returns wrong value in case of percentage unit HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from micropython.