Skip to content
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: Fix copying symlink files for Windows #7351

Merged
merged 3 commits into from
Aug 14, 2024
Merged

Conversation

hnnasit
Copy link
Contributor

@hnnasit hnnasit commented Aug 13, 2024

Which issue(s) does this change fix?

#6943

Note: Adding an integration test seemed like an overkill for a small change. I've added unit tests to cover these, but lmk if you feel adding one is necessary.

Why is this change necessary?

When the shared (within same code_uri) node_module dependencies were copied over to the other Function, the symlink files were not being copied over. However, as mentioned in the docs, copy2 does not copy symlinks on all the platforms (Windows being 1 of them). This causes OsError to be thrown crashing the command.

How does it address the issue?

Catches the exception and handles it by calling create_symlink_or_copy function to either create a symlink or copy the target file directly.

What side effects does this change have?

No side effects.

Mandatory Checklist

PRs will only be reviewed after checklist is complete

  • Add input/output type hints to new functions/methods
  • Write design document if needed (Do I need to write a design document?)
  • Write/update unit tests
  • Write/update integration tests
  • Write/update functional tests if needed
  • make pr passes
  • make update-reproducible-reqs if dependencies were changed
  • Write documentation

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@hnnasit hnnasit marked this pull request as ready for review August 14, 2024 14:59
@hnnasit hnnasit requested a review from a team as a code owner August 14, 2024 14:59
@hnnasit hnnasit added this pull request to the merge queue Aug 14, 2024
Merged via the queue into aws:develop with commit e608383 Aug 14, 2024
55 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants