cmd/ebitenmobile: bug fix: need toolchain for the temporary go.mod

Updates #3086
This commit is contained in:
Hajime Hoshi 2024-09-14 01:00:17 +09:00
parent dd19552f88
commit f63a757b1e

View File

@ -161,6 +161,12 @@ import (
return tmp, err
}
}
// runtime.Version() is the current executing Go version. For example, this is the version of the toolchain directive in go.mod.
// This might differ from the Go command version under the temporary directory.
// To avoid the version mismatch, set the toolchain explicitly (#3086).
if err := runGo("mod", "edit", "-toolchain="+runtime.Version()); err != nil {
return tmp, err
}
if err := runGo("mod", "tidy"); err != nil {
return tmp, err
}