Skip to content

Conversation

@cwalther
Copy link
Contributor

When MicroPython is used as a submodule and built using make from the containing project, e.g. following the instructions for the embed port, make submodules fails because it goes looking for the sub-sub-module paths in the outer repository instead of in the micropython repository.

This is fixed by the attached commit: invoke git inside the micropython submodule instead of at the outer project level.

(I initially thought that this would affect not just the embed port but also external board definitions, but it turns out it does not, because in the external-board-definition process MicroPython is build by a sub-make that operates inside the MicroPython submodule.)

Steps to reproduce

git init mpembedder
cd mpembedder
git submodule add https://github.com/micropython/micropython.git micropython
cp micropython/examples/embedding/* .
perl -pi -e 's|MICROPYTHON_TOP = ../..|MICROPYTHON_TOP = micropython|' micropython_embed.mk
echo 'require("time")' > manifest.py
make -f micropython_embed.mk FROZEN_MANIFEST=manifest.py submodules

Actual result

Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
Updating submodules: lib/micropython-lib
error: pathspec 'micropython/lib/micropython-lib' did not match any file(s) known to git
make: *** [submodules] Error 1

Expected result

Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
Updating submodules: lib/micropython-lib
Submodule 'lib/micropython-lib' (https://github.com/micropython/micropython-lib.git) registered for path 'lib/micropython-lib'
Cloning into '/Users/cwalther/mpembedder/micropython/lib/micropython-lib'...
Submodule path 'lib/micropython-lib': checked out 'ddb1a279578bfff8c1b18aff3baa668620684f64'

@github-actions
Copy link

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

When MicroPython is used as a submodule and built from the containing
project, e.g. for the embed port, `make submodules` fails because it goes
looking for the sub-sub-module paths in the outer repository instead of in
the micropython repository. Fix this by invoking git inside the micropython
submodule.

Signed-off-by: Christian Walther <cwalther@gmx.ch>
@codecov
Copy link

codecov bot commented Jun 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.39%. Comparing base (a61c446) to head (1a47892).
Report is 226 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #14344   +/-   ##
=======================================
  Coverage   98.39%   98.39%           
=======================================
  Files         161      161           
  Lines       21204    21204           
=======================================
  Hits        20864    20864           
  Misses        340      340           

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

@dpgeorge dpgeorge added the py-core Relates to py/ directory in source label Aug 26, 2024
@dpgeorge dpgeorge merged commit 0b7f6e1 into micropython:master Aug 26, 2024
@dpgeorge
Copy link
Member

Thanks, this change looks OK. The CI passes and that uses make submodules a lot, so that's a good check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

py-core Relates to py/ directory in source

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants