Open sszabo11 opened 1 week ago
Make sure you're using the latest version of Zig, 0.13. This sounds like the same problem reported in https://github.com/cargo-lambda/cargo-lambda/issues/698#issuecomment-2365031247
I have reinstalled zig with the latest version 0.13. When I check where it is located with cargo lambda system
, it prints out with:
Zig installation found at:
C:\Users\Rabbit Muncher\zig-windows-x86_64-0.13.0\zig.exe
That is where I installed it.
But it still returns with the same error when I run cargo lambda build --release
I'm wondering if this a bug in cargo-zigbuild
and the way it creates bat files on Windows.
'C:\Users\Rabbit' is not recognized as an internal or external command, operable program or batch file.
This error makes me think that something is splitting the command to run by whitespaces, and because your username is Rabbit Muncher
, it's taking C:\Users\Rabbit
as the command to run.
/cc @messense
Yes, I suspected that might be the issue. I'll create a new user, install the necessary packages, and try and build it. I'll get back to you on the results.
I built the function on another account on my machine, and yes it worked. Must be an issue with the space in my user. But still, is there a way to fix that? Thanks for your help.
I suspect the bug is here: https://github.com/rust-cross/cargo-zigbuild/blob/06d31bc66e793e3b4f33d68df7ead7bb329c1c98/src/zig.rs#L1040
We'll need to dive deeper and create a patch to fix it.
I am trying to create a lambda function with rust but I am facing some very annoying issues.
Problem
The build process fails with a linking error when using `cargo lambda build --release``. I suspect this may be related to the cross-compilation toolchain, but I'm not sure how to resolve it.
What I have done
1. Created new function:
2. Tested function locally
localhost:9000
it returns successfully3. TRIED to build function
This is when it turns to HELL I get the following error message:
Followed by a long note:
Followed by a final note:
error: could not compile
banana
(bin "banana") due to 1 previous errorC:\Users\Rabbit Muncher\Desktop\rusty\kol>C:\Users\Rabbit Muncher\scoop\apps\cargo-lambda\current\cargo-lambda.exe zig cc -- -g -target x86_64-linux-gnu @C:\Users\RABBIT~1\AppData\Local\Temp\rustcIbw7hS\linker-arguments