Skip to content

Conversation

@minggangw
Copy link
Member

@minggangw minggangw commented Feb 17, 2025

Currently, when executing node-gyp to build the C++ addon, it has the following warnings:

<string>:111: SyntaxWarning: invalid escape sequence '\/'
<string>:1[19](https://github.com/RobotWebTools/rclnodejs/actions/runs/13325047285/job/37216429264#step:7:20): SyntaxWarning: invalid escape sequence '\l'
<string>:128: SyntaxWarning: invalid escape sequence '\/'
<string>:129: SyntaxWarning: invalid escape sequence '\/'
<string>:130: SyntaxWarning: invalid escape sequence '\/'
<string>:131: SyntaxWarning: invalid escape sequence '\/'
<string>:132: SyntaxWarning: invalid escape sequence '\/'
<string>:133: SyntaxWarning: invalid escape sequence '\/'
<string>:134: SyntaxWarning: invalid escape sequence '\/'
<string>:135: SyntaxWarning: invalid escape sequence '\/'
<string>:136: SyntaxWarning: invalid escape sequence '\/'
<string>:137: SyntaxWarning: invalid escape sequence '\/'
<string>:138: SyntaxWarning: invalid escape sequence '\/'
<string>:139: SyntaxWarning: invalid escape sequence '\/'
<string>:140: SyntaxWarning: invalid escape sequence '\/'
<string>:141: SyntaxWarning: invalid escape sequence '\/'
<string>:142: SyntaxWarning: invalid escape sequence '\/'

This patch leverages the path module to remove platform-specific code, which caused the invalid escape sequence, including:

  1. Add config.js to grab the path of ROS path, library path and include path programmatically.
  2. Call functions defined in config.js and assign the returned value to include_dirs and library_dirs in binding.gyp.

Fix: #1034

@minggangw minggangw force-pushed the remove-invalid-escape branch 3 times, most recently from 655cd4e to 493522c Compare February 18, 2025 03:24
@minggangw minggangw force-pushed the remove-invalid-escape branch from 493522c to 3c1c585 Compare February 18, 2025 04:49
@minggangw minggangw requested a review from Copilot February 18, 2025 04:54
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

@minggangw minggangw merged commit baf4274 into RobotWebTools:develop Feb 18, 2025
6 checks passed
minggangw added a commit that referenced this pull request Feb 18, 2025
Currently, when executing `node-gyp` to build the C++ addon, it has the following warnings:
```bash
<string>:111: SyntaxWarning: invalid escape sequence '\/'
<string>:1[19](https://github.com/RobotWebTools/rclnodejs/actions/runs/13325047285/job/37216429264#step:7:20): SyntaxWarning: invalid escape sequence '\l'
<string>:128: SyntaxWarning: invalid escape sequence '\/'
<string>:129: SyntaxWarning: invalid escape sequence '\/'
<string>:130: SyntaxWarning: invalid escape sequence '\/'
<string>:131: SyntaxWarning: invalid escape sequence '\/'
<string>:132: SyntaxWarning: invalid escape sequence '\/'
<string>:133: SyntaxWarning: invalid escape sequence '\/'
<string>:134: SyntaxWarning: invalid escape sequence '\/'
<string>:135: SyntaxWarning: invalid escape sequence '\/'
<string>:136: SyntaxWarning: invalid escape sequence '\/'
<string>:137: SyntaxWarning: invalid escape sequence '\/'
<string>:138: SyntaxWarning: invalid escape sequence '\/'
<string>:139: SyntaxWarning: invalid escape sequence '\/'
<string>:140: SyntaxWarning: invalid escape sequence '\/'
<string>:141: SyntaxWarning: invalid escape sequence '\/'
<string>:142: SyntaxWarning: invalid escape sequence '\/'
```

This patch leverages the `path` module to remove platform-specific code, which caused the invalid escape sequence, including:

1. Add `config.js` to grab the path of ROS path, library path and include path programmatically.
2. Call functions defined in `config.js`  and assign the returned value to `include_dirs` and `library_dirs` in `binding.gyp`.

Fix: #1034
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix invalid escape sequence warnings

1 participant