Closed PeterMHammond closed 3 months ago
Kia ora @PeterMHammond, you can update the path for Spin to find your Wasm file in the [component.xyz]
source
field of your spin.toml
file e.g.
[component.v2vanilla]
source = "target/wasm32-wasi/release/v2vanilla.wasm" # Change this to point to your output location
The templates generate the default location because the Spin template system is not wise to users' Cargo settings, but it's only an initial generate and you can modify to suit your system.
Kia ora @PeterMHammond, you can update the path for Spin to find your Wasm file in the
[component.xyz]
source
field of yourspin.toml
file e.g.[component.v2vanilla] source = "target/wasm32-wasi/release/v2vanilla.wasm" # Change this to point to your output location
The templates generate the default location because the Spin template system is not wise to users' Cargo settings, but it's only an initial generate and you can modify to suit your system.
Thank you for pointing that out. My apologies, as I should have checked into the spin.toml more. I assume it would resolve this issue. I'll close the issue.
Describe the bug spin up does not use a custom Cargo build location set in the CARGO_TARGET_DIR environment variable and returns an error. For example, my system was set to use a special build drive:
Error Example
Frequency of the bug Please check one:
Set-up information Please share the version of Spin used when the bug occurred. You can find the version of Spin by running
spin -V
.To Reproduce Steps to reproduce the behavior:
CARGO_TARGET_DIR
to a different directory than the default:$env:CARGO_TARGET_DIR = "D:\Rust\cache_directory"
spin build
Expected behavior
spin build
,spin up
, andspin deploy
should use the path from theCARGO_TARGET_DIR
, if it has been set.Screenshots
Additional context Once I removed the custom variable using:
Remove-Item Env:CARGO_TARGET_DIR
Thespin build
,spin up
, andspin deploy
commands worked as expected.