Skip to content

update workflow to fix build issues #70

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

Merged
merged 2 commits into from
Jan 7, 2024
Merged

Conversation

ubidefeo
Copy link
Collaborator

@ubidefeo ubidefeo commented Jan 7, 2024

No description provided.

Python 3.12.x is incompatible with the version of the node-gyp dependency used by this project (9.4.0). 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:

```
> electron-rebuild

- Searching dependency tree
Traceback (most recent call last):
  File "/Users/runner/work/lab-micropython-editor/lab-micropython-editor/node_modules/node-gyp/gyp/gyp_main.py", line 42, in <module>
    import gyp  # noqa: E402
    ^^^^^^^^^^
  File "/Users/runner/work/lab-micropython-editor/lab-micropython-editor/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 9, in <module>
    import gyp.input
  File "/Users/runner/work/lab-micropython-editor/lab-micropython-editor/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 19, in <module>
    from distutils.version import StrictVersion
ModuleNotFoundError: No module named 'distutils'
✖ Rebuild Failed

An unhandled error occurred inside electron-rebuild
node-gyp failed to rebuild '/Users/runner/work/lab-micropython-editor/lab-micropython-editor/node_modules/@serialport/bindings-cpp'.
For more information, rerun with the DEBUG environment variable set to "electron-rebuild".

Error: `gyp` failed with exit code: 1
```

The incompatibility has been fixed in node-gyp 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 and the
project's dependencies are updated, pinning to Python 3.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 is 3.10.12 and the Windows machine 3.7.9).
Pin Python version at 3.11 in build workflow
Copy link
Collaborator Author

@ubidefeo ubidefeo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix from main

@ubidefeo ubidefeo merged commit 0c44315 into feature/tabs-and-file-manager Jan 7, 2024
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.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy