circuitpython/ports
Damien George d2384efa80 py: Automatically provide weak links from "foo" to "ufoo" module name.
This commit implements automatic module weak links for all built-in
modules, by searching for "ufoo" in the built-in module list if "foo"
cannot be found.  This means that all modules named "ufoo" are always
available as "foo".  Also, a port can no longer add any other weak links,
which makes strict the definition of a weak link.

It saves some code size (about 100-200 bytes) on ports that previously had
lots of weak links.

Some changes from the previous behaviour:
- It doesn't intern the non-u module names (eg "foo" is not interned),
  which saves code size, but will mean that "import foo" creates a new qstr
  (namely "foo") in RAM (unless the importing module is frozen).
- help('modules') no longer lists non-u module names, only the u-variants;
  this reduces duplication in the help listing.

Weak links are effectively the same as having a set of symbolic links on
the filesystem that is searched last.  So an "import foo" will search
built-in modules first, then all paths in sys.path, then weak links last,
importing "ufoo" if it exists.  Thus a file called "foo.py" somewhere in
sys.path will still have precedence over the weak link of "foo" to "ufoo".

See issues: #1740, #4449, #5229, #5241.
2019-10-22 15:30:52 +11:00
..
bare-arm bare-arm, minimal: Set CSUPEROPT=-Os to get minimal firmware size. 2019-09-17 11:43:52 +10:00
cc3200 py: Automatically provide weak links from "foo" to "ufoo" module name. 2019-10-22 15:30:52 +11:00
esp32 py: Automatically provide weak links from "foo" to "ufoo" module name. 2019-10-22 15:30:52 +11:00
esp8266 py: Automatically provide weak links from "foo" to "ufoo" module name. 2019-10-22 15:30:52 +11:00
javascript py: Automatically provide weak links from "foo" to "ufoo" module name. 2019-10-22 15:30:52 +11:00
minimal minimal/frozentest.mpy: Recompile now that mpy format changed. 2019-10-15 16:58:58 +11:00
nrf py: Automatically provide weak links from "foo" to "ufoo" module name. 2019-10-22 15:30:52 +11:00
pic16bit ports: Provide mp_hal_stdio_poll for sys.stdio polling where needed. 2019-07-01 17:10:12 +10:00
qemu-arm qemu-arm: Convert to use FROZEN_MANIFEST to specify frozen code. 2019-10-15 21:36:55 +11:00
samd ports: Add new make target "submodules" which inits required modules. 2019-10-15 17:14:41 +11:00
stm32 py: Automatically provide weak links from "foo" to "ufoo" module name. 2019-10-22 15:30:52 +11:00
teensy ports: Provide mp_hal_stdio_poll for sys.stdio polling where needed. 2019-07-01 17:10:12 +10:00
unix unix: Allow building without a manifest. 2019-10-21 23:21:18 +11:00
windows mpy-cross,windows: Add msvc build of mpy-cross. 2019-09-18 22:16:36 +10:00
zephyr py: Automatically provide weak links from "foo" to "ufoo" module name. 2019-10-22 15:30:52 +11:00