Skip to content

Conversation

@dnlup
Copy link
Contributor

@dnlupdnlup commented Mar 14, 2020

Load self-referential modules from the repl and using the preload flag -r.
In both cases, the base path used for resolution is the current process.cwd().

Fix#31595

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

@dnlupdnlup changed the title [WIP] module: self referential modules in repl or -rmodule: self referential modules in repl or -rMar 15, 2020
Copy link
Contributor

@guybedfordguybedford left a comment

Choose a reason for hiding this comment

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

Thanks for working on this @dnlup.

@dnlupdnlup changed the title module: self referential modules in repl or -r[WIP] module: self referential modules in repl or -rMar 24, 2020
@dnlupdnlup changed the title [WIP] module: self referential modules in repl or -rmodule: self referential modules in repl or -rMar 30, 2020
@dnlup
Copy link
ContributorAuthor

@guybedford I added tests and removed the WIP. I hope I am not forgetting any test case.

Copy link
Contributor

@guybedfordguybedford left a comment

Choose a reason for hiding this comment

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

Thanks @dnlup - this seems good to me.

//cc @nodejs/modules-active-members

Copy link
Contributor

@hybristhybrist left a comment

Choose a reason for hiding this comment

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

Thanks for making this happen! I feel like this is reaching the limits of inlining the logic though.

@dnlupdnlupforce-pushed the self_referential branch from 9684e99 to fc9022bCompareApril 6, 2020 07:13
@dnlup
Copy link
ContributorAuthor

dnlup commented Apr 6, 2020

I tried to address all your suggestions, could you take another look?

Copy link
Contributor

@hybristhybrist left a comment

Choose a reason for hiding this comment

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

Thanks for your patience with this & sorry for the late review feedback. :) LGTM!

Copy link
Member

@ljharbljharb left a comment

Choose a reason for hiding this comment

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

LGTM!

@dnlup
Copy link
ContributorAuthor

I have rebased against master

@nodejs-github-bot
Copy link
Collaborator

@dnlupdnlupforce-pushed the self_referential branch from 86749a2 to 8491203CompareMay 19, 2020 07:06
@BridgeARBridgeARforce-pushed the master branch 2 times, most recently from 8ae28ff to 2935f72CompareMay 31, 2020 12:18
@dnlupdnlupforce-pushed the self_referential branch from 8491203 to e5938efCompareJune 9, 2020 06:49
@dnlup
Copy link
ContributorAuthor

dnlup commented Jun 9, 2020

rebased the latest changes from master

@nodejs-github-bot
Copy link
Collaborator

@dnlupdnlupforce-pushed the self_referential branch from e5938ef to c46e315CompareJuly 2, 2020 06:50
@dnlup
Copy link
ContributorAuthor

dnlup commented Jul 2, 2020

Should I keep this PR open?

@ljharb
Copy link
Member

It seems like the only barrier to it landing is that CI is failing?

@MylesBorins
Copy link
Contributor

I'm going on vacation for a week, but can help with bringing this over the finish line when I get back.

@MylesBorinsMylesBorins self-assigned this Jul 2, 2020
@dnlupdnlupforce-pushed the self_referential branch from c46e315 to 512004eCompareJuly 3, 2020 05:54
@dnlup
Copy link
ContributorAuthor

dnlup commented Jul 3, 2020

Only the windows build seems to be failing, I don't understand why though, I can't find a specific error message beside the report that the test exited with code 1.

@richardlau
Copy link
Member

Only the windows build seems to be failing, I don't understand why though, I can't find a specific error message beside the report that the test exited with code 1.

It's #34163. The GitHub actions UI is not good for searching through the logs. I find it easier to search the raw log:

image

@dnlup
Copy link
ContributorAuthor

dnlup commented Jul 3, 2020

Thank you @richardlau

@dnlupdnlupforce-pushed the self_referential branch from 512004e to 07c2b68CompareJuly 16, 2020 07:29
@dnlup
Copy link
ContributorAuthor

After rebasing to resolve the conflicts I am getting ERR_INVALID_MODULE_SPECIFIER in my tests. 🙏 Give me some time to investigate this. It looks like this check wasn't there before, there must be something new that I have missed.

@dnlupdnlupforce-pushed the self_referential branch 2 times, most recently from 3c0389b to 8618148CompareJuly 20, 2020 06:23
@dnlupdnlupforce-pushed the self_referential branch from 8618148 to 9c0c66eCompareJuly 22, 2020 05:28
Copy link
Contributor

@guybedfordguybedford left a comment

Choose a reason for hiding this comment

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

Just noted one more refactoring here, sorry to be difficult but would just be nice to try keep the arguments primitive for functions where we can.

Otherwise lets get this merged now.

Load self referential modules from the repl and using the preload flag `-r`. In both cases the base path used for resolution is the current `process.cwd()`. Refs: * nodejs#31595
@dnlupdnlupforce-pushed the self_referential branch from 9c0c66e to 03c633fCompareJuly 22, 2020 12:47
Copy link
Contributor

@guybedfordguybedford left a comment

Choose a reason for hiding this comment

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

Let's get this landed finally...

@nodejs-github-bot
Copy link
Collaborator

@guybedfordguybedford added confirmed-bug Issues with confirmed bugs. regression Issues related to regressions. module Issues and PRs related to the module subsystem. labels Jul 23, 2020
guybedford pushed a commit that referenced this pull request Jul 23, 2020
Load self referential modules from the repl and using the preload flag `-r`. In both cases the base path used for resolution is the current `process.cwd()`. Also fixes an internal cycle bug in the REPL exports resolution. PR-URL: #32261Fixes: #31595 Reviewed-By: Guy Bedford <[email protected]> Reviewed-By: Jan Krems <[email protected]>
@guybedford
Copy link
Contributor

Landed in ec2ffd6. I also marked this as a bug and regression since it fixes a real "exports" resolution regression in the REPL now. Thanks @dnlup for your persistence here.

@dnlup
Copy link
ContributorAuthor

Thank you all for the help with this PR.

MylesBorins pushed a commit that referenced this pull request Jul 27, 2020
Load self referential modules from the repl and using the preload flag `-r`. In both cases the base path used for resolution is the current `process.cwd()`. Also fixes an internal cycle bug in the REPL exports resolution. PR-URL: #32261Fixes: #31595 Reviewed-By: Guy Bedford <[email protected]> Reviewed-By: Jan Krems <[email protected]>
@ruyadornoruyadorno mentioned this pull request Jul 28, 2020
guybedford pushed a commit to guybedford/node that referenced this pull request Sep 28, 2020
Load self referential modules from the repl and using the preload flag `-r`. In both cases the base path used for resolution is the current `process.cwd()`. Also fixes an internal cycle bug in the REPL exports resolution. PR-URL: nodejs#32261Fixes: nodejs#31595 Reviewed-By: Guy Bedford <[email protected]> Reviewed-By: Jan Krems <[email protected]>
codebytere pushed a commit that referenced this pull request Oct 1, 2020
Load self referential modules from the repl and using the preload flag `-r`. In both cases the base path used for resolution is the current `process.cwd()`. Also fixes an internal cycle bug in the REPL exports resolution. PR-URL: #32261 Backport-PR-URL: #35385Fixes: #31595 Reviewed-By: Guy Bedford <[email protected]> Reviewed-By: Jan Krems <[email protected]>
@codebyterecodebytere mentioned this pull request Oct 4, 2020
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

confirmed-bugIssues with confirmed bugs.moduleIssues and PRs related to the module subsystem.regressionIssues related to regressions.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Self referential modules not supported in repl or -r

8 participants

@dnlup@nodejs-github-bot@ljharb@MylesBorins@richardlau@guybedford@hybrist@addaleax