python_selector checks if found python command is valid#275
Merged
kripken merged 1 commit intoemscripten-core:masterfrom Jun 13, 2019
Merged
Conversation
kripken
reviewed
Jun 13, 2019
Member
|
And thanks @trzecieu for the quick fix! |
Collaborator
|
I think if you put something called This seems like a bug in pyenv that we shouldn't have to deal with here. I mean what if I symlink |
vargaz
pushed a commit
to vargaz/emsdk
that referenced
this pull request
Nov 22, 2023
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.
Addresses emscripten-core/emscripten#8792
I've found what's the reason of the strange behaviour of last changes (#273).
In order to reproduce this problem it's needed:
pyenvwith installed at least one version from each family, like:Then we have a strange situation that
python3is available as a command, but it's just a mock forpyenv:As you see in an example above I didn't even call
emsdkscript, just tried to executepython3 --versionand I've got exactly the same error. The problem of pyenv is that even if python3 isn't active it's available in the system PATH.Calling
./emsdk --helpget's the same error, aspython3was used.At the moment this entirely breaks logic in
python_selectorand in pyenv working command is indistinguishable from stub python command.@kripken: A couple of ways to go from here:
python_selectorby checking if found python command is valid (for the instance by callingpython --version), this will filter out false positive matches that coming frompyenvAfter patch:
As you can see
python3 --versioncommand fails as it was, but that's expected behaviour. What's important is that./emsdk --helpgets executed aspython_selectorrecognizes a stub.