Fix CI failure due to bumped dependencies in macos-latest
GitHub runner
#175
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.
🤔 What's changed?
Bumped
node-gyp
to10.0.1
.Provided an explicit error message for installation failure of tree-sitter language bindings; prior to attempting their compilation.
⚡️ What's your motivation?
Fixes #174 - which prevents the pipeline from passing and presents a blocker to release.
Fix Python 3.12 incompatibility
Following macOS 12 (20231029) release of the
macos-latest
GitHub runner, the Python distribution changed to 3.12 - this is incompatible with the version ofnode-gyp
used to compile the tree-sitter language bindings. Specifically, our pinned version uses thedistutils
module which is removed from the standard library 3.12 - which has been discussed on other issues (cucumber/gherkin#40). Our pipelines have failed since this release.The tree-sitter language binding dependencies were previously made optional to support Windows runners (#58) - suppressing the failure as the logs are less verbose. More information on the failure can be revealed by increasing the log verbosity (
-ddd
) and by making the dependency required.As such, the issue is resolved by either pinning Python to 3.9 or updating
node-gyp
to >= v10 - which is compatible with 3.12. The latter has been chosen, as we will need to bump the version in future in any case.Improve developer experience with enhanced error message
By first checking if the tree-sitter language binding module exists before attempting to compile them, it makes it clearer what caused the failure. We do not perform this check at present. This can make failures unclear as we trigger the compilation asynchronously so the module that fails can vary based on which process returns the failure first. With this PR, we will not attempt compilation of a missing module - and will get faster CI feedback.
Developers will see the following:
Module node_modules/tree-sitter-java does not exist. This is likely due to an installation and/or build failure of the module. Please check the logs.
Instead of:
🏷️ What kind of change is this?
📋 Checklist: