Skip to content

build: runtime-deprecate requiring deps - #16392

Closed
TimothyGu wants to merge 1 commit into
nodejs:masterfrom
TimothyGu:deps-modules
Closed

build: runtime-deprecate requiring deps#16392
TimothyGu wants to merge 1 commit into
nodejs:masterfrom
TimothyGu:deps-modules

Conversation

@TimothyGu

Copy link
Copy Markdown
Member

Fixes: #15566 (comment)

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

build

@nodejs-github-botnodejs-github-bot added build Issues and PRs related to build files or the CI. lib / src Issues and PRs related to general changes in the lib or src directory. tools Issues and PRs related to the tools directory. labels Oct 22, 2017
@TimothyGuTimothyGu mentioned this pull request Oct 22, 2017
4 tasks
@refack

Copy link
Copy Markdown
Contributor

Isn't this major

@bnoordhuisbnoordhuis left a comment

Copy link
Copy Markdown
Member

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.

Comment threadtools/js2c.py Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Style nit: deprecated_deps

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Fixed.

Comment threadtools/js2c.py Outdated

Copy link
Copy Markdown
Member

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:

ifsplit[0] ==='deps':
split[0] ='internal'else:
split=split[1:]

Could be simplified further by just matching on name:

name='/'.join(re.split('/|\\\\', name))
ifname.startswith('lib/'):
name=name[len('lib/'):]
elifname.startswith('deps/'):
deprecated_deps, name=name, 'internal/'+name[len('deps/'):]

Bonus points: you won't have to '/'.join(...) below.

Copy link
Copy Markdown
Member

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))
ifname.startswith('deps/node-inspect/') orname.startswith('deps/v8/'):
deprecated_deps=name[len('deps/'):]
name='internal/'+nameelifname.startswith('lib/'):
name=name[len('lib/'):]

Copy link
Copy Markdown
MemberAuthor

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.

@jasnelljasnell left a comment

Copy link
Copy Markdown
Member

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.

@jasnelljasnell added the semver-major PRs that contain breaking changes and should be released in the next major version. label Oct 23, 2017

@cjihrigcjihrig left a comment

Copy link
Copy Markdown
Contributor

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.

@jasnelljasnell left a comment

Copy link
Copy Markdown
Member

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

@TimothyGu

Copy link
Copy Markdown
MemberAuthor

@TimothyGu

Copy link
Copy Markdown
MemberAuthor

Landed in 0e10717.

@TimothyGu
TimothyGu deleted the deps-modules branch November 13, 2017 18:51
TimothyGu added a commit that referenced this pull request Nov 13, 2017
PR-URL: #16392Fixes: #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>
@targostargos mentioned this pull request Nov 29, 2017
3 tasks
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

buildIssues and PRs related to build files or the CI.lib / srcIssues and PRs related to general changes in the lib or src directory.semver-majorPRs that contain breaking changes and should be released in the next major version.toolsIssues and PRs related to the tools directory.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@TimothyGu@refack@bnoordhuis@jasnell@cjihrig@nodejs-github-bot