Repository navigation
Conversation
build_node_from_src() raised OSError whenever nodeenv ran on Python 3 and no python2 command was on PATH, and otherwise prepended a tmpbin dir that points `python` at python2. node.js has built with Python 3 for years and its ./configure picks python3.x on its own, so drop the shim and let the build use the inherited environment. Fixes ekalinin#419.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #419.
build_node_from_src()still carries the shim from when node.js needed Python 2 to build. On Python 3 it looks uppython2, raisesOSErrorif there isn't one, and otherwise prepends atmpbindir whosepythonpoints at python2. Since nodeenv only runs on Python 3 now,nodeenv --sourcefails on any machine withoutpython2, which is most of them.node.js has built with Python 3 for a long time, and its
./configurepicks an interpreter on its own (python3.x, thenpython3, thenpython). So the shim isn't needed anymore, and when it does find apython2it can actually hurt, because current node rejects Python 2.This removes the shim and runs
configure/make/make installwith the inherited environment. Thesrc_dirparameter stays so the signature doesn't change.Tests:
test_build_node_from_src_does_not_need_python2. It mockscallitwith nopython2on PATH and checks that configure/make/make install run in the node source dir with no PATH override and notmpbindir. It fails on master with theOSErrorfrom the issue and passes with this change.pytest -m 'not integration' tests: 354 passed, 46 skipped.flake8 --extend-ignore=E127 nodeenv.py tests setup.pyis clean.