Pin Python version at 3.11 in build workflow #67
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Python 3.12.x is incompatible with the version of the node-gyp dependency used by this project (
9.4.0
) (nodejs/node-gyp#2869). Previously, the workflow used whichever version of Python was pre-installed on the GitHub Actions runner machine. The Python version was recently updated from 3.11.5 to 3.12.0 in the macOS runner, which caused the workflow to start failing:https://github.com/arduino/lab-micropython-editor/actions/runs/7087599689/job/19288228020#step:4:211
The incompatibility has been fixed in node-gyp (nodejs/node-gyp#2923) and released in version 10.0.0, but it is not trivial to update node-gyp because it is a transitive dependency of the direct electron-rebuild dependency, which specifies node-gyp@^9.0.0.
For this reason, the chosen solution is to configure the "GitHub Actions" workflow to use the compatible Python
3.11.x
.At such time as a new version of electron-rebuild is released that indicates compatibility with
node-gyp@^10.0.0
(electron/rebuild#1116) and the project's dependencies are updated, pinning to Python3.11.x
specifically will no longer be needed. However, it will likely be best practices to leave this actions/setup-python step in the workflow even after that since it allows the version of Python used for the build to be controlled by the project maintainers, and for consistency across all the runner machines (at this time, the preinstalled version on the Linux machine is3.10.12
and the Windows machine3.7.9
).This fix has already been in use for some time in the
arduino/arduino-ide
repository, which suffered the same breakage: arduino/arduino-ide@97b0bc0