-
Notifications
You must be signed in to change notification settings - Fork 12k
bug(schematics): execution in a CWD w/ many directories and files causes a major delay or crash #12158
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
Comments
From @Splaktar on November 2, 2017 21:35 This is caused by https://github.com/angular/devkit/blob/master/packages/angular_devkit/schematics/bin/schematics.ts#L171-L172. There doesn't seem to be any way for schematics to tell at this point what kind of schematic will be executed. Should a |
From @hansl on November 3, 2017 11:26 Please note that we don’t scan (or shouldn’t) the directories now unless the schematics requires it (e.g. list files). I think this might be coming from the sink where we apply those changes? Basically the issue is that schematics should not care about creating an empty host for some, but the code outside the schematics itself should not force a scan. And the schematics itself should be able to listcertains dirswithout scanning the whole structure. I need to take a quick look. But if you want I can tell you where the issue is and you can fix it. |
From @Splaktar on November 3, 2017 16:19 I implemented a change locally to remove Since not all schematics have a |
From @Splaktar on November 6, 2017 18:43 There is another related issue with the |
@clydin this is no longer possible to reproduce with the change to require creating a workspace first and the removal of the This can be closed. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
From @Splaktar on October 31, 2017 3:24
Bug Report or Feature Request
Area
Versions
npm: 5.5.1
node: v8.8.1
@angular-devkit/[email protected]
@angular-devkit/[email protected]
Repro steps
schematics application --name tmp --directory tmp
The log given by the failure
Most of the time there is no error, but the generation of a new app may take 1-3 minutes!
In extreme cases where you have a large number of projects, the heap will fill up resulting in this:
Desired functionality
It is understandable that the execution of most schematics would scan all of the files and directories in the CWD (current working directory) as it may assume that it is in an app and needs to know the structure.
But when creating a new app, there is no need to do this scanning in the CWD. Perhaps in the directory specified by
--directory
, but it is likely empty in most cases unless--force
is being used.Mention any other details that might be useful
Running the same command in an empty directory usually completes in just a few seconds (compared to 1m+ in a dir w/ Angular projects in it).
Copied from original issue: angular/devkit#248
The text was updated successfully, but these errors were encountered: