-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tools: this relates to #14336, fixes the 'make lint' portion with non-ascii build file path #16047
Conversation
…ject path contains non-ascii characters.
if not output_base: | ||
raise Exception("Base output directory must be specified") | ||
config_file = arg_options.config | ||
if not config_file: | ||
raise Exception("Config file name must be specified") | ||
config_base = os.path.dirname(config_file) | ||
config_base = os.path.dirname(config_file).decode('utf-8') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No changes should be made to the deps. Those changes should only happen upstream.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes to this effect were already made upstream-upstream, btw: https://chromium-review.googlesource.com/c/deps/inspector_protocol/+/574858 … ping @ak239
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tools/cpplint.py
change LGTM
Welcome @sharkfisher and thank for this contribution 🥇 |
Quick CI check: https://ci.nodejs.org/job/node-test-linter/12296/ ✔️ |
@refack That CL already landed, it just waits to be rolled into V8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the upstream change was merged I suppose it makes sense to follow suit but decoding as UTF-8 won't work when the path contains e.g. Latin-1 characters.
tools/cpplint.py
Outdated
@@ -1075,7 +1075,7 @@ def RepositoryName(self): | |||
fullname = self.FullName() | |||
# XXX(bnoordhuis) Expects that cpplint.py lives in the tools/ directory. | |||
toplevel = os.path.abspath( | |||
os.path.join(os.path.dirname(__file__), '..')).replace('\\', '/') | |||
os.path.join(os.path.dirname(__file__), '..')).replace('\\', '/').decode('utf-8') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you wrap this at 80 columns?
Were these supported before? This seems like a net positive. |
cpplint.py currently is file system encoding-agnostic. The bug in #14336 seems to be primarily CodeGenerator.py mixing byte strings and unicode strings. |
stay within 80 cols
so I removed changes to CodeGenerator.py since it will be fixed by upstream, and reformatted cpplint.py to stay within 80 cols. So now the only change is to let "make lint" pass when build path has non-ascii chars, it's not directly addressing bug #14336, but is related to it once "make" passes. |
@bnoordhuis PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the CodeGenerator.py changes gone, I don't think there is much reason to make changes to cpplint.py - it shouldn't need them.
CodeGenerator.py change only fixes "make" for me. |
What error do you get? As I mentioned earlier, cpplint.py is (or should be) encoding-agnostic. |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh, interesting. It's a bit of a shame that it swaps one encoding issue for another (Latin-1 stops working, UTF-8 starts working) but UTF-8 is probably the most prevalent of the two.
toplevel = os.path.abspath( | ||
os.path.join(os.path.dirname(__file__), '..')).replace('\\', '/') | ||
toplevel = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) \ | ||
.replace('\\', '/').decode('utf-8') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be a little easier to read as:
toplevel = os.path.abspath(...)
toplevel = toplevel.decode('utf-8')
PR-URL: #16047 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Landed in 22882d4 @sharkfisher congrats on being promoted from |
PR-URL: #16047 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
PR-URL: #16047 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
PR-URL: #16047 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
PR-URL: nodejs/node#16047 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
PR-URL: nodejs/node#16047 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
PR-URL: #16047 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
PR-URL: #16047 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
PR-URL: #16047 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
PR-URL: nodejs/node#16047 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
deps