Skip to content

Conversation

dpgeorge
Copy link
Member

@dpgeorge dpgeorge commented Feb 8, 2024

This PR changes how library packages are searched for when a manifest file is loaded: there is now simply a list of library paths that is searched in order for the given package. This list defaults to the main directories in micropython-lib, but can be added to -- either appended or prepended -- by using add_library().

In particular the way unix-ffi library packages are searched has changed, because the unix_ffi argument to require() is now removed. Instead, if a build wants to include packages from micropython-lib/unix-ffi, then it must explicitly add this to the list of paths to search using:

    add_library("unix-ffi", "$(MPY_LIB_DIR)/unix-ffi")

Work done in collaboration with Jim Mussared.

@dpgeorge dpgeorge added the tools Relates to tools/ directory in source, or other tooling label Feb 8, 2024
@dpgeorge
Copy link
Member Author

dpgeorge commented Feb 8, 2024

Tested by adding require("glob") to the unix manifest.py. It now works (previously did not).

Should fix micropython/micropython-lib#672 and micropython/micropython-lib#795

Copy link

codecov bot commented Feb 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (2bdaa1b) 98.36% compared to head (8cbae12) 98.36%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #13620   +/-   ##
=======================================
  Coverage   98.36%   98.36%           
=======================================
  Files         159      159           
  Lines       21069    21069           
=======================================
  Hits        20724    20724           
  Misses        345      345           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

This commit changes how library packages are searched for when a manifest
file is loaded: there is now simply a list of library paths that is
searched in order for the given package.  This list defaults to the
main directories in micropython-lib, but can be added to -- either appended
or prepended -- by using `add_library()`.

In particular the way unix-ffi library packages are searched has changed,
because the `unix_ffi` argument to `require()` is now removed.  Instead, if
a build wants to include packages from micropython-lib/unix-ffi, then it
must explicitly add this to the list of paths to search using:

    add_library("unix-ffi", "$(MPY_LIB_DIR)/unix-ffi")

Work done in collaboration with Jim Mussared.

Signed-off-by: Damien George <damien@micropython.org>
Signed-off-by: Damien George <damien@micropython.org>
@dpgeorge dpgeorge force-pushed the tools-manifestfile-change-unix-ffi-to-custom-library branch from 34ba6b5 to 8cbae12 Compare February 8, 2024 06:16
Copy link

github-actions bot commented Feb 8, 2024

Code size report:

   bare-arm:    +0 +0.000% 
minimal x86:    +0 +0.000% 
   unix x64:    +0 +0.000% standard
      stm32:    +0 +0.000% PYBV10
     mimxrt:    +0 +0.000% TEENSY40
        rp2:    +0 +0.000% RPI_PICO
       samd:    +0 +0.000% ADAFRUIT_ITSYBITSY_M4_EXPRESS

@dpgeorge dpgeorge merged commit 8cbae12 into micropython:master Feb 8, 2024
@dpgeorge dpgeorge deleted the tools-manifestfile-change-unix-ffi-to-custom-library branch February 9, 2024 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tools Relates to tools/ directory in source, or other tooling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant