From 87c51bfaae404f9920cfe98e52b835ada743bf37 Mon Sep 17 00:00:00 2001 From: Dave Jeffery Date: Thu, 25 Nov 2021 10:41:41 +0000 Subject: [PATCH] fix: failure when build directory contains spaces Fix an installation issue that occurs when a path in which node-gyp is run contains spaces. For a path like `my app`, it would error with this message: ``` clang: error: no such file or directory: 'app/node_modules/node-addon-api' ``` The "my" part before the space (and the rest of the path before it) would be missing from the path in the error message. Fixes https://github.com/nodejs/node-gyp/issues/65 --- pylib/gyp/generator/make.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pylib/gyp/generator/make.py b/pylib/gyp/generator/make.py index 1b997494..236a4268 100644 --- a/pylib/gyp/generator/make.py +++ b/pylib/gyp/generator/make.py @@ -1418,7 +1418,12 @@ def WriteSources( includes = config.get("include_dirs") if includes: includes = [Sourceify(self.Absolutify(i)) for i in includes] - self.WriteList(includes, "INCS_%s" % configname, prefix="-I") + self.WriteList( + includes, + "INCS_%s" % configname, + prefix="-I", + quoter=EscapeShellArgument + ) compilable = list(filter(Compilable, sources)) objs = [self.Objectify(self.Absolutify(Target(c))) for c in compilable]