Pin Python to 3.11 to work around zui/2882 #2883
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.
#2882 (comment) has background.
At first I tried the workaround
python3 -m pip install packaging
that's discussed most frequently at nodejs/node-gyp#2869. My first Dev build with that workaround came out fine on macOS. I then thought it'd be good to add a comment in the Actions YAML mentioning it's a workaround for this issue. Out of pure paranoia, I made yet another Dev build and that one failed with the sameNo module named 'distutils'
on macOS that started this all. I can't explain what was going on there since the run log shows it successfully running thepython3 -m pip install packaging
just like in the prior working build. 🤷♂️Rather than try to understand if that workaround was somehow unreliable, I peeked at some of the other links in nodejs/node-gyp#2869 where people work around the problem in their own projects. I saw someone doing something that I now realize makes more sense and is what I'm doing in this PR: Pinning the Python version to 3.11. With my paranoia in full effect, I made three test builds this time (1, 2, 3). None of them showed the
No module named 'distutils'
failure, so that seems to indicate the workaround of using Python 3.11 is effective as we'd hope. However, the second of the three builds happened to fail with the separate symptomFetchError: request to https://www.electronjs.org/headers/v22.3.25/SHASUMS256.txt failed, reason: read ECONNRESET
that I'd previously only seen on Linux as mentioned in #2882 (comment).Conclusion: It seems like it must be down to particularly bad luck, but I've shown this all to @jameskerr and we are in agreement that it looks like we've been plagued by two separate problems that both happen to affect this
node-pipe
dependency. We've actually known about exposure here for 3+ years (#1165) but it's only just now been biting us in a big way. @jameskerr is looking at a fix for the general problem of making sure the overall build fails ifnode-pipe
doesn't build successfully on macOS and Linux. In the meantime, this PR should address the problem that was always causingnode-pipe
to not build on macOS due when the GitHub Actions runners started using Python 3.12 by default.