From 3e4d977c28a632a00922a57eaf434161b864d370 Mon Sep 17 00:00:00 2001 From: MrJithil Date: Tue, 11 Jan 2022 14:42:05 +0530 Subject: [PATCH] build: fix node build failures in WSL Ubuntu MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-By: Tobias Nießen Reviewed-By: Benjamin Gruenbaum Reviewed-By: Mohammed Keyvanzadeh Reviewed-By: Darshan Sen Reviewed-By: Michael Dawson --- configure.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.py b/configure.py index a826e69b0dcdac..47137d8912dd14 100755 --- a/configure.py +++ b/configure.py @@ -2043,8 +2043,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')