Skip to content

build_mp.py can't fetch MicroPython when the pin is a commit SHA #114

Closed

Description

@bdbarnett

When MicroPython isn't checked out yet, build_mp.py fetches it with

git clone --depth 1 --branch <UPSTREAM> https://github.com/micropython/micropython

(build_mp.py line 178). --branch takes a branch or tag name, not a commit, so when UPSTREAM pins a commit SHA (as it does when the pin is on MicroPython's main between releases) the clone fails and a fresh checkout can't build.

To fix: when UPSTREAM is a 40-character SHA, clone without --branch (or git init + git fetch --depth 1 origin <sha> + git checkout FETCH_HEAD, which GitHub serves for a full SHA), and keep --branch for tags.

Activity

  1. bdbarnett commented on Oct 19, 2026

    @bdbarnett
    ContributorAuthor

    Fixed in d34933a (merged in #115): build_mp.py now fetches MicroPython with clone_at(), which takes a full 40-character commit as well as a tag.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions