Skip to content
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

Should depend on python2 #33

Closed
ibc opened this issue Sep 10, 2016 · 11 comments
Closed

Should depend on python2 #33

ibc opened this issue Sep 10, 2016 · 11 comments

Comments

@ibc
Copy link
Member

ibc commented Sep 10, 2016

@saghul should this configure.py require python2?:

https://github.com/ibc/mediasoup/blob/master/worker/scripts/configure.py#L1

@saghul
Copy link
Contributor

saghul commented Sep 12, 2016

Yes. GYP is Python 2 only.

@notedit
Copy link

notedit commented Sep 12, 2016

there is no python2 on mac , i change that to python makes it work.

@saghul
Copy link
Contributor

saghul commented Sep 12, 2016

That's a problem, yeah. Not all platforms work with that shebang. I'd leave it as "python" and perform a runtime check:

if sys.version_info[0] != 2:
    raise RuntimeError('Python 2 is required')

@ibc
Copy link
Member Author

ibc commented Sep 12, 2016

My /usr/bin/python in OSX has version "2.7.10". However there is no /usr/bin/python2 but /usr/bin/python2.7, so I cannot rely on env python2.

Also, when installing via brew install python it installs "2.7.11" and places both python and python2 in /usr/local/bin/, both are links that point to links that finally point to /usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/bin/python2.7.

In Debian 8.3 it happens the very same.

So I would replace #!/usr/bin/env python2 with #!/usr/bin/env python in configure.py, but that would fail if env python points to Python3, right @saghul?

Please, note that such a script is directly invoked from a make command when executing the main Makefile.

@ibc
Copy link
Member Author

ibc commented Sep 12, 2016

It seems that this could also work, but requires an extra step that I don't like:

$ npm config set python /usr/bin/python2.7  // or whatever

@ibc
Copy link
Member Author

ibc commented Sep 12, 2016

@saghul, will you send a PR soon regarding gyp.js?

@saghul
Copy link
Contributor

saghul commented Sep 12, 2016

So I would replace #!/usr/bin/env python2 with #!/usr/bin/env python in configure.py, but that would fail if env python points to Python3, right @saghul?

Correct. One such system is Arch Linux or the latest Ubuntu.

@saghul
Copy link
Contributor

saghul commented Sep 12, 2016

will you send a PR soon regarding gyp.js?

Not anytime soon, I'm afraid :-S Sorry!

@ibc
Copy link
Member Author

ibc commented Sep 12, 2016

I want my money back!

@notedit
Copy link

notedit commented Sep 13, 2016

i think this will work well


That's a problem, yeah. Not all platforms work with that shebang. I'd leave it as "python" and perform a runtime check:

if sys.version_info[0] != 2:
    raise RuntimeError('Python 2 is required')

@ibc
Copy link
Member Author

ibc commented Sep 14, 2016

One problem I see is:

The host has both python2 and python3, and env python points to python2. Then #!/usr/bin/env python would just fail.

In the other side, in a fresh OSX (no brew installed) python2 is installed by default, it provides /usr/bin/python but it does not provide /usr/bin/python2...

@ibc ibc closed this as completed in 2c28984 Oct 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants