fermyon/spin

HTTP component sources do not work on Windows

itowlson opened this issue · 4 comments

I ran into this while trying to repro #2111. The static-fileserver template uses a HTTP reference to the fileserver Wasm. On Windows, spin up fails because it is unable to persist the downloaded Wasm file. The error is "failed to persist temporary file path: The parameter is incorrect. (os error 87)" and the location is loader/src/http.rs line 41, temp_path.persist_noclobber.

My guess is that Windows dislikes the colon in file names such as C:\Users\ivan\AppData\Local\spin\registry\wasm\sha256:5f05b15f0f7cd353d390bc5ebffec7fe25c6a6d7a05b9366c86dcb1a346e9f0f but I haven't confirmed that.

I am seeing this on Windows as well. I am using Git Bash for Windows.

I am doing this as a workaround:
spin.toml: source = "../spin-fileserver/target/wasm32-wasi/release/spin_static_fs.wasm"

I then get another error which I can solve by either doing this:
spin up --direct-mounts

Or this:
mkdir -p temp/assets/test0 (test0 is the name of my component for the static file server)
cp assets/* temp/assets/test0/
spin up --temp temp

But I cannot do a spin deploy, even with these workarounds:
Caused by:
0: Failed to load component test0
1: Couldn't resolve C:\Users\David\AppData\Local\Temp\.tmp2HWtYd\test0
2: The system cannot find the file specified. (os error 2)

@david-wallace-croft Sorry for not replying earlier. I think once we fix this and #2111 that should sort out the deploy problem. I'm afraid that for now the only workaround for deployment may be to use WSL2, which I appreciate is rather disruptive. I am hoping to look at these this week.

@itowlson I am able to deploy for the Advent of Spin 2023 submissions by using GitHub CodeSpaces. I made some notes about my setup here:
https://github.com/david-wallace-croft/advent-of-spin

Oh, I'm relieved to hear that! And thanks for sharing your setup!