Control: retitle -1 Please ship mip
Control: clone -1 -2
Control: retitle -2 Please decrease the mbedTLS DEBUG level

On Sat, Aug 12, 2023 at 04:52:12PM +0300, Faidon Liambotis wrote:
> Removing FROZEN_MANIFEST= from d/rules resulted in the build system
> complaining about the omission of micropython-lib. Extracting the
> official 1.20 micropython-lib tarball to lib/micropython-lib, however,
> made the build work:
>    MicroPython v1.20.0+ds-1 on 2023-08-07; linux [GCC 13.2.0] version
>    Use Ctrl-D to exit, Ctrl-E for paste mode
>    >>> import uasyncio
>    >>>
> 
> So the solution here is a bit more involved: it requires shipping
> micropython-lib, for example leveraging multiple tarball support and
> gbp-import-orig's component support.

If you are not comfortable with including micropython-lib in the
package, an alternative would be to cherry pick "mip", its dependencies
(currrently: only "requests") and optionally "mip-cmdline" from that
repository and include them manually in the package. It's just 2-3
files.

The rest of micropython-lib can be installed using "mip", AFAIK.

> (There are some mbedTLS DEBUG messages being emitted when fetching from
> e.g. GitHub, that I haven't tracked down yet, but that's getting a
> little offtopic.)

This still stands and is quite evident (read: annoying) when using
mip/requests.

The cause is that:

1) mbedTLS in Debian is (rightfully) enables the build-time debug option
(MBEDTLS_DEBUG_C). This is in contrast to what MicroPython does with its
embedded mbedTLS copy, which the Debian package does not use.

2) The MicroPython source enables the run-time debug option
(mbedtls_debug_set_threshold(3), with 3=debug), unconditionally, as long
as MBEDTLS_DEBUG_C is defined. See extmod/modtls_mbedtls.c:264.

The right fix would be for MicroPython to do this conditionally through
e.g. an enviromental variable or an module import option.

But in the meantime, this level should probably be patched locally to
decrease the value. "0" (no debug) would match upstream, but "1"
(warnings) could probably be OK, too?

Regards,
Faidon

Reply via email to