Skip to content

Commit

Permalink
build: fix node build failures in WSL Ubuntu
Browse files Browse the repository at this point in the history
On WSL systems, `./configure` causes appending of carriage return
(`\r\r`) as leftover and will be appended to the `gyp_args`.
Therefore, it will lead to unhandled exceptions from the `./configure`
execution.
Excluded the empty or whitespace item from the `args` array to
fix the issue.

Fixes: nodejs#41459

PR-URL: nodejs#41476
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
  • Loading branch information
MrJithil authored and mawaregetsuka committed Jan 17, 2022
1 parent 8c9f86c commit 51d7f6c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -2031,8 +2031,8 @@ def make_bin_override():
if bin_override is not None:
gyp_args += ['-Dpython=' + sys.executable]

# pass the leftover positional arguments to GYP
gyp_args += args
# pass the leftover non-whitespace positional arguments to GYP
gyp_args += [arg for arg in args if not str.isspace(arg)]

if warn.warned and not options.verbose:
warn('warnings were emitted in the configure phase')
Expand Down

0 comments on commit 51d7f6c

Please sign in to comment.