I tried to build www/node from quaterly branch but it ends up with the following python error: LD_LIBRARY_PATH=/wrkdirs/usr/ports/www/node/work/node-v14.4.0/out/Release/lib.host:/wrkdirs/usr/ports/www/node/work/node-v14.4.0/out/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../.; mkdir -p /wrkdirs/usr/ports/www/node/work/node-v14.4.0/out/Release/obj/gen; tools/genv8constants.py "/wrkdirs/usr/ports/www/node/work/node-v14.4.0/out/Release/obj/gen/v8constants.h" "/wrkdirs/usr/ports/www/node/work/node-v14.4.0/out/Release/obj.target/tools/v8_gypfiles/libv8_base_without_compiler.a" Traceback (most recent call last): File "tools/genv8constants.py", line 23, in <module> bufsize=-1, stdout=subprocess.PIPE, text=True).stdout TypeError: __init__() got an unexpected keyword argument 'text' gmake[2]: *** [node_dtrace_ustack.target.mk:13: /wrkdirs/usr/ports/www/node/work/node-v14.4.0/out/Release/obj/gen/v8constants.h] Error 1 rm ed36ab92458644e121416e8697a6b64c051c72b0.intermediate ad3fd4c76aef3b4797bbb2572833f9000cee0294.intermediate ea2d89ddb30e54c8a8d75f33fc84b228111d7c67.intermediate gmake[1]: *** [Makefile:101: node] Error 2 gmake[1]: Leaving directory '/wrkdirs/usr/ports/www/node/work/node-v14.4.0' *** Error code 1
Created attachment 216652 [details] poudriere build log failure
Probably caused by setting default version of Python to 2.7 which causes shebeng line /usr/local/bin/python27 in tools/genv8constants.py but the code in it is not compatible with Python 2.7. This should be markerd as "BROKEN with Python 2.7" or something like this. Building with Python 3.7 right now...
I have a similar problem, but with DEFAULT_VERSIONS=python=3.6. The change introduced in https://svnweb.freebsd.org/ports?view=revision&revision=535334 only specifies python, but the patch introduces the 'text' argument to subprocess.Popen, which is only available from python 3.7: "Changed in version 3.7: Added the text parameter, as a more understandable alias of universal_newlines. Added the capture_output parameter." As 'text' is an alias to 'universal_newlines', a simple (tested & working) change is to just use that instead, to make it compatible with 3.6 as well.
Created attachment 217379 [details] Patch against 14.6.0 (Main) & 14.4.0 (Quarterly) Can you please test the attached patch. The issue is caused by a patch shipped with the port, I've moved it to EXTRA_PATCHES if the python version is 3.7 or higher. This is against 14.6.0, but it should also apply cleanly against 14.4.0. If it works, It will need to be applied against both the quarterly & main ports trees as both are affected by this issue. Build logs to follow.
Created attachment 217380 [details] Poudriere Build Log 14.6.0 & Python 3.7
Created attachment 217385 [details] Patch against 14.6.0 (Main branch) & 14.4.0 (Quarterly) My previous patch just re-uncovered the build issue with Python 3 that the included patch was trying to fix in the first place. Johan hit the nail on the head in Comment 3, the attached patch addresses things all the way back to Python 2.7. I was a bit reluctant to apply the patch if it wasn't needed, but apparently it is for all but Python 2. Poudriere build log for Python 3.7 @ 14.6.0 to follow, but I have had successful runs against Python 2.7, Python 3.6 and the various combinations thereof with 14.4.0
Created attachment 217388 [details] Poudriere Build Log 14.4.0, Python 3.6
Created attachment 217389 [details] Poudriere Build Log 14.6.0, Python 3.7
A commit references this bug: Author: bhughes Date: Thu Aug 20 21:27:51 UTC 2020 New revision: 545565 URL: https://svnweb.freebsd.org/changeset/ports/545565 Log: www/node: build with python < 3.7 r535334 introduced a patch for tools/genv8constants.py that only worked with Python >= 3.7. The "text" argument added to Python's subprocess.Popen() is an alias for "universal_newlines", which works on all versions of Python, including 2.7. PR: 248167 Submitted by: James French <james@french.id.au> Reported by: Miroslav Lachman <000.fbsd@quip.cz> MFH: 2020Q3 Sponsored by: Miles AS Changes: head/www/node/files/patch-tools_genv8constants.py
A commit references this bug: Author: bhughes Date: Thu Aug 20 21:37:05 UTC 2020 New revision: 545566 URL: https://svnweb.freebsd.org/changeset/ports/545566 Log: MFH: r545565 www/node: build with python < 3.7 r535334 introduced a patch for tools/genv8constants.py that only worked with Python >= 3.7. The "text" argument added to Python's subprocess.Popen() is an alias for "universal_newlines", which works on all versions of Python, including 2.7. PR: 248167 Submitted by: James French <james@french.id.au> Reported by: Miroslav Lachman <000.fbsd@quip.cz> Sponsored by: Miles AS Approved by: ports-secteam (joneum) Changes: _U branches/2020Q3/ branches/2020Q3/www/node/files/patch-tools_genv8constants.py
Committed to head and quarterly, thanks for the patch! :)