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

Feature request: Resolve symlinks in sam build #7887

Closed
bryandatanerds opened this issue Feb 13, 2025 · 8 comments
Closed

Feature request: Resolve symlinks in sam build #7887

bryandatanerds opened this issue Feb 13, 2025 · 8 comments
Labels
stage/needs-feedback Needs feedback from the community (are you also interested in/experiencing this?) type/feature Feature request

Comments

@bryandatanerds
Copy link

Describe your idea/feature/enhancement

As requested in #7865, I am opening this as we have a build pipeline that relies on symlinks outside of the build directory being mounted during sam build. Our process is to create a temporary build/ directory within our repo, symlink only the parts of the repo that should be included in the SAM application into there, and then run sam build --use-container with CodeUri pointed to the build directory. Symlinking saves us having to copy most of our source tree.

Proposal

We would appreciate if there were a way to tell sam build --use-container to mount symlinks outside the build tree.

Thank you!

@bryandatanerds bryandatanerds added stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at. type/feature Feature request labels Feb 13, 2025
@vicheey vicheey added stage/needs-feedback Needs feedback from the community (are you also interested in/experiencing this?) and removed stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at. labels Feb 17, 2025
@vicheey
Copy link
Contributor

vicheey commented Feb 17, 2025

Thank you for creating this issue. I'll keep this request open for now to collect feedback from the community. With enough support, we will prioritize this feature request accordingly.

@paulflew
Copy link

+1

We use Github actions (aws-actions/setup-sam, etc) to build and deploy. Our source code contains symlinks to shared source files. Our current workaround is hard-coding SAM CLI v1.132.0 in .github/workflows/pipeline.yaml:

  - uses: aws-actions/setup-sam@v2
    with:
      version: 1.132.0

Would prefer to use a supported parameter instead.

@valerena
Copy link
Contributor

There's a new parameter added in SAM CLI 1.134.0 called --mount-symlinks #7891 that keeps the previous behavior

It was just added to the documentation a couple of days ago: https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-build.html#ref-sam-cli-build-options-mount-symlinks

@vicheey
Copy link
Contributor

vicheey commented Feb 21, 2025

Please bryandatanerds and paulflew, please let us know if --mount-symlinks resolves your issue.

@paulflew
Copy link

Yes, that's fixed our GitHub build issue. Thx for the quick response.

@mbfreder
Copy link
Contributor

Closing this as the issue is fixed.

Copy link
Contributor

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@bryandatanerds
Copy link
Author

Works here too. Thank you very much for adding this back in!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage/needs-feedback Needs feedback from the community (are you also interested in/experiencing this?) type/feature Feature request
Projects
None yet
Development

No branches or pull requests

5 participants