Skip to content
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

Fix 'make submodules' when building out-of-tree #14344

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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'

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>
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 11 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant