From 2ea2621ace40921e1bfa56ad0d9a3be0011de738 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 3209c5a6472..c17e3c6dfaa 100755 --- a/configure.py +++ b/configure.py @@ -2031,8 +2031,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')