From f411195a8607456847e7bfa5286cf3bd6ca59174 Mon Sep 17 00:00:00 2001 From: Jason Yundt Date: Sun, 29 Dec 2024 08:43:58 -0500 Subject: [PATCH] Make sure that INCS_* vars are properly escaped MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before this change, there was a chance that gyp-next would generate broken Make files. Specifically, if the path to the project that you’re building contains spaces, then the INCS_* Make variables would look like this: INCS_Debug := \ -I/home/jayman/Documents/Home/VC/Git/Partially mine/node/repo/out/Debug/addons_headers/include/node \ -I/home/jayman/Documents/Home/VC/Git/Partially mine/node/repo/out/Debug/addons_headers/src \ -I/home/jayman/Documents/Home/VC/Git/Partially mine/node/repo/out/Debug/addons_headers/deps/openssl/config \ -I/home/jayman/Documents/Home/VC/Git/Partially mine/node/repo/out/Debug/addons_headers/deps/openssl/openssl/include \ -I/home/jayman/Documents/Home/VC/Git/Partially mine/node/repo/out/Debug/addons_headers/deps/uv/include \ -I/home/jayman/Documents/Home/VC/Git/Partially mine/node/repo/out/Debug/addons_headers/deps/zlib \ -I/home/jayman/Documents/Home/VC/Git/Partially mine/node/repo/out/Debug/addons_headers/deps/v8/include This would eventually cause builds to fail because the spaces in the paths weren’t properly escaped. This change makes sure that the paths get properly escaped. --- pylib/gyp/generator/make.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pylib/gyp/generator/make.py b/pylib/gyp/generator/make.py index 634da897..94e5f5c7 100644 --- a/pylib/gyp/generator/make.py +++ b/pylib/gyp/generator/make.py @@ -1430,7 +1430,7 @@ def WriteSources( self.WriteList(cflags_objcc, "CFLAGS_OBJCC_%s" % configname) includes = config.get("include_dirs") if includes: - includes = [Sourceify(self.Absolutify(i)) for i in includes] + includes = [SourceifyAndQuoteSpaces(self.Absolutify(i)) for i in includes] self.WriteList(includes, "INCS_%s" % configname, prefix="-I") compilable = list(filter(Compilable, sources))