cdklabs / cdklabs/aws-lambda-rust

Build Rust lambda on Windows fails due to invalid name of binaries

Đang mở
#494 1 bình luận 0 reaction 1 người được giao Được @stevehouel nhận Xem trên GitHub
Ngôn ngữ chính
TypeScript
Star
20
Fork
2
Merge trung bình
14 phút
Pull request đã merge (30 ngày)
5

Mô tả

When compiling a lambda for Rust using `cdk deploy` on Windows, the following error occurs:

```
bash: line 1: cargo-zigbuild.cmd: command not found
```

The following command is executed right before the error occurs:

```powershell
docker run --rm -u "1000:1000" -v "C:\\...\\lambda\\input-rust:/asset-input:delegated" -v "C:\\...\\cdk.out\\bundling-temp-03bd30f19334cab2ae18b7174c93b37693217b01635a7c8374264b1c777707ce-building:/asset-output:delegated" -w "/asset-input" cdk-17fb3785ac963db9e8320a984ec540bbbdbce8a3addc1c2485e82f5bb0639a94 bash -c "cargo-zigbuild.cmd zigbuild --manifest-path=/asset-input/Cargo.toml --target x86_64-unknown-linux-gnu --release --color always --bin input-rust && powershell -command Move-Item -Path /asset-input/target/x86_64-unknown-linux-gnu/release/input-rust -Destination /asset-output/bootstrap"
```

As can be seen in the output, the command `cargo-zigbuild.cmd` is supposed to be exeucted. After investigating the image, the command `cargo-zigbuild.cmd` is not part of the image. Only the command `cargo-zigbuild` can be found.

The same project compiles on WSL using Ubuntu 22 without any error.

Looking at the source code of aws-lambda-rust, it is hard coded that on Windows platform, that `.cmd` is always appended to the build command, see:

https://github.com/cdklabs/aws-lambda-rust/blob/6c9a60fcd966745e02949515393946029b78dc0e/src/package-manager.ts#L56

Apparently this leads to errors, because the binaries are not installed with .cmd ending but without it (same as on linux).

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.