Replies: 2 comments
-
Please consider possible build environments, like updating AWS CodeBuild images (including Lambda ones) to include nix if this is really the route CDK takes. Hopefully GitHub Actions is also easy to get nix installed. |
Beta Was this translation helpful? Give feedback.
-
Copying my comment from #33880 re: If nix is an implementation detail that the CDK team uses behind the scenes to implement uv support, awesome. If you're expecting customers to have to interact with nix I would strongly suggest reconsidering. As a customer I should just be able to provide a standard pyproject.toml based uv project and tell CDK to build a lambda with uv for me. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi community,
I'm exploring the use of Nix as a universal option for bundling Lambda code in CDK. Compared to the current approach, which relies on Docker with ad-hoc bundling options, Nix allows for more fine-grained control over dependencies and a reproducible environment.
When introducing a new option for a build tool or adding support for a different bundling tool, the CDK team must evaluate how this change affects existing users, ensuring compatibility and stability. This includes extensive testing of various bundling option combinations and potentially preparing a new Docker image. That can be a time-consuming process.
Currently, the available escape hatch is to provide a custom Docker image, often requiring you to build your own image and include some shell scripts. By using Nix, these challenges are significantly reduced, as it eliminates the need for prebuilt Docker images and simplifies dependency management. Furthermore, when a build runs on a host machine with Nix installed, it takes advantage of Nix's excellent caching capabilities, leading to improved performance.
I’ve put together a POC along with some examples here:
I’d love to hear your thoughts on this approach! If there are any Nix experts here, I’d appreciate any insights or potential concerns regarding its use.
Beta Was this translation helpful? Give feedback.
All reactions