Skip to content

Speed up windows packaging #347

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

Merged
merged 3 commits into from
Apr 23, 2019
Merged

Speed up windows packaging #347

merged 3 commits into from
Apr 23, 2019

Conversation

blackmamo
Copy link
Contributor

Using junctions and adding a negative include pattern massively speed up the packaging time

Copying the files on windows is very slow and can be avoided by using junctions
This advice saved me a lot of time
@blackmamo
Copy link
Contributor Author

Created issue to go with this PR

#348

if (process.platform == 'win32') {
fse.copySync(reqsInstalledAt, symlinkPath);
fse.symlink(reqsInstalledAt, symlinkPath, 'junction');
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this require any extra user permissions? I recall something about that

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is my understanding that junctions only require the normal file creation permissions. When created they use fully qualified paths and can only link to directories in the same NTFS filesystem.

The admin permissions are required for a full symlink because this has more serious security complications.

The only potential problem I can see is if someone has set up their cache directory and the serverless directory on separate file systems. In that case the junction operation would fail. I could add this note to the readme, but it may be a lot of noise for an unlikely setup.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, very cool. I thought junctions were symlinks. Thanks for the clarification.

@dschep dschep merged commit e31a10c into serverless:master Apr 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants