nrf: Enable binascii, hashlib modules#761
Conversation
|
Adding @microbuilder as a reviewer, because he is best aware of the storage budget on nrf. |
|
@jepler can you verify that you can still build the feather with SD 5.0.0 ( Because looking at https://travis-ci.org/adafruit/circuitpython/jobs/366250196#L1146 and https://github.com/adafruit/circuitpython/blob/master/ports/nrf/boards/feather52/custom_nrf52832_dfu_app_5.0.0.ld#L26, I'm not sure if it will fit. |
|
Yes, it succeeds locally. But note that I am building with a different (older) arm-none-eabi toolchain than is recommended. (My bins are actually somewhat bigger) I'm also sitting on a patch to enable lto for nrf52 (didn't actually test the resulting binary yet, and anyway I have the same toolchain concerns when it comes to local testing); it saves nearly 6kB of text so if I let you have that can I use up 2kB of the savings right away? |
|
Also, remember there are still a few shared modules left on the list to try and get in #526. Not trying to shoot this down, just a reminder of the juggling act. 😄 |
|
I'd like to see these renamed to |
|
@tannewt how strict are we about strict subsets? For instance, within ubinascii the function names are a strict subset but I quickly found that CP is more loose with type requirements than CPython3. CP: Python 3.5.3: Similarly for vs |
|
Ideally we'd throw the same error. The goal would be that CircuitPython code will run in CPython just fine. |
|
Okay, let's consider this to be in hold until I can work on making the module more cpython3 compatible. It'll be 2 weeks minimum. |
|
The pull requests for python3 compatibility of binascii are in, the hashlib pull request has just been created. |
|
@jepler Both PRs are in so please update this PR and we'll get it merged in. Thanks! |
These modules would be very handy to have in order to implement a more robust replacement for ampy. It costs around 2KiB of text and no data or bss. 'binascii' has base64 encoding, which can be used to create a fully 8-bit-clean transport above the slightly cooked serial connection of these boards. 'hashlib' is a bit less critical, but I have found it handy to be able to robustly checksum remote files. I see this as only being useful on ports which don't have USB block device support, so atmel-samd doesn't need it. These modules are already on esp8266 so I think nrf52 seems like the only one that needs it.
|
@tannewt updated. However, gentle reminder to consider that I'm competing with #526 on flash space. For @arturo182 I did verify that the compile still completes successfully when building using |
tannewt
left a comment
There was a problem hiding this comment.
If we end up needing the space later we can disable. I don't think we need to lock down the available APIs until 4.0. nRF52 support will be beta/preliminary in 3.0.
These modules would be very handy to have in order to implement a
more robust replacement for ampy. It costs 2192 bytes of text and
no data or bss.
'ubinascii' has base64 encoding, which can be used to create a fully
8-bit-clean transport above the slightly cooked serial connection of
these boards.
'uhashlib' is a bit less critical, but I have found it handy to
be able to robustly checksum remote files.
I see this as only being useful on ports which don't have USB block
device support, so atmel-samd doesn't need it. These modules are
already on esp8266 so I think nrf52832 seems like the only one that
needs it.