-
Notifications
You must be signed in to change notification settings - Fork 1k
upip: Support for baremetal systems #105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'd say that the top-level function name and signature should closely reflect what you type on the cmd-line. What you propose is perfect.
That's how the cmd-line version works, so +1 agin.
Did you check that 4k dict gives decent compression? Maybe 2k would suffice? Or maybe we need 8k? Would be interesting to run some tests to see. It looks like standard gzip doesn't allow to specify the dict size, so we'd need to write a Python gzip.py that does it. |
Yes, 4K dictionary already visibly deteriorates compression ratio (e.g. 2456 bytes vs 1952 bytes normal gzip). 8K would be better, but that's gigantic continuous block of memory for esp8266 heap. With 4K for zlib dictionary, 4K for TLS record buffer, 0.5K copy buffer(s), and ~4K to read in JSON metadata (micropython/micropython#2489), it already barely works (like, 50% chance of memory failure - that's after sprinkling gc.collect()'s around). |
I already have that, and due to the way setuptools works, it should be a setuptools plugin, not just a standalone script. Next big "it won't work" risk is TLS buffer - that's got to be 16K, or if less (like 4K), won't accommodate a file bigger than that. So, I'm thinking about minimizing e.g. setup.py, then removing all the cruft from .tar.gz, then switching to more frugal file format, e.g. .cpio, if not completely custom format. |
I'm also applying following simplification: currently upip parses MICROPYPATH envvar, but micropython itself have already parsed that. If MICROPYPATH is not available, upip falls back to sys.path[1], and micropython have already set that based on MICROPYPATH. So, I'm just going to use sys.path[1]. |
Support has been implemented, initial version is available with esp8266 1.8.5 release. |
I've already done bunch of changes towards supporting baremetal systems. More things to discuss/do:
upip.install(package_name_or_list, path=None)
.path
above is None, it will be deduced, specifically sys.path[1] taken for baremetal system (/lib
for esp8266 e.g., others should be updated to have preferred-to-install path as sys.path[1]).@dpgeorge , let's discuss.
The text was updated successfully, but these errors were encountered: