-
Notifications
You must be signed in to change notification settings - Fork 225
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
Copy node_modules folder when symlink fails #24
Conversation
The "solution" is to copy the entire folder when symlink fails. Solution for serverless#23
@pmuens would you mind taking a look? Is this a problem/pattern you saw in other plugins as well? |
@schickling interesting 🤔 Thanks for pointing me in that direction. I remember that we had some issues with symlinking in the core (in early Have not (specifically) heard about others plugins dealing with that kind of problem though. |
So what's your suggestion @pmuens? Does this need to be addressed in the Serverless core? |
Would be nice if we could write a test which reproduces this behavior in core to ensure that's it's a bug in that codebase. After validating that we can fix it over there. |
@josenicomaia would you mind taking a look at this? If it turns out to be a limitation of the typescript plugin, I'm more than happy to merge the PR. I just want to make sure we're fixing the actual problem here. |
It's not a core bug. It's a windows limitation that does't have the permission to create symbolic links. About the test, I can make it to cover this case, but it will not expose the problem as I will have to mock Is that what you are expecting? |
I see. Could you please add another comment documenting that this is a Windows limitation? |
Sure I do. There is more details on the related issue. I have updated it. #23 |
Sorry if I wasn't clear enough. I meant adding a comment to the code itself 🙂 |
- Added an information comment about the windows issue
@schickling I partially refactored the deployment routine. What do you think? |
import * as path from 'path' | ||
import * as fs from 'fs-p' | ||
|
||
export class DeployBuilder { |
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 like that you pulled out this complexity to a separate file but I don't think that the name is intuitive and it doesn't need to be a class.
I'd suggest you export a function called symlink
instead of a class and use all of the functions outside of the scope of a class.
Does that make sense to you? :)
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.
Sure. It does :)
The purpose of this class is to prepare the deployment. It just happens that I refactored a little piece of it. I intended to put all the deployment part on it.
What do you think? Should I complete the refactoring or keep it in the monolite way?
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 it's great that you're splitting it up into multiple functions, I just think they don't need to live inside a class.
Will this be merged soon? My Windows developers are currently working around the problem by using an Administrator-level prompt. |
@pmuens can you provide some update regarding this issue? Is this something that should be handled by the core of the serverless framework? |
Thanks for pinging @schickling 👍 🤔 So since this is more like a feature rather than a bug I'd suggest to open up an issue at serverless/serverless so that we can discuss it over there. Generally speaking I've not yet encountered such a feature proposal in the Serverless Framework core repository. Might be interesting to see how other Windows users think about this! |
The symlink on package.json complains too. It should be copied like the node_modules does if EPERM is raised. |
any update on this ? |
Any updates about this issue? |
A fix for this has been released in version 1.1.7 🎉 Please re-open a new issue if you think this is still relevant 😄 |
The "solution" is to copy the entire folder when symlink fails.
Solution for #23