Fix build with older installed golang versions#2664
Fix build with older installed golang versions#2664lkolbly wants to merge 1 commit intoreplicate:mainfrom
Conversation
| @@ -1,9 +1,8 @@ | |||
| module github.com/replicate/cog | |||
|
|
|||
| go 1.25 | |||
There was a problem hiding this comment.
Ah, no can do mi amigo:
(base) lkolbly@B0K3C14:~/cog$ make cog
... lots of stuff ...
go: downloading go1.25 (linux/amd64)
go: download go1.25 for linux/amd64: toolchain not available
make: *** [Makefile:77: generate] Error 1
(base) lkolbly@B0K3C14:~/cog$
There was a problem hiding this comment.
@lkolbly how is go installed? what version? this should "just work" since we perform builds and tests in CI on linux
There was a problem hiding this comment.
@michaeldwan I have 1.22.3:
(base) lkolbly@B0K3C14:~$ go version
go version go1.22.3 linux/amd64
Installed presumably by following the instructions at go.dev (which is to... manually unpack a tarball? Hmm someone should invent a tool to do that for us :D)
Okay so I'm reading https://go.dev/doc/toolchain#config, and it says that:
If the toolchain line is omitted, the module or workspace is considered to have an implicit toolchain goV line, where V is the Go version from the go line. ... For example, a go.mod that says go 1.21.0 with no toolchain line is interpreted as if it had a toolchain go1.21.0 line.
This is a go.mod with no toolchain line, so I guess presumably the toolchain would default to go1.25?
...but, go1.25 is not a valid toolchain, which is the error I'm seeing:
For example, go1.21rc1 and go1.21.0 are toolchain names; go1.21 and go1.22 are not (the initial releases are go1.21.0 and go1.22.0)
So my reading is that, if you don't have a toolchain file, it's invalid to not specify the full patch version for the language? It's weird that go wouldn't lint that though.
(of course, if you have a higher toolchain installed, then go will just use that - in CI presumably you have at least 1.25 installed, so it doesn't try to install 1.25)
But, I think also, this means that I should set the patch version to 1.25.0 (because otherwise it changes the toolchain (and language?) for people with versions 1.25.0 through 1.25.5), I've updated the PR with this change.
(specifying 1.25.0 does exclude all the RCs, I think, where 1.25 maybe does not. Don't quote me on that)
4b97b42 to
7a09930
Compare
7a09930 to
7d47a85
Compare
7d47a85 to
6769e60
Compare
|
@lkolbly you're right. the directive should include the release: Not sure about the makefile change. @tempusfrangit is streamlining the wheel build and removing all the old sdks and runtimes. This might not be needed anymore if you rebase on main. |
Signed-off-by: Lane Kolbly <lkolbly@cloudflare.com>
6769e60 to
bebca5c
Compare
|
@michaeldwan It's possible that maybe this line is good as-is, but we need a But for now, I just updated the PR to |
I tried building cog on my Linux machine (with
make cog), and it failed unless I did these things.Because of https://stackoverflow.com/questions/78519711/toolchain-not-available-error-prevents-me-from-using-any-go-commands and also because it seems like part of the build step needs some wheels built?