From e8538c37515b33bb4fdd3fb02a16c34df29f043b 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 70288d8b0a74e1..dcdd0c9013b79f 100755 --- a/configure.py +++ b/configure.py @@ -2030,8 +2030,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')