You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This was reported originally in awslabs/aws-lambda-rust-runtime#927, but after some investigation, I discovered that the problem lays on how cargo-zigbuild works on Windows.
If the path where cargo-zigbuild lives on Windows includes spaces, the build will fail because the path is not sanitized. When the linker is executed on Windows, Windows will interpret the first section of the path as the binary to execution, and it will fail because that path doesn't exist.
This is easily reproducible by putting the cargo-zigbuild.exe binary in a path with a space in it, and trying to build any rust project with it. You'll get an error like the screenshot below shows where Windows thinks that the first part of the path, until the space, is the command to execute:
I did some investigation, and it looks like the code to create the bat file on windows doesn't sanitize paths, but I don't know if that's the only problem:
PS: The screenshot say cargo-lambda.exe but that's a wrapper around cargo-zigbuild, which ultimately creates the linker script to execute and runs the command:
The text was updated successfully, but these errors were encountered:
This was reported originally in awslabs/aws-lambda-rust-runtime#927, but after some investigation, I discovered that the problem lays on how cargo-zigbuild works on Windows.
If the path where cargo-zigbuild lives on Windows includes spaces, the build will fail because the path is not sanitized. When the linker is executed on Windows, Windows will interpret the first section of the path as the binary to execution, and it will fail because that path doesn't exist.
This is easily reproducible by putting the cargo-zigbuild.exe binary in a path with a space in it, and trying to build any rust project with it. You'll get an error like the screenshot below shows where Windows thinks that the first part of the path, until the space, is the command to execute:
I did some investigation, and it looks like the code to create the bat file on windows doesn't sanitize paths, but I don't know if that's the only problem:
cargo-zigbuild/src/zig.rs
Line 1040 in 06d31bc
PS: The screenshot say
cargo-lambda.exe
but that's a wrapper around cargo-zigbuild, which ultimately creates the linker script to execute and runs the command:The text was updated successfully, but these errors were encountered: