Bug 1811698 - [abrt] npm: ExpandVariables(): input.py:914:ExpandVariables:TypeError: write() argument must be str, not bytes while trying to load binding.gyp
Summary: [abrt] npm: ExpandVariables(): input.py:914:ExpandVariables:TypeError: write(...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: nodejs
Version: 31
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: NodeJS Packaging SIG
QA Contact: Fedora Extras Quality Assurance
URL: https://retrace.fedoraproject.org/faf...
Whiteboard: abrt_hash:cbc1581276d570d4309c9050d65...
: 1813652 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-03-09 15:03 UTC by kb1000
Modified: 2020-03-27 08:00 UTC (History)
7 users (show)

Fixed In Version: nodejs-12.16.1-3.fc32
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-03-27 08:00:15 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
File: backtrace (8.30 KB, text/plain)
2020-03-09 15:03 UTC, kb1000
no flags Details
File: cpuinfo (2.24 KB, text/plain)
2020-03-09 15:03 UTC, kb1000
no flags Details
File: environ (7.81 KB, text/plain)
2020-03-09 15:03 UTC, kb1000
no flags Details
File: mountinfo (2.86 KB, text/plain)
2020-03-09 15:03 UTC, kb1000
no flags Details
File: namespaces (129 bytes, text/plain)
2020-03-09 15:03 UTC, kb1000
no flags Details
File: open_fds (849 bytes, text/plain)
2020-03-09 15:03 UTC, kb1000
no flags Details

Description kb1000 2020-03-09 15:03:18 UTC
Version-Release number of selected component:
1:npm-6.13.4-1.12.16.1.1.fc31

Additional info:
reporter:       libreport-2.12.0
cgroup:         0::/user.slice/user-1000.slice/user/gnome-terminal-server.service
cmdline:        /usr/bin/python /usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py binding.gyp -f make -I /home/kb1000/MGit/js/node_modules/deasync/build/config.gypi -I /usr/lib/node_modules/npm/node_modules/node-gyp/addon.gypi -I /home/kb1000/.cache/node-gyp/12.16.1/include/node/common.gypi -Dlibrary=shared_library -Dvisibility=default -Dnode_root_dir=/home/kb1000/.cache/node-gyp/12.16.1 -Dnode_gyp_dir=/usr/lib/node_modules/npm/node_modules/node-gyp -Dnode_lib_file=/home/kb1000/.cache/node-gyp/12.16.1/<(target_arch)/node.lib -Dmodule_root_dir=/home/kb1000/MGit/js/node_modules/deasync -Dnode_engine=v8 --depth=. --no-parallel --generator-output build -Goutput_dir=.
crash_function: ExpandVariables
exception_type: TypeError
executable:     /usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py
interpreter:    python-unversioned-command-3.7.6-2.fc31.noarch
kernel:         5.5.6-201.fc31.x86_64
runlevel:       N 5
type:           Python3
uid:            1000

Truncated backtrace:
#1 [/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py:914] ExpandVariables
#2 [/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py:1315] ProcessVariablesAndConditionsInList
#3 [/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py:1296] ProcessVariablesAndConditionsInDict
#4 [/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py:1311] ProcessVariablesAndConditionsInList
#5 [/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py:1296] ProcessVariablesAndConditionsInDict
#6 [/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py:417] LoadTargetBuildFile
#7 [/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py:2779] Load
#8 [/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py:139] Load
#9 [/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py:523] gyp_main
#10 [/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py:547] main

Comment 1 kb1000 2020-03-09 15:03:22 UTC
Created attachment 1668674 [details]
File: backtrace

Comment 2 kb1000 2020-03-09 15:03:23 UTC
Created attachment 1668675 [details]
File: cpuinfo

Comment 3 kb1000 2020-03-09 15:03:25 UTC
Created attachment 1668676 [details]
File: environ

Comment 4 kb1000 2020-03-09 15:03:27 UTC
Created attachment 1668677 [details]
File: mountinfo

Comment 5 kb1000 2020-03-09 15:03:28 UTC
Created attachment 1668678 [details]
File: namespaces

Comment 6 kb1000 2020-03-09 15:03:30 UTC
Created attachment 1668679 [details]
File: open_fds

Comment 7 Stephen Gallagher 2020-03-11 00:55:45 UTC
Can you please provide some additional details around what you were attempting to do here? It appears that you were trying to build npm itself and hit a bug with its support for Python 3 to build.

Comment 8 Stephen Gallagher 2020-03-16 12:20:09 UTC
*** Bug 1813652 has been marked as a duplicate of this bug. ***

Comment 9 Stephen Gallagher 2020-03-16 12:22:21 UTC
OK, I'm making a bit of a guess here, but I think what's happening is that node-gyp is incorrectly assuming that if python is invoked from /usr/bin/python, it must be python 2 (but on F31+ it's actually python 3). I'm adding a patch to /etc/npmrc that will set the default python interpreter explicitly to /usr/bin/python3 to hopefully work around this.

Comment 10 kb1000 2020-03-16 16:57:31 UTC
I'm sorry for not responding earlier, but I didn't try to build npm itself, but try to install node-sass 4.13.1 using yarn from https://classic.yarnpkg.com/en/docs/install/#centos-stable .
It pulled in deasync 0.1.19, this happened during the build of that package. Would yarn be fixed too by that patch?

Comment 11 Fedora Update System 2020-03-19 02:26:19 UTC
nodejs-12.16.1-3.fc32 has been pushed to the Fedora 32 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-7a79b4da6a

Comment 12 Fedora Update System 2020-03-27 08:00:15 UTC
FEDORA-2020-7a79b4da6a has been pushed to the Fedora 32 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.