Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 3
Message 1 of 2

%LocalAppData% unset on Windows when using Actions for CI

While testing a Go project on Windows, I came across an error:

 

build cache is required, but could not be located: GOCACHE is not defined and %LocalAppData% is not defined

I can set GOCACHE or LocalAppData, but that seems unnecessary. LocalAppData should be set on Windows builds.

 

This will make testing most Go tools on Windows hard, as they will usually require writing to GOCACHE, which falls back to a directory under LocalAppData when unset.

 

Full logs: https://github.com/mvdan/unparam/runs/219056273

1 Reply
GitHub Staff
Message 2 of 2

Re: %LocalAppData% unset on Windows when using Actions for CI

I am not sure what is going on there.  I forked your repo and dumped the environment variables before go was run and LOCALAPPDATA is there https://github.com/chrispat/unparam/commit/fc77b63dbde48b7ba1fdd5fc29e476f59875b94b/checks?check_sui...

 

I don't know a lot about Go so I am not sure where to start debugging.  Is it possbile your test-script model that runs your go test scripts is not passing the entire environment along when it launches go?