-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
(aws-lambda-python): Asset bundling fails on Windows #18861
Comments
@gshpychka I'm having a hard time reproducing this since I don't have a windows machine. The weird part is that the behavior should not be any different between linux and windows because the bundling is happening in a linux docker container. Can you try reproducing this on a fresh project with just the minimum required dependencies? |
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
I am having the same problem with
Here's a sample minimal project @corymhall : |
@gbisaga You can still bypass this issue by using v 2.3.0-alpha.0. I still got that working with v2.14 of the aws-cdk-lib without it introducing problems. But I would imagine it will on the long run. |
@gbisaga thanks for the sample project! This one really has me stumped. My hunch is that it is something with the way Docker handles volumes on Windows, but I might need some help running down a root cause. |
Of course! Please let me know if you would like me to try anything. I'm not that familiar with the internals of CDK, but I would love to learn more about it! Looking at the timing, I'm wondering if it has anything to do with the recent Docker Desktop changes. I have not experienced any other problems with it, but that might explain both why it doesn't have problems on linux and also why it just started happening now. |
@gbisaga can you try running a test to see if it throws the same error?
You'll need to replace the volume source paths to windows paths so you'll end up with something like (depending on where you create the directories)
I created two directories /tmp/copy-test
And after running the test I had
|
I have also been having this issue for a while now. I used
The issue seems to be the last two |
The output directory should always use posix paths since this directory is being used within a linux docker container. I did not add any tests because it looks like there is no way to mock the `path` platform detection. fixes #18861 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
Leaving this open until we can confirm the fix works. |
Can I help confirm before the next release somehow? |
The output directory should always use posix paths since this directory is being used within a linux docker container. I did not add any tests because it looks like there is no way to mock the `path` platform detection. fixes aws#18861 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@kichik can you try with the latest version? The fix should be in |
It works! Thanks! 🥳 |
|
What is the problem?
aws-lambda-python
does not work, bundling fails.Reproduction Steps
Use the
PythonFunction
construct. Peform a synth.Code excerpt:
What did you expect to happen?
The lambda is bundled successfully.
What actually happened?
Error during synth:
cp: cannot copy a directory, '/asset_input/', into itself, 'asset-output'.
Error: Failed to bundle asset ...
CDK CLI Version
2.10.0
Framework Version
2.10.0
Node.js Version
16.13.0
OS
Windows
Language
Python
Language Version
No response
Other information
The same works on Linux somehow. This is related - #18301
Pinning
aws-cdk.aws-lambda-python-alpha==2.3.0a0
solves the issue.The text was updated successfully, but these errors were encountered: