aws / aws-lambda-builders

Python library to compile, build & package AWS Lambda functions for several runtimes & framework
Apache License 2.0
334 stars 139 forks source link

fix: Update esbuild binary fetching logic to look inside of `build_dir` #550

Closed lucashuy closed 11 months ago

lucashuy commented 11 months ago

Issue #, if available: N/A

Description of changes: The workflow currently looks at the scratch directory to determine if esbuild is present or not. This is not the case for build in source however, as the Node modules are installed in the source directory, not the scratch directory.

This change updates the path to be build_dir, which is already set to the correct folder from earlier in the workflow.

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

mndeveci commented 11 months ago

I see how this will work with build in source improvement, but will it still work with existing workflow which builds in scratch directory? cc: @mildaniel

lucashuy commented 11 months ago

I'm not Daniel :), but it should still work for non build in source flows.

The esbuild workflow defines a default building directory. When the workflow is initialized, it sets the build directory based on if build in source is enabled, and if the workflow supports it.

The unit test should cover this case (build in source enabled vs disabled)

mndeveci commented 11 months ago

I'm not Daniel :), but it should still work for non build in source flows.

The esbuild workflow defines a default building directory. When the workflow is initialized, it sets the build directory based on if build in source is enabled, and if the workflow supports it.

The unit test should cover this case (build in source enabled vs disabled)

I was summoning him for his feedback but I see that you already answered my question :)

mildaniel commented 11 months ago

What Lucas said 😆 This change shouldn't impact the existing workflow at all