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: Resolve symlinks on local invoke only #7865

Merged
merged 1 commit into from
Feb 6, 2025

Conversation

valerena
Copy link
Contributor

@valerena valerena commented Feb 5, 2025

SAM CLI shouldn't be mounting symlinks by default when building in a container

Which issue(s) does this change fix?

Why is this change necessary?

Symbolic links are used in SAM CLI to achieve faster build times with build-in-source. The build process creates symlinks for dependencies, that then can be used when running sam local invoke. These symlinks don't need to be mounted during sam build.

How does it address the issue?

We add a new context property for the container to make a different decision depending on the context.

What side effects does this change have?

If SAM CLI users were relying on this behavior during builds, their workflow might get broken. Please create an issue if you're affected by this change, and we'll prioritize to add a new property to allow mounting symlinks in any case.

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.

SAM CLI shouldn't be resolving/mounting symlinks by default when
building in a container.
@valerena valerena requested a review from a team as a code owner February 5, 2025 23:28
@github-actions github-actions bot added area/local/start-api sam local start-api command area/build sam build command area/local/invoke sam local invoke command area/local/start-invoke pr/external stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at. labels Feb 5, 2025

Parameters
----------
context : sacli.local.docker.container.ContainerContext
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: samcli but not a blocker

Copy link
Member

@roger-zhangg roger-zhangg left a comment

Choose a reason for hiding this comment

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

LGTM

@valerena valerena added this pull request to the merge queue Feb 6, 2025
Merged via the queue into aws:develop with commit a643c2c Feb 6, 2025
52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/build sam build command area/local/invoke sam local invoke command area/local/start-api sam local start-api command area/local/start-invoke pr/external stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants