-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Must reconsider gyp usage due to Python 2.0 deprecation in 2020 #207
Comments
Don't stop believin': https://bugs.chromium.org/p/gyp/issues/detail?id=36#c44 |
Oh cool! Although I was more interested in moving to ninja plus the native node gyp (I don't mean node-gyp) approach. |
No updates regarding gyp for Python 3.0. We all are gonna die. |
As commented here:
So there is hope :) |
We all are gonna die. |
Wow! now we have two GYP projects both compatible with Python 3!
However in both cases the commiter is Dirk Pranke... so I don't what to do. @saghul do you know anything else? |
Ok, so I've installed master versions of both projects (the original one and the Node fork one) and run the
I've also checked the configure.py script of the Nodejs project, which "seems" to be Python 3 (due to @saghul do you remember if you owe me any favor? |
@ibc Do you have the py3 gyp update in a branch? I'll give it a go. The print() syntax can also be used in Python 2, so slight tweaks might be needed to your configure file. I can take a look. |
Yes! Just do this:
$ PYTHON=python2 make
$ PYTHON=/usr/local/garbage-stuff/python3 make If you, for any reason, wanna try with the Node gyp fork (which miserably fails for me as shown above) just let me know. It's just about changing the corresponding repo in THANKS. |
I think some more stuff is needed. With this change it starts to work:
But then fails to detect Xcode / CLT:
I'll take another look later. |
Same here. It seems that $ pkgutil --pkg-info=com.apple.pkg.DeveloperToolsCLI
No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'. Installing/updating "Xcode components" to check it again. No, nothing. |
I checked again. It's the same bytes / str problem inside some gyp checks. I don't think it's Python 3 ready yet. |
Thanks. I've commented it in the gyp tracker: https://bugs.chromium.org/p/gyp/issues/detail?id=36#c58 Let's see how it evolves. We have time. Some weeks ago I thought we were to die and today it was almost fixed. Thanks! :) |
BTW, I've open a Python2 console and replicated similar code to the one in $ python
Python 2.7.10 (default, Aug 17 2018, 17:41:52)
[GCC 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.0.42)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import re
>>> import subprocess
>>> import sys
>>> STANDALONE_PKG_ID = "com.apple.pkg.DeveloperToolsCLILeo"
>>> cmdlist = ['/usr/sbin/pkgutil', '--pkg-info', STANDALONE_PKG_ID]
>>> job = subprocess.Popen(cmdlist, stdout=subprocess.PIPE)
>>> No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'. So, it looks like the same error that happens when running the emediasoup |
No, that's not the actual error. Your system doesn't have that package, that's the old name. The new names are |
With this patch compilation begins:
I have only tested it 10s on macOS though. |
Oh! So, to clarify: you are making changes into |
Correct. |
BTW confirmed that with your changes it works in both Python 2 and 3! Ok, I'll comment that bug in https://bugs.chromium.org/p/gyp/issues/detail?id=36#c58 |
Done. Thanks, this is amazing! |
However gyp is not yet ready (see #207 (comment)).
Note that gyp source code has been manually modified within the worker/deps/gyp folder (credits to @saghul)
mediasoup 3.0.12 already supports Python 3: acf9417 However, tote that gyp source code has been manually modified (and the above path by @saghul gyp issue current status: the issue is still present. I've added a summary comment: https://bugs.chromium.org/p/gyp/issues/detail?id=36#c65 |
🎉 |
Finally @saghul's path has been merged in gyp master branch:
So we are done :) |
@saghul, there is a guy with this gyp error that I think may be related to Python 3 and some missing change. Basically this:
The libtoolout = subprocess.Popen(cmd_list, stderr=subprocess.PIPE, env=env)
_, err = libtoolout.communicate()
for line in err.splitlines():
if not libtool_re.match(line) and not libtool_re5.match(line): # <--- line 274
print(line, file=sys.stderr) The are also other similar lines: if ibtool_section_re.match(line):
elif not ibtool_re.match(line): The environment is:
Any magic to do here that you may identify? |
As suggested in the thread, I've tried experimenting with make. Since line returns a byte object, decoding it first actually resolves my issue with make. Decoding is necessary for Python 3. for line in err.splitlines():
decoded_line = line.decode("utf-8")
if not libtool_re.match(decoded_line) and not libtool_re5.match(decoded_line):
print(decoded_line, file=sys.stderr) |
By the way, I've uploaded my change to gyp to make it more compatible with Python 3 |
Thanks @philipnery, good work. |
This is a commit made by @philipnery in the gyp project: https://chromium-review.googlesource.com/c/external/gyp/+/1639564 Let's consider #207 fixed
gyp dependency in mediasoup v3 has been updated to master, so let's consider this issue fixed. Thanks @philipnery! |
Nobody is gonna add Python 3 support to gyp, so we are dead in 2020:
https://bugs.chromium.org/p/gyp/issues/detail?id=36
@saghul may you run away from ancient programming languages for a while and let's know your thoughts about this?
The text was updated successfully, but these errors were encountered: