cdklabs / cdklabs/aws-lambda-rust

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

Abierto
#494 1 comentario 0 reacciones 1 asignado Reclamado por @stevehouel Ver en GitHub
Lenguaje dominante
TypeScript
Estrellas
20
Forks
2
Merge medio
14 min
PR fusionados (30 d)
5

Descripción

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).

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.