build: fix node build failures in WSL Ubuntu

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: https://github.com/nodejs/node/issues/41459

PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
MrJithil authored and Michaël Zasso committed 2022-01-16 15:01:08 +01:00
1 parent f5b8aee1a1
commit e8538c3751
1 file changed
+2 -2
+2 -2
View File
@@ -2030,8 +2030,8 @@ if options.compile_commands_json:
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')