Skip to content

fix: replace symlinks with dirs for Finch container mount compatibility - #6

Merged
bnusunny merged 7 commits into
developfrom
fix-finch-symlink-mount
Feb 14, 2026
Merged

fix: replace symlinks with dirs for Finch container mount compatibility#6
bnusunny merged 7 commits into
developfrom
fix-finch-symlink-mount

Conversation

@bnusunny

Copy link
Copy Markdown
Owner

When build_in_source is used with Node.js, the build directory contains a node_modules symlink. During local invoke, Finch (containerd/runc) fails with 'not a directory' when creating a mountpoint over the symlink. This fix temporarily replaces symlinks with empty directories before container creation, then restores them afterward.

seshubaws and others added 7 commits February 12, 2026 19:19
…8647)

Docker's images.list(name='samcli/lambda') does exact repository matching
and won't match repositories like 'samcli/lambda-python'. This caused
stale images to persist across parameterized test classes, leading to
flaky test_download_two_layers failures where Layer2 should overwrite
Layer1 but the image was never rebuilt.

Fix by:
1. Adding _cleanup_samcli_images() that lists all images and filters by
   'samcli/lambda-' tag prefix
2. Using this method in both tearDown and tearDownClass
3. Fixing the same pattern in TestLayerVersionThatDoNotCreateCache
* fix: isolate PyInstaller library paths for subprocess calls

When SAM CLI runs from the native installer (PyInstaller-based), it sets
LD_LIBRARY_PATH/DYLD_LIBRARY_PATH to include bundled libraries. This causes
conflicts when spawning external processes like npm, node, or pip that need
system libraries (e.g., OpenSSL version mismatch on Fedora 43).

This change:
- Detects PyInstaller bundle via sys._MEIPASS
- Filters bundled library paths from environment variables early in CLI init
- Ensures external processes use system libraries instead of bundled ones

Fixes aws#8542

* fix: use more specific path filtering to avoid filtering legitimate system paths

Addressed review feedback from @bnusunny:
- Changed from '_internal not in p' to 'p.endswith(/_internal)'
- This prevents accidentally filtering legitimate system paths that contain _internal in the middle
- Added test to verify paths like /usr/lib/some_internal_lib are preserved

---------

Co-authored-by: Harold Sun <sunhua@amazon.com>
Bumps [pycparser](https://github.com/eliben/pycparser) from 2.22 to 3.0.
- [Release notes](https://github.com/eliben/pycparser/releases)
- [Commits](eliben/pycparser@release_v2.22...release_v3.00)

---
updated-dependencies:
- dependency-name: pycparser
  dependency-version: '3.0'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ws#8629)

Bumps [aws-actions/configure-aws-credentials](https://github.com/aws-actions/configure-aws-credentials) from 5 to 6.
- [Release notes](https://github.com/aws-actions/configure-aws-credentials/releases)
- [Changelog](https://github.com/aws-actions/configure-aws-credentials/blob/main/CHANGELOG.md)
- [Commits](aws-actions/configure-aws-credentials@v5...v6)

---
updated-dependencies:
- dependency-name: aws-actions/configure-aws-credentials
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
When build_in_source is used with Node.js, the build directory contains
a node_modules symlink. During local invoke, SAM CLI resolves this symlink
and creates an additional bind mount. Docker tolerates creating a mountpoint
over a symlink, but Finch (containerd/runc) fails with 'not a directory'.

This fix temporarily replaces symlinks with empty directories before
container creation, then restores them afterward. This ensures:
- Finch/runc gets a valid directory mountpoint
- Docker continues to work as before
- Repeated invocations work because symlinks are restored
- Host filesystem is left unchanged even if container creation fails
@bnusunny
bnusunny merged commit 19bef71 into develop Feb 14, 2026
8 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