cargo-lambda / cargo-lambda

Cargo Lambda is a Cargo subcommand to help you work with AWS Lambda.
https://www.cargo-lambda.info
MIT License
684 stars 80 forks source link

`cargo lambda build` cannot find `zig` after installation in Git bash for Windows #678

Closed DrewMcArthur closed 6 days ago

DrewMcArthur commented 1 month ago

Hey! I'm operating on a windows laptop, and function via git bash.

Here's my output to running cargo lambda build --release

Building the release version of the Rust Lambda...
> Zig is not installed in your system.
How do you want to install Zig? Install with Pip3 (Python 3)
▪▪▪▪▪ Zig installed
Error:   × Failed to find zig

  Was this error unexpected?
  Open an issue in https://github.com/cargo-lambda/cargo-lambda/issues

running pip install zig

$ pip install zig
Requirement already satisfied: zig in c:\users\dmcarthur\appdata\local\continuum\anaconda3\lib\site-packages (1.0.dev0)

but it's not on my path:

$ which zig
which: no zig in (...

I'm sure this is an edge case, and relatively easily solvable. After adding that directory to my path

export PATH="/c/Users/dmcarthur/appdata/local/continuum/anaconda3/lib/site-packages/ziglang/:$PATH"

then which zig and cargo lambda build --release work great! Just wanted to bring this to your attention, in case this is something you wanted to incorporate into the tool. Thanks for your work on this!

calavera commented 1 month ago

Thanks for the information! I'm not sure how we'd cover this case where the installation path for the binary is not in your path, but if you have any good ideas, I'll appreciate a PR.

Maybe we should have some documentation about it.

calavera commented 6 days ago

I'm closing this since I don't think it's actionable unfortunately.