Skip to content

net: "src/net/ip.go:17:2: package internal/strconv is not in std" for Go < 1.26 #5332

@eliasnaur

Description

@eliasnaur

TinyGo fails to build programs importing "net" with Go < 1.26:

$ cd tinygo
$ go version
go version go1.25.6 darwin/arm64
$ go run . version
ld: warning: directory not found for option '-L/opt/homebrew/opt/llvm@20/lib'
ld: warning: directory not found for option '-L/opt/homebrew/opt/llvm@20/lib'
tinygo version 0.41.0 darwin/arm64 (using go version go1.25.6 and LLVM version 20.1.8)
$ cat ~/Downloads/importnet.go
package main

import _ "net"

func main() {
}
$ go run . run ~/Downloads/importnet.go
# github.com/tinygo-org/tinygo
ld: warning: directory not found for option '-L/opt/homebrew/opt/llvm@20/lib'
ld: warning: directory not found for option '-L/opt/homebrew/opt/llvm@20/lib'
../../Library/Caches/tinygo/goroot-1cd19649925db87b1ac4588e9d03dd2778470b0ea5fd74f2d3b6016e92ff344f/src/net/ip.go:17:2: package internal/strconv is not in std (/Users/a/Library/Caches/tinygo/goroot-1cd19649925db87b1ac4588e9d03dd2778470b0ea5fd74f2d3b6016e92ff344f/src/internal/strconv)
exit status 1

Presumably the upgrade #5298 triggered this issue, but it seems to me the root cause is that TinyGo doesn't implement an "internal/strconv" package for Go < 1.26.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingnetworkAnything to do with network use from TinyGo

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions