-
Notifications
You must be signed in to change notification settings - Fork 2
Update to use pre compiled mpy-cross binaries #19
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
base: main
Are you sure you want to change the base?
Conversation
Changed from fetch-submodules to fetch-all-submodules. The error message "No rule to make target 'fetch-submodules'. Stop." might be resolved by using the correct make targets. Here are some relevant findings from the adafruit/circuitpython repository: Makefile Targets: fetch-translate-submodules: Fetches submodules for translation. fetch-all-submodules: Fetches submodules for all ports. Relevant Issues: Issue #9301: Discusses issues with submodule fetching in CI actions. Issue #9552: Details on setup documentation and fetching submodules for the Espressif build environment. Issue #8027: Provides information on issues related to building with submodules. To resolve the issue, you can try running: make fetch-all-submodules For more details on related issues, you can view the full list of discussions here.
Not sure if there is a better way or maybe not include a default version, the default version could get outdated pretty quickly and require frequent changes. Any thoughts or preferences? I guess based on the change frequency I would lean no default and the user having to specify the version. |
Hi! Sorry this slipped by me, let me take a look over the next couple days and get back to you! |
Sounds good.. I do use a copy of the checked in code on my other projects and its seems to be working.
My only note is I might consider removing the default version and leave that to the user to be in charge since the version of CP moves pretty quick.
…________________________________
From: Alec Delaney ***@***.***>
Sent: Monday, March 10, 2025 2:00 PM
To: adafruit/build-mpy ***@***.***>
Cc: Jason Jackson ***@***.***>; Author ***@***.***>
Subject: Re: [adafruit/build-mpy] Update to use pre compiled mpy-cross binaries (PR #19)
Hi! Sorry this slipped by me, let me take a look over the next couple days and get back to you!
—
Reply to this email directly, view it on GitHub<#19 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAN7MKZEHR5PZK7CYJIAN732TXOM5AVCNFSM6AAAAABXEZJO76VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMJRGQYDMMZXHA>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
[tekktrik]tekktrik left a comment (adafruit/build-mpy#19)<#19 (comment)>
Hi! Sorry this slipped by me, let me take a look over the next couple days and get back to you!
—
Reply to this email directly, view it on GitHub<#19 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAN7MKZEHR5PZK7CYJIAN732TXOM5AVCNFSM6AAAAABXEZJO76VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMJRGQYDMMZXHA>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am so sorry for the late review. I really like this idea of using the pre-comipled binary. I think there are a couple of API-like changes I'd want to keep retained, but on the whole this is a great change! Let me know if you're still able to work on this, or I can take it from here if you've unfortunately had to move on.
README.rst
Outdated
@@ -20,9 +20,8 @@ Inputs | |||
Argument Name Description Default Notes | |||
======================= ===================================================================== ==================== ===================================================================== | |||
github-token Your GitHub token N/A N/A | |||
circuitpy-tag The version of CircuitPython to compile for N/A You can use any valid tag (or branch) from ``adafruit/circuitpython`` | |||
mpy-cross-version The version of mpy-cross to download and use 9.2.4 You can specify any version from ``https://adafruit-circuit-python.s3.amazonaws.com/index.html?prefix=bin/mpy-cross/linux-amd64`` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this might be a little overwhelming and translates to the same effect as the CircuitPython version. I think this name and description should remain as is, so it's easier for people to understand exactly which version they should be selecting. In that case, changing it to circuitpy-version
would also be appropriate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree this makes it more user friendly.
action.yml
Outdated
cd ${{ inputs.circuitpython-repo-name }}/mpy-cross | ||
make clean | ||
make | ||
mkdir mpy-cross |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having the escape hatch of the folder name being customizable is nice in the VERY rare event it conflicts with something in the user's repository. I'd keep this functionality included, though I'd rename it to something more appropriate if we're downloading the pre-compiled binary. Altertnatively, you could just place it in the root folder, in which case I agree the escape hatch isn't needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added this option.
README.rst
Outdated
files should or should not be compiled and/or zipped. For example, if you wanted to compile and zip | ||
files in a folder named ``microcontroller`` and you wanted to use a manifest file named ``mpy_manifest.txt`` | ||
to specify certain files NOT to compile, you could modify the script above to be: | ||
files should or should not be compiled and/or zipped as well as the ability to specify a different mpy-cross |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just missing a period at the end of the sentence. I would also make this refer to the version of CircuitPython instead of specifically to the mpy-cross
version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated as well as fixed some other typo's.
I can gladly look over your suggestions this weekend and make changes or ask questions after I review them.
________________________________
From: Alec Delaney ***@***.***>
Sent: Thursday, May 22, 2025 8:29 PM
To: adafruit/build-mpy ***@***.***>
Cc: Jason Jackson ***@***.***>; Author ***@***.***>
Subject: Re: [adafruit/build-mpy] Update to use pre compiled mpy-cross binaries (PR #19)
@tekktrik requested changes on this pull request.
I am so sorry for the late review. I really like this idea of using the pre-comipled binary. I think there are a couple of API-like changes I'd want to keep retained, but on the whole this is a great change! Let me know if you're still able to work on this, or I can take it from here if you've unfortunately had to move on.
________________________________
In README.rst<#19 (comment)>:
@@ -20,9 +20,8 @@ Inputs
Argument Name Description Default Notes
======================= ===================================================================== ==================== =====================================================================
github-token Your GitHub token N/A N/A
-circuitpy-tag The version of CircuitPython to compile for N/A You can use any valid tag (or branch) from ``adafruit/circuitpython``
+mpy-cross-version The version of mpy-cross to download and use 9.2.4 You can specify any version from ``https://adafruit-circuit-python.s3.amazonaws.com/index.html?prefix=bin/mpy-cross/linux-amd64``
I think this might be a little overwhelming and translates to the same effect as the CircuitPython version. I think this name and description should remain as is, so it's easier for people to understand exactly which version they should be selecting. In that case, changing it to circuitpy-version would also be appropriate.
________________________________
In action.yml<#19 (comment)>:
shell: bash
run: |
- cd ${{ inputs.circuitpython-repo-name }}/mpy-cross
- make clean
- make
+ mkdir mpy-cross
Having the escape hatch of the folder name being customizable is nice in the VERY rare event it conflicts with something in the user's repository. I'd keep this functionality included, though I'd rename it to something more appropriate if we're downloading the pre-compiled binary. Altertnatively, you could just place it in the root folder, in which case I agree the escape hatch isn't needed.
________________________________
In README.rst<#19 (comment)>:
You also have granular control of which directories to compile and zip and the ability to specify which
-files should or should not be compiled and/or zipped. For example, if you wanted to compile and zip
-files in a folder named ``microcontroller`` and you wanted to use a manifest file named ``mpy_manifest.txt``
-to specify certain files NOT to compile, you could modify the script above to be:
+files should or should not be compiled and/or zipped as well as the ability to specify a different mpy-cross
This is just missing a period at the end of the sentence. I would also make this refer to the version of CircuitPython instead of specifically to the mpy-cross version.
—
Reply to this email directly, view it on GitHub<#19 (review)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAN7MK7BFPT2BNVF64BTPUT27ZTVFAVCNFSM6AAAAABXEZJO76VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDMNZRHAZTSMZSHE>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Hi! Just checking in to see if you're still working on this. I'm happy to build off of what you've submitted otherwise. |
Yes I am still planning on doing this just been awash in a few other higher priorities. I am hopeful to take care of it in the next two weekends though
…________________________________
From: Alec Delaney ***@***.***>
Sent: Thursday, August 7, 2025 2:51 PM
To: adafruit/build-mpy ***@***.***>
Cc: Jason Jackson ***@***.***>; Author ***@***.***>
Subject: Re: [adafruit/build-mpy] Update to use pre compiled mpy-cross binaries (PR #19)
[https://avatars.githubusercontent.com/u/89490472?s=20&v=4]tekktrik left a comment (adafruit/build-mpy#19)<#19 (comment)>
Hi! Just checking in to see if you're still working on this. I'm happy to build off of what you've submitted otherwise.
—
Reply to this email directly, view it on GitHub<#19 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAN7MK6JBJR67TWIZUKFFUD3MON2DAVCNFSM6AAAAABXEZJO76VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTCNRVGM3DEMBSGU>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the build-mpy action to use pre-compiled mpy-cross binaries instead of building from source. The change addresses issues with the previous approach that stopped working and improves the build process by downloading pre-compiled binaries from Adafruit's S3 bucket.
Key changes include:
- Replaced CircuitPython source compilation with pre-compiled binary download
- Updated input parameter names for better clarity
- Corrected spelling errors in documentation and comments
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
action.yml | Replaced CircuitPython repo cloning and compilation with direct mpy-cross binary download, updated input parameters |
README.rst | Updated documentation to reflect new parameter names and usage examples |
.pre-commit-config.yaml | Updated pre-commit hook versions |
.github/workflows/build.yml | Updated GitHub Actions versions |
description: > | ||
The type of manifest to use for compiling if one is provided. The | ||
default is "include", but if "exclude" is provided, then all Python | ||
files EXCEPT the ones listed will be compiled with CircuitPython. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error message is incorrect. Files are compiled with mpy-cross, not 'with CircuitPython'. Should be 'will be compiled with mpy-cross.'
Copilot uses AI. Check for mistakes.
action.yml
Outdated
mkdir ${{ inputs.compiler-directory }} | ||
cd ${{ inputs.compiler-directory }} | ||
wget -O mpy-cross https://adafruit-circuit-python.s3.amazonaws.com/bin/mpy-cross/mpy-cross.static-amd64-linux-${{ inputs.circuitpy-version }} | ||
chmod +x mpy-cross |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The wget command lacks error handling. If the download fails (e.g., invalid version or network issues), the action will continue and fail later with unclear errors. Consider adding error checking or using curl with fail options.
chmod +x mpy-cross | |
wget -O mpy-cross https://adafruit-circuit-python.s3.amazonaws.com/bin/mpy-cross/mpy-cross.static-amd64-linux-${{ inputs.circuitpy-version }} || { echo "Error: Failed to download mpy-cross for version ${{ inputs.circuitpy-version }}"; exit 1; } | |
chmod +x mpy-cross |
Copilot uses AI. Check for mistakes.
as ZIP files. Files other than ``.mpy`` and ``.py`` files will be added to the ZIP file as well. Note that | ||
any files named or ``code.py`` are automatically not compiled for convenience. | ||
as ZIP files. Files other than ``.mpy`` and ``.py`` files will be added to the ZIP file as well. Note that | ||
``code.py`` and any files excluded via the `mpy-manifest-file` are not compiled. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The backticks around 'mpy-manifest-file' are inconsistent with the rest of the documentation which uses double backticks for code elements. Should be mpy-manifest-file
to match the style.
``code.py`` and any files excluded via the `mpy-manifest-file` are not compiled. | |
``code.py`` and any files excluded via the ``mpy-manifest-file`` are not compiled. |
Copilot uses AI. Check for mistakes.
…cover when things to sideways.
build-mpy stopped working and compiling the CircutPython version so I made the changes indicated in #17. I removed the CircuitPython checkout and replaced it with pulling the default (current 8.0.5) version of mpy-cross. I also added the ability to specify a specific version of mpy-cross.