Potential error (and fix) for Linux engine gyp

Every time I do make config I receive a warning:

:367: SyntaxWarning: “\$” is an invalid escape sequence. Such sequences will not work in the future. Did you mean “\\$”? A raw string is also an option.

I decided to ask ChatGPT about it and here are the thoughts:

That is a Python/GYP SyntaxWarning, not a macOS configuration error. If make config-mac exits successfully after it, you can safely proceed.

GYP parses every .gyp string—including Linux-only settings—so it reaches this Linux rpath flag even on macOS:

[engine/engine.gyp (line 367)](/Users/milby/Developer/HyperXTalk/engine/engine.gyp:367)

'-Wl,--disable-new-dtags,-rpath,\$$ORIGIN/lib',

To silence the warning and preserve the same generated linker flag, escape the backslash:

'-Wl,--disable-new-dtags,-rpath,\\$$ORIGIN/lib',

The mac build does not use that Linux linker setting; the warning occurs only because newer Python versions warn about \$ as an invalid escape sequence.

My question:

Based on the comment above the offending line, this is something that was added for HXT. Anyone have thoughts on whether the AI is correct that making that change is “safe” to silence the error? It does indeed silence the error, I’m just not sure if it makes any difference in the compile. I’m running one now, but other than a failure to compile I’m not sure how to check it out (it did compile and launch fine).

Claude says it’s safe as it’s just syntax and not a behaviour change.

The compilation continues and completes successfully after displaying the warning. I had no luck trying to track down the source of this warning, so it’s good to know that it’s not coming from part of our repo.

Some day I’d love to get rid of gyp. Google end-of-lifed it ten years ago and moved on to gn. There’s no easy migration path from gyp to gn and my tentative attempts so far haven’t worked out.