Skip to content

Improve local builds #3

@sfe-SparkFro

Description

@sfe-SparkFro

Description

Currently, doing a local build modifies several files:

$ git status
On branch release/v1.27.0
Your branch is up to date with 'origin/release/v1.27.0'.

nothing to commit, working tree clean
$ source sparkfun_build.sh && build_sparkfun -o sparkfun_release -p "MICROPYTHON_" -q qwiic_lib
... # Build output
$ git status
On branch release/v1.27.0
Your branch is up to date with 'origin/release/v1.27.0'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   ports/esp32/boards/SPARKFUN_IOT_REDBOARD_ESP32/manifest.py
        modified:   ports/esp32/modules/_boot.py
        modified:   ports/mimxrt/boards/TEENSY40/mpconfigboard.mk
        modified:   ports/mimxrt/boards/TEENSY41/manifest.py
        modified:   ports/mimxrt/modules/_boot.py
        modified:   ports/rp2/boards/SPARKFUN_IOTNODE_LORAWAN_RP2350/manifest.py
        modified:   ports/rp2/boards/SPARKFUN_IOTREDBOARD_RP2350/manifest.py
        modified:   ports/rp2/boards/SPARKFUN_PROMICRO/mpconfigboard.cmake
        modified:   ports/rp2/boards/SPARKFUN_PROMICRO_RP2350/mpconfigboard.cmake
        modified:   ports/rp2/boards/SPARKFUN_THINGPLUS/mpconfigboard.cmake
        modified:   ports/rp2/boards/SPARKFUN_THINGPLUS_RP2350/manifest.py
        modified:   ports/rp2/boards/SPARKFUN_XRP_CONTROLLER/manifest.py
        modified:   ports/rp2/boards/SPARKFUN_XRP_CONTROLLER_BETA/manifest.py
        modified:   ports/rp2/modules/_boot.py
        modified:   sparkfun_build.sh

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        _frozen_data/
        ports/mimxrt/boards/TEENSY40/manifest.py
        ports/rp2/boards/SPARKFUN_PROMICRO/manifest.py
        ports/rp2/boards/SPARKFUN_PROMICRO_RP2350/manifest.py
        ports/rp2/boards/SPARKFUN_THINGPLUS/manifest.py
        pylibs.zip
        qwiic-py-py-2.0.1/
        qwiic_lib/

no changes added to commit (use "git add" and/or "git commit -a")

The .py and .cmake files are appended to, so running the build script repeatedly causes problems because the same line of code is repeatedly appended. So the changes have to be manually reverted between each build, which is especially annoying when there are other changes being worked on.

The untracked files in the root directory can be fixed with the solution proposed in #2 (move them to a /build/ directory). For the modified manifest files, those can likely be resolved by creating a new manifest file (like done for Red Vision), then setting FROZEN_MANIFEST with the new -f option in sparkfun_build.sh. For the _boot.py modifications, we could create a boot.py file (like done for Red Vision) and freeze it into the firmware, or possibly leverage micropython#18424.

Would prefer to avoid a solution where the build script modifies then un-modifies files, as that's pretty obscure.

Code Size

No response

Implementation

I intend to implement this feature and would submit a Pull Request if desirable

Code of Conduct

Yes, I agree

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions