Making UNIX nanbox on Ubuntu 22.04 #17636
-
Dear experts, I built the $ cd micropython/tests
$ BUILD=/tmp/bbb MICROPY_MICROPYTHON=${BUILD}/micropython ./run-tests.py -j2
platform=linux
pass basics/bytes_mult.py
pass basics/0prelim.py
...
skip unicode/unicode_ure.py
pass extmod/hashlib_md5.py
pass extmod/hashlib_sha1.py
902 tests performed (28444 individual testcases)
902 tests passed
98 tests skipped: attrtuple2 class_inplace_op2 builtin_range_binop fun_code fun_code_micropython io_buffered_writer memoryview_itemsize sys_getsizeof sys_tracebacklimit namedtuple_asdict machine_disable_irq machine_i2s_rate machine_rtc machine_soft_timer machine_spi_rate machine_uart_irq_txidle machine_uart_tx marshal_basic marshal_micropython marshal_stress re_debug re_groups cmd_parsetree re_span ssl_ioctl ssl_poll repl_sys_ps1_ps2 asyncio_as_uasyncio heap_locked import_mpy_native import_mpy_native_gc native_closure native_const native_const_intbig native_for native_fun_attrs native_fun_attrs_code native_gen native_misc native_try native_try_deep native_while native_with viper_addr viper_args viper_binop_arith viper_binop_arith_uint viper_binop_bitwise_uint viper_binop_comp viper_binop_comp_imm viper_binop_comp_uint viper_binop_divmod viper_binop_multi_comp viper_cond viper_const viper_const_intbig viper_error viper_globals viper_import viper_misc viper_misc2 viper_misc3 viper_misc_intbig viper_ptr16_load viper_ptr16_load_boundary viper_ptr16_store viper_ptr16_store_boundary viper_ptr32_load viper_ptr32_load_boundary viper_ptr32_store viper_ptr32_store_boundary viper_ptr8_load viper_ptr8_load_boundary viper_ptr8_store viper_ptr8_store_boundary viper_storeattr viper_subscr viper_subscr_multi viper_try viper_types viper_unop viper_with cexample_class cexample_module cexample_subclass sys_settrace_features sys_settrace_generator sys_settrace_loop extra_coverage ffi_int_base ffi_int_long32 ffi_int_long64 ffi_int_types cryptolib_aes128_ctr deflate_compress deflate_compress_memory_error deflate_stream_error unicode_ure If above result is correct I can send a PR later. |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 8 replies
-
Looks normal: no failures, and the skipped ones should be all for features which aren't enabled. |
Beta Was this translation helpful? Give feedback.
-
@stinos, thanks for confirmation. The issue I noticed is at ports/unix/Makefile:L124 . Currently it uses non-existing folder $ dpkg -S /usr/include/i386-linux-gnu/
linux-libc-dev:i386, libffi-dev:i386, libstdc++-11-dev:i386, libc6-dev:i386: /usr/include/i386-linux-gnu However, I tried nanbox variant again just now but failed to reproduce the issue I met earlier. Or that folder |
Beta Was this translation helpful? Give feedback.
-
I've added a commit in #17638 and it passed CI.
The change is to add `global lock` in `thread_main`. I checked it locally with:
```sh
$ for i in {1..100}; do ./firmware.elf select_poll_eintr.py; done
```
A sleep() based implementation by replacing `pass` with `time.sleep(0.01)` didn't pass same test until the `global` line was added. So I think that `global` line helps more?
|
Beta Was this translation helpful? Give feedback.
-
I wouldn't be surprised if this is just a coincidence and doesn't gurantee no failurs in the future. Because
That's still 100 times less than |
Beta Was this translation helpful? Give feedback.
-
@stinos per further notes in #17638, it looks the root cause does relate to globals map rehashing. see #11604 for more explanations. |
Beta Was this translation helpful? Give feedback.
-
Aha, in that case: apologies, my guess wrt threads was wrong then.
In general: the threads in MicroPython are threads impleneted in C. So if the main script exits, the main thread is still running C code to cleanup MicroPython objects and whatnot. While at the same time the other thread can also still be running the other MicroPython code. I.e. it's not because the last line of Python code in the main thread has executed that all other threads stop right at that point. |
Beta Was this translation helpful? Give feedback.
Aha, in that case: apologies, my guess wrt threads was wrong then.
In general: the threads in MicroPython are threads impleneted in C. So if the main script exits, the main thread is still running C code to cleanup MicroPython objects and whatnot. While at the same time the other thread can also still be running the other MicroPython code. I.e. it's not because the last line of Python code in the main thread has executed that all other threads stop right at that point.