Skip to content

Commit

Permalink
fix: failure when build directory contains spaces
Browse files Browse the repository at this point in the history
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 nodejs/node-gyp#65
  • Loading branch information
davej authored and tombruijn committed Oct 30, 2023
1 parent 379257d commit 87c51bf
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pylib/gyp/generator/make.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 87c51bf

Please sign in to comment.