Skip to content

compile_commands_json breaks on Python3 #1946

@gengjiawen

Description

@gengjiawen

Similar to #1943

node-gyp configure -- -f compile_commands_json

cc @cclauss

Verbose output (from npm or node-gyp):
gyp info it worked if it ends with ok   
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp info find Python using Python version 3.6.8 found at "/usr/bin/python3"
gyp info spawn /usr/bin/python3
gyp info spawn args [
gyp info spawn args   '/usr/local/share/.config/yarn/global/node_modules/node-gyp/gyp/gyp_main.py',     
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'compile_commands_json',
gyp info spawn args   '-I',
gyp info spawn args   '/mnt/d/Developer/node-addon-examples/2_function_arguments/nan/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/local/share/.config/yarn/global/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/daniel/.cache/node-gyp/13.0.1/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/home/daniel/.cache/node-gyp/13.0.1',
gyp info spawn args   '-Dnode_gyp_dir=/usr/local/share/.config/yarn/global/node_modules/node-gyp',      
gyp info spawn args   '-Dnode_lib_file=/home/daniel/.cache/node-gyp/13.0.1/<(target_arch)/node.lib',    
gyp info spawn args   '-Dmodule_root_dir=/mnt/d/Developer/node-addon-examples/2_function_arguments/nan',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
Traceback (most recent call last):
  File "/usr/local/share/.config/yarn/global/node_modules/node-gyp/gyp/gyp_main.py", line 50, in <module>
    sys.exit(gyp.script_main())
  File "/usr/local/share/.config/yarn/global/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 554, in script_main
    return main(sys.argv[1:])
  File "/usr/local/share/.config/yarn/global/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 547, in main
    return gyp_main(args)
  File "/usr/local/share/.config/yarn/global/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 532, in gyp_main
    generator.GenerateOutput(flat_list, targets, data, params)
  File "/usr/local/share/.config/yarn/global/node_modules/node-gyp/gyp/pylib/gyp/generator/compile_commands_json.py", line 95, in GenerateOutput
    for qualified_target, target in target_dicts.iteritems():
AttributeError: 'dict' object has no attribute 'iteritems'
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/share/.config/yarn/global/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:210:5)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Linux 4.4.0-18362-Microsoft
gyp ERR! command "/usr/local/bin/node" "/usr/local/bin/node-gyp" "configure" "--" "-f" "compile_commands_json"
gyp ERR! cwd /mnt/d/Developer/node-addon-examples/2_function_arguments/nan
gyp ERR! node -v v13.0.1
gyp ERR! node-gyp -v v6.0.0
gyp ERR! not ok

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions