tinygo-org / tinygo

Go compiler for small places. Microcontrollers, WebAssembly (WASM/WASI), and command-line tools. Based on LLVM.
https://tinygo.org
Other
15.43k stars 911 forks source link

Cannot compile on linux when import "net" #1602

Open RudolfVonKrugstein opened 3 years ago

RudolfVonKrugstein commented 3 years ago

When trying to compile this:

package main

import (
    "fmt"
    _ "net"
)

func main() {
    fmt.Println("Hello")
}

with these comands:

# docker run --privileged --rm -v $(pwd):/src -ti tinygo/tinygo bash
> cd /src
> tinygo run main.go

I get:

# net
../usr/include/netdb.h:617:23: unexpected token ILLEGAL
../usr/include/netdb.h:618:22: unexpected token ILLEGAL
../usr/include/netdb.h:624:23: unexpected token ILLEGAL
../usr/include/netdb.h:625:25: unexpected token ILLEGAL
../usr/include/netdb.h:617:23: unexpected token ILLEGAL
../usr/include/netdb.h:618:22: unexpected token ILLEGAL
../usr/include/netdb.h:624:23: unexpected token ILLEGAL
../usr/include/netdb.h:625:25: unexpected token ILLEGAL
../usr/include/netdb.h:617:23: unexpected token ILLEGAL
../usr/include/netdb.h:618:22: unexpected token ILLEGAL
../usr/include/netdb.h:624:23: unexpected token ILLEGAL
../usr/include/netdb.h:625:25: unexpected token ILLEGAL

I get the same error, when I have included the bluetooth package (https://github.com/tinygo-org/bluetooth).

So I can not compile for linux with the bluetooth package.

rzr commented 3 years ago

net API is not yet supported according to:

https://tinygo.org/lang-support/stdlib/#net

# net
/home/ron/.gvm/gos/go1.15/src/net/parse.go:80:12: st.ModTime undefined (type os.FileInfo has no field or method ModTime)

Relate-to: https://github.com/rzr/webthing-go/issues/4