Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b977672

Browse filesBrowse files
danbevaddaleax
authored andcommitted
build,tools: fix cmd_regen_makefile
Currently, after having configured and built node and then updating a dependent target the following error is produced when trying to rebuild the project: $ ./configure && make -j8 $ touch node.gypi $ make -j8 configure: error: no such option: -f make[1]: *** [Makefile:685: Makefile] Error 2 The reason for this is that the target 'cmd_regen_makefile' is using the command 'configure' instead of 'gyp_node.py' in out/Makefile: cmd_regen_makefile = cd $(srcdir); /work/nodejs/node/configure -fmake As far as I can tell gyp is using sys.argv[0] as the 'gyp_binary' in __init__.py: params = {'options': options, ... 'gyp_binary': sys.argv[0], But when called via 'configure' sys.argv[0] is 'configure' instead of gyp_node.py leading to the above error. This commit suggests setting the program name explicitly in gyp_node.py. Alternatively perhaps this could be done in configure.py instead but I was not sure what would be best. PR-URL: #34255 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent ba7ba4f commit b977672
Copy full SHA for b977672

File tree

Expand file treeCollapse file tree

1 file changed

+6
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-0
lines changed
Open diff view settings
Collapse file

‎tools/gyp_node.py‎

Copy file name to clipboardExpand all lines: tools/gyp_node.py
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ def run_gyp(args):
5151
args.append('-Dlinux_use_bundled_gold=0')
5252
args.append('-Dlinux_use_gold_flags=0')
5353

54+
# Set the current program to this module. This is done because gyp
55+
# will use the program path in targets it generates. If this script was called
56+
# by another script the program name will not be gyp_node.py but whatever
57+
# the name of the script that called it is, leading to incorrect commands
58+
# in generated targets (for example cmd_regen_makefile).
59+
sys.argv[0] = os.path.abspath(__file__)
5460
rc = gyp.main(args)
5561
if rc != 0:
5662
print('Error running GYP')

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.