-
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
build: runtime-deprecate requiring deps #16392
Conversation
aa42362
to
7ea4135
Compare
Isn't this |
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.
FWIW, I'd be okay with simple removal. It seems vanishingly unlikely that anyone is using these.
tools/js2c.py
Outdated
@@ -256,10 +264,19 @@ def JS2C(source, target): | |||
lines = ExpandConstants(lines, consts) | |||
lines = ExpandMacros(lines, macros) | |||
|
|||
deprecatedDeps = None |
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.
Style nit: deprecated_deps
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.
Fixed.
tools/js2c.py
Outdated
if split[0] == 'deps': | ||
if split[1] == 'node-inspect' or split[1] == 'v8': | ||
deprecatedDeps = split[1:] | ||
split = ['internal'] + split |
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 maps deps/foo/bar.js
to internal/deps/foo/bar.js
.
I don't think you have to special-case for node-inspect
or v8
because anything from deps/ should pretty much be internal by default. ISTM it can be simplified to his:
if split[0] === 'deps':
split[0] = 'internal'
else:
split = split[1:]
Could be simplified further by just matching on name
:
name = '/'.join(re.split('/|\\\\', name))
if name.startswith('lib/'):
name = name[len('lib/'):]
elif name.startswith('deps/'):
deprecated_deps, name = name, 'internal/' + name[len('deps/'):]
Bonus points: you won't have to '/'.join(...)
below.
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.
I think I misread the intent of this code - it's prefixing with internal/
unconditionally but stashing the original away. Could still be simplified, though:
name = '/'.join(re.split('/|\\\\', name))
if name.startswith('deps/node-inspect/') or name.startswith('deps/v8/'):
deprecated_deps = name[len('deps/'):]
name = 'internal/' + name
elif name.startswith('lib/'):
name = name[len('lib/'):]
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.
@bnoordhuis Not only that, but internal/
should also be added to any other file in deps/
that do not match node-inspect
and v8
to prevent them from being visible to userland, thus the code in its current form.
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.
LGTM once @bnoordhuis is happy also.
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.
LGTM once nits are addressed.
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.
generally LGTM once @bnoordhuis is happy also
7ea4135
to
122176c
Compare
Landed in 0e10717. |
PR-URL: #16392 Fixes: #15566 (comment) Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Fixes: #15566 (comment)
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
build