-
Notifications
You must be signed in to change notification settings - Fork 4k
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
fix(lambda-nodejs): build fails on Windows #8140
Conversation
This is because the operations of [`path`](https://nodejs.org/api/path.html) are OS specific. But for the container working directory and inside the container we never want to use Windows style paths. Fixes aws#8107
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
@@ -111,11 +111,11 @@ export class Builder { | |||
'-v', `${this.options.projectRoot}:${containerProjectRoot}`, | |||
'-v', `${path.resolve(this.options.outDir)}:${containerOutDir}`, | |||
...(this.options.cacheDir ? ['-v', `${path.resolve(this.options.cacheDir)}:${containerCacheDir}`] : []), | |||
'-w', path.dirname(containerEntryPath), | |||
'-w', path.dirname(containerEntryPath).replace(/\\/g, '/'), // Always use POSIX paths in the container |
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.
sounds like something we should take to the bundling PR, no?
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.
In #7898 we explicitly ask for a workingDirectory
(optional prop) so the user knows that it's a POSIX style path?
Here we had to calculate it using path
logic because we are mounting projectRoot
but want to work closer to the entry file.
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
This is because the operations of
path
areOS specific. But for the container working directory and inside the container we
never want to use Windows style paths.
Fixes #8107
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license