-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Open
Labels
Description
What happened?
While porting a Linux native TinyGo app, I hit missing stdlib APIs in net/http and net that exist in the Go stdlib.
Compile-time failures on TinyGo 0.40.1 (linux/amd64):
s.ListenAndServeTLS undefined (type *http.Server has no field or method ListenAndServeTLS)
t.TLSClientConfig undefined (type *http.Transport has no field or method TLSClientConfig)
t.DisableKeepAlives undefined (type *http.Transport has no field or method DisableKeepAlives)
t.DialContext undefined (type *http.Transport has no field or method DialContext)
undefined: net.InvalidAddrError
undefined: net.InterfaceByName
undefined: net.FilePacketConn
undefined: net.ListenPacket
Reproducer
check_http.go:
package main
import "net/http"
func main() {
s := &http.Server{}
_ = s.ListenAndServeTLS
t := &http.Transport{}
_ = t.TLSClientConfig
_ = t.DisableKeepAlives
_ = t.DialContext
}check_net.go:
package main
import (
"net"
"os"
)
func main() {
var _ net.InvalidAddrError
_, _ = net.InterfaceByName("lo")
_, _ = net.FilePacketConn((*os.File)(nil))
_, _ = net.ListenPacket("udp", ":0")
}Build command:
tinygo build -tags noasm -no-debug ./check_http.go
tinygo build -tags noasm -no-debug ./check_net.goEnvironment
- tinygo version 0.40.1 linux/amd64 (LLVM 20.1.1)
- host: Ubuntu 24.04 (WSL2)
Expected behavior
Either:
- Add these symbols/methods for stdlib compatibility on native Linux targets, or
- Document unsupported APIs at function level so users can feature-gate reliably.
Related
Reactions are currently unavailable