Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions gyp/pylib/gyp/generator/make.py
Original file line number Diff line number Diff line change
Expand Up @@ -2484,6 +2484,8 @@ def Pchify(self, path, lang):
def Absolutify(self, path):
"""Convert a subdirectory-relative path into a base-relative path.
Skips over paths that contain variables."""
"""In MINGW node -p return a path with double quote"""
path = path.strip('"')
Comment on lines +2487 to +2488

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This string literal acts as a comment, but it's better to use a standard hash (#) comment for clarity and to follow Python conventions. String literals that are not docstrings or assigned to variables are evaluated and then discarded, which can be slightly less efficient and might be confusing to other developers. I've also slightly rephrased the comment for clarity.

Suggested change
"""In MINGW node -p return a path with double quote"""
path = path.strip('"')
# In MINGW, `node -p` can return a path enclosed in double quotes.
path = path.strip('"')

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that this is a MINGW-only issue, would there be a way to rewrite as:

if on_mingw:
    path = path.strip('"')

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kreijstal‘s fork be used for msys2 user,any plan merge to officail repo need to check MINGW platform.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean yes but this branch is also a PR itself
nodejs#3166
so I would like to be friendly with node-gyp upstream eventually they should merge it of course...

if "$(" in path:
# Don't call normpath in this case, as it might collapse the
# path too aggressively if it features '..'. However it's still
Expand Down
Loading